From bdd641cad3dd08de545f4bd27845113e7b4193b1 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sat, 11 Nov 2023 00:03:22 +0100 Subject: [PATCH] allow tcleval(xxxx) in % dataset specification on graph nodes --- src/draw.c | 9 +++++---- xschem_library/examples/cmos_example.sch | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/draw.c b/src/draw.c index c2652c4f..b3930675 100644 --- a/src/draw.c +++ b/src/draw.c @@ -2755,6 +2755,7 @@ static void draw_graph_variables(int wcnt, int wave_color, int n_nodes, int swee } else { char *ntok_ptr = NULL; char *alias_ptr = NULL; + dbg(1, "ntok=%s\n", ntok); if(strstr(ntok, ";")) { my_strdup2(_ALLOC_ID_, &alias_ptr, tcl_hook2(find_nth(ntok, ";", "\"", 0, 1))); my_strdup2(_ALLOC_ID_, &ntok_ptr, find_nth(ntok, ";", "\"", 0, 2)); @@ -3280,9 +3281,9 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) /* graph box, gridlines and axes */ draw_graph_grid(gr, ct); /* get data to plot */ - my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0)); - my_strdup2(_ALLOC_ID_, &color, get_tok_value(r->prop_ptr,"color",0)); - my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0)); + my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",2)); + my_strdup2(_ALLOC_ID_, &color, get_tok_value(r->prop_ptr,"color",2)); + my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",2)); my_strdup2(_ALLOC_ID_, &custom_rawfile, get_tok_value(r->prop_ptr,"rawfile",0)); my_strdup2(_ALLOC_ID_, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); if(sch_waves_loaded()!= -1 && custom_rawfile[0]) { @@ -3329,7 +3330,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) } /* if % is specified after node name, is the dataset number to plot in graph */ if(nd[0]) { - node_dataset = atoi(nd); + node_dataset = atoi(tcl_hook2(nd)); my_strdup(_ALLOC_ID_, &ntok_copy, find_nth(ntok, "%", "\"", 0, 1)); } else { node_dataset = -1; diff --git a/xschem_library/examples/cmos_example.sch b/xschem_library/examples/cmos_example.sch index 12788e99..9b0bb6a8 100644 --- a/xschem_library/examples/cmos_example.sch +++ b/xschem_library/examples/cmos_example.sch @@ -60,7 +60,7 @@ x1=2.3 x2=2.7 divx=6 subdivx=1 -node="diffout@2uA;v(diffout)%0 +node="tcleval($\{iset0\}A);v(diffout)%0 diffout@10uA;v(diffout)%1 diffout@100uA;v(diffout)%2" color="8 7 6"