some cleanups in scheduler.c "xschem annotate_op" command.

This commit is contained in:
Stefan Frederik 2022-09-20 23:07:50 +02:00
parent b542186ebd
commit 933faceabf
2 changed files with 14 additions and 11 deletions

View File

@ -246,7 +246,7 @@ static void backannotate_at_cursor_b_pos(xRect *r, Graph_ctx *gr)
}
}
dbg(1, "xx=%g, p=%d\n", xx, p);
tcleval("array unset ::ngspice::ngspice_data");
tcleval("array unset ngspice::ngspice_data");
xctx->graph_backannotate_p = p;
for(i = 0; i < xctx->graph_nvars; i++) {
char s[100];

View File

@ -376,18 +376,21 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
tclsetvar("rawfile_loaded", "0");
free_rawfile(1);
tcleval("array unset ngspice::ngspice_data");
raw_read(f, "op");
if(xctx->graph_values) xctx->graph_backannotate_p = 0;
for(i = 0; i < xctx->graph_nvars; i++) {
char s[100];
int p = 0;
my_snprintf(s, S(s), "%.4g", xctx->graph_values[i][p]);
dbg(1, "%s = %g\n", xctx->graph_names[i], xctx->graph_values[i][p]);
tclvareval("array set ngspice::ngspice_data [list {", xctx->graph_names[i], "} ", s, "]", NULL);
if(xctx->graph_values) {
xctx->graph_backannotate_p = 0;
for(i = 0; i < xctx->graph_nvars; i++) {
char s[100];
int p = 0;
my_snprintf(s, S(s), "%.4g", xctx->graph_values[i][p]);
dbg(1, "%s = %g\n", xctx->graph_names[i], xctx->graph_values[i][p]);
tclvareval("array set ngspice::ngspice_data [list {", xctx->graph_names[i], "} ", s, "]", NULL);
}
tclvareval("set ngspice::ngspice_data(n\\ vars) ", my_itoa( xctx->graph_nvars), NULL);
tclvareval("set ngspice::ngspice_data(n\\ points) 1", NULL);
draw();
}
tclvareval("set ngspice::ngspice_data(n\\ vars) ", my_itoa( xctx->graph_nvars), NULL);
tclvareval("set ngspice::ngspice_data(n\\ points) 1", NULL);
draw();
}
else if(!strcmp(argv[1],"arc"))