From fd4614a8d944be74924d2ea45eed5b9fa7b27db3 Mon Sep 17 00:00:00 2001 From: stefanjones Date: Tue, 20 Jul 2004 22:37:50 +0000 Subject: [PATCH] 2004-07-20 Stefan Jones * src/tclspice.c: Make callback return plot index also --- ChangeLog | 1 + src/frontend/plotting/plotit.c | 2 +- src/include/tclspice.h | 2 +- src/tclspice.c | 9 ++++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index fff49b09b..2b6130332 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * src/tclspice.c: blt_plot() - look for BLT vectors ::spice::[XY]_Data + Make callback return plot index also 2004-07-19 Stefan Jones diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index db737cff0..3f815481e 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -956,7 +956,7 @@ plotit(wordlist *wl, char *hcopy, char *devname) if (devname && eq(devname, "blt")) { /* Just send the pairs to Tcl/Tk */ for (d = vecs; d; d = d->v_link2) { - blt_plot(d, oneval ? (struct dvec *) NULL : d->v_scale); + blt_plot(d, oneval ? (struct dvec *) NULL : d->v_scale,(d==vecs?1:0)); } rtn = TRUE; goto quit; diff --git a/src/include/tclspice.h b/src/include/tclspice.h index e25e1363d..6cd2e9a6d 100755 --- a/src/include/tclspice.h +++ b/src/include/tclspice.h @@ -28,6 +28,6 @@ extern int sp_Tk_Update(void); /* The blt callback method */ #include -extern int blt_plot(struct dvec *y,struct dvec *x); +extern int blt_plot(struct dvec *y,struct dvec *x,int new); #endif diff --git a/src/tclspice.c b/src/tclspice.c index 7aa2bf95e..08f13a826 100755 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1326,7 +1326,8 @@ static void dvecToBlt(Blt_Vector *Data, struct dvec *x) { return; } -int blt_plot(struct dvec *y,struct dvec *x){ +int blt_plot(struct dvec *y,struct dvec *x,int new){ + static int ctr=-1; Blt_Vector *X_Data=NULL, *Y_Data=NULL; char buf[1024]; @@ -1345,9 +1346,11 @@ int blt_plot(struct dvec *y,struct dvec *x){ dvecToBlt(X_Data,x); dvecToBlt(Y_Data,y); - sprintf(buf,"spice_gr_Plot %s %s %s %s %s %s", + if(new) ctr++; + + sprintf(buf,"spice_gr_Plot %s %s %s %s %s %s %d", x->v_name, ft_typenames(x->v_type), ft_typabbrev(x->v_type), - y->v_name, ft_typenames(y->v_type), ft_typabbrev(y->v_type)); + y->v_name, ft_typenames(y->v_type), ft_typabbrev(y->v_type),ctr); if(Tcl_Eval(spice_interp,buf) != TCL_OK) { Tcl_ResetResult(spice_interp);