diff --git a/src/actions.c b/src/actions.c index df1fbfd8..e031114b 100644 --- a/src/actions.c +++ b/src/actions.c @@ -273,14 +273,13 @@ void new_window(const char* cell, int symbol) fprintf(errfp, "new_window(): executable not found\n"); return; } - fprintf(errfp, "new_window(): fork error 1\n"); - tcleval("exit"); + fprintf(errfp, "new_window(): feature doesn't exist\n"); } #endif const char *get_file_path(char *f) { char tmp[2*PATH_MAX+100]; - my_snprintf(tmp, S(tmp),"get_file_path \"%s\"", f); + my_snprintf(tmp, S(tmp),"get_file_path {%s}", f); tcleval(tmp); return tclresult(); } diff --git a/src/callback.c b/src/callback.c index 2a330059..ed3b83f3 100644 --- a/src/callback.c +++ b/src/callback.c @@ -982,7 +982,6 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key, { if(xctx->semaphore >= 2) break; - tcleval("catch { ngspice::resetdata }"); ask_new_file(); break; } diff --git a/src/ngspice_backannotate.tcl b/src/ngspice_backannotate.tcl index 7f2a0de2..c15668f7 100644 --- a/src/ngspice_backannotate.tcl +++ b/src/ngspice_backannotate.tcl @@ -28,8 +28,8 @@ namespace eval ngspice { proc ngspice::read_ngspice_raw {arr fp} { upvar $arr var - unset -nocomplain var + unset -nocomplain var set variables 0 while {[gets $fp line] >= 0} { if {$line eq "Binary:"} break @@ -173,6 +173,8 @@ proc ngspice::annotate {} { set fp [open $rawfile r] fconfigure $fp -translation binary set op_point_read 0 + ## not needed: done in ngspice::read_ngspice_raw + # array unset ::ngspice::ngspice_data while 1 { ngspice::read_ngspice_raw arr $fp if { [info exists arr(n\ points)] } { diff --git a/src/scheduler.c b/src/scheduler.c index d6dbbae0..2d2b8997 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1423,7 +1423,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg else if(!strcmp(argv[1],"load") ) { cmd_found = 1; - tcleval("catch { ngspice::resetdata }"); if(argc==3) { if(!has_x || !xctx->modified || !save(1) ) { /* save(1)==1 --> user cancel */ dbg(1, "scheduler(): load: filename=%s\n", argv[2]); @@ -1448,7 +1447,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg char fullname[PATH_MAX]; cmd_found = 1; - tcleval("catch { ngspice::resetdata }"); if(argc>=3) { my_snprintf(fullname, S(fullname),"%s", argv[2]); } else { diff --git a/src/xinit.c b/src/xinit.c index 5816f37e..7b718882 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -591,14 +591,17 @@ void delete_schematic_data(void) /* clear static data in get_tok_value() must be done after unselect_all() * as this functions re-uses get_tok_value() */ get_tok_value(NULL, NULL, 0); /* clear static data in function */ - delete_netlist_structs(); /* netlist - specific data and hash tables */ + /* delete inst and wire node fields, delete inst_pin spatial hash, and node hash table */ + delete_netlist_structs(); clear_all_hilights(); /* data structs for hilighting nets/instances */ get_unnamed_node(0, 0, 0); /* net### enumerator used for netlisting */ if(has_x) { resetwin(0, 1, 1, 0, 0); /* delete preview pixmap, delete cairo surfaces */ free_gc(); } - clear_drawing(); /* delete instances, wires, lines, rects, ... */ + /* delete instances, wires, lines, rects, arcs, polys, texts, hash_inst, hash_wire, + * inst & wire .node fields, instance name hash */ + clear_drawing(); remove_symbols(); free_xschem_data(); /* delete the xctx struct */ } @@ -611,6 +614,7 @@ void xwin_exit(void) dbg(0, "xwin_exit() double call, doing nothing...\n"); return; } + tcleval("catch { ngspice::resetdata }"); /* remove ngspice annotation data if any */ delete_schematic_data(); if(has_x) { Tk_DestroyWindow(mainwindow); diff --git a/src/xschem.tcl b/src/xschem.tcl index 3ae2814f..d6c2aec0 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -3922,17 +3922,17 @@ proc build_widgets { {topwin {} } } { xschem new_symbol_window } $topwin.menubar.file.menu add command -label "Open" -command "xschem load" -accelerator {Ctrl+O} - $topwin.menubar.file.menu add command -label {Open new window [exp]} -command "xschem load_new_window" - toolbar_create FileOpen "xschem load" "Open File" $topwin - $topwin.menubar.file.menu add command -label "Delete files" -command "xschem delete_files" -accelerator {Shift-D} - + $topwin.menubar.file.menu add cascade -label "Open Recent" -menu $topwin.menubar.file.menu.recent + $topwin.menubar.file.menu add cascade -label {Open Recent in new window [exp]} \ + -menu $topwin.menubar.file.menu.recent_new_window menu $topwin.menubar.file.menu.recent_new_window -tearoff 0 menu $topwin.menubar.file.menu.recent -tearoff 0 setup_recent_menu 0 $topwin setup_recent_menu 1 $topwin - $topwin.menubar.file.menu add cascade -label "Open Recent" -menu $topwin.menubar.file.menu.recent - $topwin.menubar.file.menu add cascade -label {Open Recent in new window [exp]} \ - -menu $topwin.menubar.file.menu.recent_new_window + $topwin.menubar.file.menu add command -label {Open new window [exp]} -command "xschem load_new_window" + toolbar_create FileOpen "xschem load" "Open File" $topwin + $topwin.menubar.file.menu add command -label "Delete files" -command "xschem delete_files" -accelerator {Shift-D} + $topwin.menubar.file.menu add command -label "Open Most Recent" \ -command {xschem load [lindex "$recentfile" 0]} -accelerator {Ctrl+Shift+O} $topwin.menubar.file.menu add command -label "Save" -command "xschem save" -accelerator {Ctrl+S}