better graphdialog layout, remove tcl redundant raw_level var
This commit is contained in:
parent
63bc486391
commit
537cedbafe
|
|
@ -685,7 +685,6 @@ void free_rawfile(Raw **rawptr, int dr)
|
||||||
}
|
}
|
||||||
if(raw->npoints) my_free(_ALLOC_ID_, &raw->npoints);
|
if(raw->npoints) my_free(_ALLOC_ID_, &raw->npoints);
|
||||||
if(raw->schname) my_free(_ALLOC_ID_, &raw->schname);
|
if(raw->schname) my_free(_ALLOC_ID_, &raw->schname);
|
||||||
tclsetintvar("raw_level", -1);
|
|
||||||
if(raw->table.table) int_hash_free(&raw->table);
|
if(raw->table.table) int_hash_free(&raw->table);
|
||||||
my_free(_ALLOC_ID_, rawptr);
|
my_free(_ALLOC_ID_, rawptr);
|
||||||
if(deleted && dr) draw();
|
if(deleted && dr) draw();
|
||||||
|
|
@ -774,7 +773,6 @@ int raw_read(const char *f, Raw **rawptr, const char *type)
|
||||||
*rawptr = my_calloc(_ALLOC_ID_, 1, sizeof(Raw));
|
*rawptr = my_calloc(_ALLOC_ID_, 1, sizeof(Raw));
|
||||||
raw = *rawptr;
|
raw = *rawptr;
|
||||||
raw->level = -1;
|
raw->level = -1;
|
||||||
tclsetintvar("raw_level", -1);
|
|
||||||
raw->annot_p = -1;
|
raw->annot_p = -1;
|
||||||
|
|
||||||
int_hash_init(&raw->table, HASHSIZE);
|
int_hash_init(&raw->table, HASHSIZE);
|
||||||
|
|
@ -784,7 +782,6 @@ int raw_read(const char *f, Raw **rawptr, const char *type)
|
||||||
int i;
|
int i;
|
||||||
my_strdup2(_ALLOC_ID_, &raw->schname, xctx->sch[xctx->currsch]);
|
my_strdup2(_ALLOC_ID_, &raw->schname, xctx->sch[xctx->currsch]);
|
||||||
raw->level = xctx->currsch;
|
raw->level = xctx->currsch;
|
||||||
tclsetintvar("raw_level", xctx->currsch);
|
|
||||||
raw->allpoints = 0;
|
raw->allpoints = 0;
|
||||||
for(i = 0; i < raw->datasets; ++i) {
|
for(i = 0; i < raw->datasets; ++i) {
|
||||||
raw->allpoints += raw->npoints[i];
|
raw->allpoints += raw->npoints[i];
|
||||||
|
|
@ -840,7 +837,6 @@ int table_read(const char *f)
|
||||||
}
|
}
|
||||||
xctx->raw = my_calloc(_ALLOC_ID_, 1, sizeof(Raw));
|
xctx->raw = my_calloc(_ALLOC_ID_, 1, sizeof(Raw));
|
||||||
xctx->raw->level = -1;
|
xctx->raw->level = -1;
|
||||||
tclsetintvar("raw_level", -1);
|
|
||||||
xctx->raw->annot_p = -1;
|
xctx->raw->annot_p = -1;
|
||||||
|
|
||||||
/* quick inspect file and get upper bound of number of data lines */
|
/* quick inspect file and get upper bound of number of data lines */
|
||||||
|
|
@ -927,7 +923,6 @@ int table_read(const char *f)
|
||||||
int i;
|
int i;
|
||||||
my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[xctx->currsch]);
|
my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[xctx->currsch]);
|
||||||
xctx->raw->level = xctx->currsch;
|
xctx->raw->level = xctx->currsch;
|
||||||
tclsetintvar("raw_level", xctx->currsch);
|
|
||||||
xctx->raw->allpoints = 0;
|
xctx->raw->allpoints = 0;
|
||||||
for(i = 0; i < xctx->raw->datasets; ++i) {
|
for(i = 0; i < xctx->raw->datasets; ++i) {
|
||||||
xctx->raw->allpoints += xctx->raw->npoints[i];
|
xctx->raw->allpoints += xctx->raw->npoints[i];
|
||||||
|
|
|
||||||
|
|
@ -1160,7 +1160,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
if(!strcmp(argv[2], "rectcolor")) { /* current layer number */
|
if(!strcmp(argv[2], "raw_level")) { /* hierarchy level where raw file was loaded */
|
||||||
|
int ret = -1;
|
||||||
|
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||||
|
if(xctx->raw) ret = xctx->raw->level;
|
||||||
|
Tcl_SetResult(interp, my_itoa(ret),TCL_VOLATILE);
|
||||||
|
}
|
||||||
|
else if(!strcmp(argv[2], "rectcolor")) { /* current layer number */
|
||||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||||
Tcl_SetResult(interp, my_itoa(xctx->rectcolor),TCL_VOLATILE);
|
Tcl_SetResult(interp, my_itoa(xctx->rectcolor),TCL_VOLATILE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -743,7 +743,7 @@ namespace eval ngspice {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc ngspice::get_current {n} {
|
proc ngspice::get_current {n} {
|
||||||
global raw_level
|
set raw_level [xschem get raw_level]
|
||||||
set path [string range [xschem get sch_path] 1 end]
|
set path [string range [xschem get sch_path] 1 end]
|
||||||
# skip hierarchy components above the level where raw file has been loaded.
|
# skip hierarchy components above the level where raw file has been loaded.
|
||||||
# node path names to look up in raw file begin from there.
|
# node path names to look up in raw file begin from there.
|
||||||
|
|
@ -787,7 +787,7 @@ proc ngspice::get_current {n} {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc ngspice::get_diff_voltage {n m} {
|
proc ngspice::get_diff_voltage {n m} {
|
||||||
global raw_level
|
set raw_level [xschem get raw_level]
|
||||||
set path [string range [xschem get sch_path] 1 end]
|
set path [string range [xschem get sch_path] 1 end]
|
||||||
# skip hierarchy components above the level where raw file has been loaded.
|
# skip hierarchy components above the level where raw file has been loaded.
|
||||||
# node path names to look up in raw file begin from there.
|
# node path names to look up in raw file begin from there.
|
||||||
|
|
@ -818,7 +818,7 @@ proc ngspice::get_diff_voltage {n m} {
|
||||||
|
|
||||||
|
|
||||||
proc ngspice::get_voltage {n} {
|
proc ngspice::get_voltage {n} {
|
||||||
global raw_level
|
set raw_level [xschem get raw_level]
|
||||||
set path [string range [xschem get sch_path] 1 end]
|
set path [string range [xschem get sch_path] 1 end]
|
||||||
# skip hierarchy components above the level where raw file has been loaded.
|
# skip hierarchy components above the level where raw file has been loaded.
|
||||||
# node path names to look up in raw file begin from there.
|
# node path names to look up in raw file begin from there.
|
||||||
|
|
@ -853,7 +853,7 @@ proc update_schematic_header {} {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc ngspice::get_node {n} {
|
proc ngspice::get_node {n} {
|
||||||
global raw_level
|
set raw_level [xschem get raw_level]
|
||||||
set path [string range [xschem get sch_path] 1 end]
|
set path [string range [xschem get sch_path] 1 end]
|
||||||
# skip hierarchy components above the level where raw file has been loaded.
|
# skip hierarchy components above the level where raw file has been loaded.
|
||||||
# node path names to look up in raw file begin from there.
|
# node path names to look up in raw file begin from there.
|
||||||
|
|
@ -2003,6 +2003,7 @@ proc graph_edit_properties {n} {
|
||||||
-xscrollcommand {.graphdialog.center.left.xscroll set}
|
-xscrollcommand {.graphdialog.center.left.xscroll set}
|
||||||
scrollbar .graphdialog.center.left.yscroll -command {.graphdialog.center.left.list1 yview}
|
scrollbar .graphdialog.center.left.yscroll -command {.graphdialog.center.left.list1 yview}
|
||||||
scrollbar .graphdialog.center.left.xscroll -orient horiz -command {.graphdialog.center.left.list1 xview}
|
scrollbar .graphdialog.center.left.xscroll -orient horiz -command {.graphdialog.center.left.list1 xview}
|
||||||
|
|
||||||
grid .graphdialog.center.left.lab1 .graphdialog.center.left.add
|
grid .graphdialog.center.left.lab1 .graphdialog.center.left.add
|
||||||
grid .graphdialog.center.left.list1 - .graphdialog.center.left.yscroll -sticky nsew
|
grid .graphdialog.center.left.list1 - .graphdialog.center.left.yscroll -sticky nsew
|
||||||
grid .graphdialog.center.left.xscroll - -sticky nsew
|
grid .graphdialog.center.left.xscroll - -sticky nsew
|
||||||
|
|
@ -2012,7 +2013,9 @@ proc graph_edit_properties {n} {
|
||||||
grid columnconfig .graphdialog.center.left 1 -weight 1
|
grid columnconfig .graphdialog.center.left 1 -weight 1
|
||||||
|
|
||||||
# center right frame
|
# center right frame
|
||||||
label .graphdialog.center.right.lab1 -text {Signals in graph}
|
label .graphdialog.center.right.lab1 -text { Signals in graph }
|
||||||
|
label .graphdialog.center.right.rawlab -text { Raw file: }
|
||||||
|
entry .graphdialog.center.right.rawentry -textvariable rawfile -width 30 -state disabled
|
||||||
text .graphdialog.center.right.text1 -wrap none -width 50 -height 5 -bg grey70 -fg black \
|
text .graphdialog.center.right.text1 -wrap none -width 50 -height 5 -bg grey70 -fg black \
|
||||||
-insertbackground grey40 -exportselection 1 \
|
-insertbackground grey40 -exportselection 1 \
|
||||||
-yscrollcommand {.graphdialog.center.right.yscroll set} \
|
-yscrollcommand {.graphdialog.center.right.yscroll set} \
|
||||||
|
|
@ -2020,13 +2023,18 @@ proc graph_edit_properties {n} {
|
||||||
scrollbar .graphdialog.center.right.yscroll -command {.graphdialog.center.right.text1 yview}
|
scrollbar .graphdialog.center.right.yscroll -command {.graphdialog.center.right.text1 yview}
|
||||||
scrollbar .graphdialog.center.right.xscroll -orient horiz -command {.graphdialog.center.right.text1 xview}
|
scrollbar .graphdialog.center.right.xscroll -orient horiz -command {.graphdialog.center.right.text1 xview}
|
||||||
|
|
||||||
grid .graphdialog.center.right.lab1
|
grid .graphdialog.center.right.lab1 .graphdialog.center.right.rawlab \
|
||||||
grid .graphdialog.center.right.text1 - .graphdialog.center.right.yscroll -sticky nsew
|
.graphdialog.center.right.rawentry -
|
||||||
grid .graphdialog.center.right.xscroll - -sticky nsew
|
grid configure .graphdialog.center.right.rawentry -sticky ew
|
||||||
|
grid .graphdialog.center.right.text1 - - .graphdialog.center.right.yscroll -sticky nsew
|
||||||
|
grid .graphdialog.center.right.xscroll - - - -sticky ew
|
||||||
grid rowconfig .graphdialog.center.right 0 -weight 0
|
grid rowconfig .graphdialog.center.right 0 -weight 0
|
||||||
grid rowconfig .graphdialog.center.right 1 -weight 1 -minsize 3c
|
grid rowconfig .graphdialog.center.right 1 -weight 1 -minsize 3c
|
||||||
grid columnconfig .graphdialog.center.right 0 -weight 1
|
grid rowconfig .graphdialog.center.right 2 -weight 0
|
||||||
grid columnconfig .graphdialog.center.right 1 -weight 1
|
grid columnconfig .graphdialog.center.right 0 -weight 0
|
||||||
|
grid columnconfig .graphdialog.center.right 1 -weight 0
|
||||||
|
grid columnconfig .graphdialog.center.right 2 -weight 1
|
||||||
|
grid columnconfig .graphdialog.center.right 3 -weight 0
|
||||||
|
|
||||||
# bottom frame
|
# bottom frame
|
||||||
button .graphdialog.bottom.cancel -text Cancel -command {
|
button .graphdialog.bottom.cancel -text Cancel -command {
|
||||||
|
|
@ -2168,7 +2176,8 @@ proc graph_edit_properties {n} {
|
||||||
.graphdialog.top2.labsubdivx .graphdialog.top2.subdivx \
|
.graphdialog.top2.labsubdivx .graphdialog.top2.subdivx \
|
||||||
.graphdialog.top2.labsubdivy .graphdialog.top2.subdivy \
|
.graphdialog.top2.labsubdivy .graphdialog.top2.subdivy \
|
||||||
.graphdialog.top2.labdset .graphdialog.top2.dset \
|
.graphdialog.top2.labdset .graphdialog.top2.dset \
|
||||||
.graphdialog.top2.labsweep .graphdialog.top2.sweep -side left
|
.graphdialog.top2.labsweep -side left
|
||||||
|
pack .graphdialog.top2.sweep -side left -fill x -expand yes
|
||||||
|
|
||||||
# top frame
|
# top frame
|
||||||
label .graphdialog.top.labsearch -text Search:
|
label .graphdialog.top.labsearch -text Search:
|
||||||
|
|
@ -2258,7 +2267,8 @@ proc graph_edit_properties {n} {
|
||||||
.graphdialog.top.search delete 0 end
|
.graphdialog.top.search delete 0 end
|
||||||
graph_fill_listbox
|
graph_fill_listbox
|
||||||
}
|
}
|
||||||
pack .graphdialog.top.labsearch .graphdialog.top.search -side left
|
pack .graphdialog.top.labsearch -side left
|
||||||
|
pack .graphdialog.top.search -side left -expand yes -fill x
|
||||||
pack .graphdialog.top.clear -side left
|
pack .graphdialog.top.clear -side left
|
||||||
pack .graphdialog.top.incr -side left
|
pack .graphdialog.top.incr -side left
|
||||||
pack .graphdialog.top.bus -side left
|
pack .graphdialog.top.bus -side left
|
||||||
|
|
@ -2320,10 +2330,11 @@ proc graph_edit_properties {n} {
|
||||||
xschem draw_graph $graph_selected
|
xschem draw_graph $graph_selected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pack .graphdialog.top3.logx .graphdialog.top3.logy -side left
|
pack .graphdialog.top3.logx .graphdialog.top3.logy \
|
||||||
pack .graphdialog.top3.xlabmin .graphdialog.top3.xmin .graphdialog.top3.xlabmax .graphdialog.top3.xmax -side left
|
.graphdialog.top3.xlabmin .graphdialog.top3.xmin .graphdialog.top3.xlabmax .graphdialog.top3.xmax \
|
||||||
pack .graphdialog.top3.ylabmin .graphdialog.top3.ymin .graphdialog.top3.ylabmax .graphdialog.top3.ymax -side left
|
.graphdialog.top3.ylabmin .graphdialog.top3.ymin .graphdialog.top3.ylabmax .graphdialog.top3.ymax \
|
||||||
pack .graphdialog.top3.xlabmag .graphdialog.top3.xmag .graphdialog.top3.ylabmag .graphdialog.top3.ymag -side left
|
.graphdialog.top3.xlabmag .graphdialog.top3.xmag .graphdialog.top3.ylabmag .graphdialog.top3.ymag \
|
||||||
|
-fill x -expand yes -side left
|
||||||
# binding
|
# binding
|
||||||
bind .graphdialog.top.search <KeyRelease> {
|
bind .graphdialog.top.search <KeyRelease> {
|
||||||
graph_fill_listbox
|
graph_fill_listbox
|
||||||
|
|
@ -3775,8 +3786,9 @@ proc tclpropeval {s instname symname} {
|
||||||
|
|
||||||
# this hook is called in translate() if whole string is contained in a tcleval(...) construct
|
# this hook is called in translate() if whole string is contained in a tcleval(...) construct
|
||||||
proc tclpropeval2 {s} {
|
proc tclpropeval2 {s} {
|
||||||
global debug_var env path raw_level
|
global debug_var env path
|
||||||
|
|
||||||
|
set raw_level [xschem get raw_level]
|
||||||
set netlist_type [xschem get netlist_type]
|
set netlist_type [xschem get netlist_type]
|
||||||
# puts "tclpropeval2: s=|$s|"
|
# puts "tclpropeval2: s=|$s|"
|
||||||
if {$debug_var <=-1} {puts "tclpropeval2: $s"}
|
if {$debug_var <=-1} {puts "tclpropeval2: $s"}
|
||||||
|
|
@ -5601,7 +5613,7 @@ set tctx::global_list {
|
||||||
lvs_netlist measure_text netlist_dir netlist_show netlist_type no_ask_save
|
lvs_netlist measure_text netlist_dir netlist_show netlist_type no_ask_save
|
||||||
no_change_attrs nolist_libs noprint_libs old_selected_tok only_probes path pathlist
|
no_change_attrs nolist_libs noprint_libs old_selected_tok only_probes path pathlist
|
||||||
persistent_command preserve_unchanged_attrs prev_symbol ps_colors ps_paper_size rainbow_colors
|
persistent_command preserve_unchanged_attrs prev_symbol ps_colors ps_paper_size rainbow_colors
|
||||||
raw_level rawfile_loaded rcode recentfile
|
rawfile_loaded rcode recentfile
|
||||||
retval retval_orig rotated_text search_case search_exact search_found search_schematic
|
retval retval_orig rotated_text search_case search_exact search_found search_schematic
|
||||||
search_select search_value selected_tok show_hidden_texts show_infowindow
|
search_select search_value selected_tok show_hidden_texts show_infowindow
|
||||||
show_infowindow_after_netlist show_pin_net_names
|
show_infowindow_after_netlist show_pin_net_names
|
||||||
|
|
@ -6840,7 +6852,6 @@ set_ne graph_rainbow 0
|
||||||
set_ne graph_selected {}
|
set_ne graph_selected {}
|
||||||
set_ne graph_schname {}
|
set_ne graph_schname {}
|
||||||
set_ne graph_change_done 0 ;# used to push undo only once when editing graphs
|
set_ne graph_change_done 0 ;# used to push undo only once when editing graphs
|
||||||
set_ne raw_level -1 ;# hierarchy level where raw file has been loaded
|
|
||||||
set_ne graph_linewidth_mult 1.4 ;# default multiplier (w.r.t. xschem lines) for line width in graphs
|
set_ne graph_linewidth_mult 1.4 ;# default multiplier (w.r.t. xschem lines) for line width in graphs
|
||||||
# user clicked this wave
|
# user clicked this wave
|
||||||
set_ne graph_sel_wave {}
|
set_ne graph_sel_wave {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue