diff --git a/XSchemWin/XSchemWin.vcxproj b/XSchemWin/XSchemWin.vcxproj index 5d533fbd..c8afb048 100644 --- a/XSchemWin/XSchemWin.vcxproj +++ b/XSchemWin/XSchemWin.vcxproj @@ -145,6 +145,7 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true + ../src Console @@ -192,6 +193,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true + ../src Console @@ -209,6 +211,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS true + ../src Console diff --git a/XSchemWin/XSchemWix/heat_doc.wxs b/XSchemWin/XSchemWix/heat_doc.wxs index 034b933f..b2d2d217 100644 --- a/XSchemWin/XSchemWix/heat_doc.wxs +++ b/XSchemWin/XSchemWix/heat_doc.wxs @@ -3,805 +3,805 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/XSchemWin/XSchemWix/heat_xschem_library.wxs b/XSchemWin/XSchemWix/heat_xschem_library.wxs index 26da71f3..1ea2219b 100644 --- a/XSchemWin/XSchemWix/heat_xschem_library.wxs +++ b/XSchemWin/XSchemWix/heat_xschem_library.wxs @@ -3,5219 +3,5228 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -5292,6 +5301,7 @@ + @@ -6802,6 +6812,8 @@ + + diff --git a/XSchemWin/XSchemWix/xschem_library.wxs b/XSchemWin/XSchemWix/xschem_library.wxs index 733c37e1..0346db94 100644 --- a/XSchemWin/XSchemWix/xschem_library.wxs +++ b/XSchemWin/XSchemWix/xschem_library.wxs @@ -210,6 +210,9 @@ + + + @@ -4748,6 +4751,12 @@ + + + + + + @@ -5292,6 +5301,7 @@ + @@ -6802,6 +6812,8 @@ + + diff --git a/doc/xschem_man/commands.html b/doc/xschem_man/commands.html index ae92c96b..cabe7803 100644 --- a/doc/xschem_man/commands.html +++ b/doc/xschem_man/commands.html @@ -162,8 +162,8 @@ alt 'l' add lab_pin.sym to schematic ctrl+shift 'o' Load most recent schematic ctrl 'o' Load schematic - 'm' Move selected obj. -shift 'N' Hierarchical netlist -- 'n' Netlist +shift 'N' Top level only netlist +- 'n' Hierarchical Netlist ctrl 'n' New schematic ctrl+shift 'N' New symbol alt 'n' Empty schematic in new window diff --git a/src/globals.c b/src/globals.c index ec9f3904..8ff0f7e3 100644 --- a/src/globals.c +++ b/src/globals.c @@ -120,7 +120,6 @@ xcb_visualtype_t *visual_xcb; int cadlayers=0; int has_x=1; int rainbow_colors = 0; -char *netlist_dir = NULL; int color_ps=-1; double nocairo_vert_correct=0.0; /* lift up the text by 'n' pixels (zoom corrected) within the bbox. */ @@ -179,6 +178,7 @@ char old_winpath[PATH_MAX] = ".drw"; int cli_opt_netlist_type = 0; int cli_opt_flat_netlist = 0; char cli_opt_plotfile[PATH_MAX] = ""; +char cli_opt_netlist_dir[PATH_MAX] = ""; /* --------------------------------------------------- */ diff --git a/src/hilight.c b/src/hilight.c index 14b349db..cb93887c 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -263,7 +263,7 @@ void create_plot_cmd(void) my_free(1270, &viewer_name); } if(!exists || !viewer) return; - my_snprintf(plotfile, S(plotfile), "%s/xplot", netlist_dir); + my_snprintf(plotfile, S(plotfile), "%s/xplot", tclgetvar("netlist_dir")); if(viewer == NGSPICE) { if(!(fd = fopen(plotfile, "w"))) { fprintf(errfp, "create_plot_cmd(): error opening xplot file for writing\n"); diff --git a/src/keys.help b/src/keys.help index 39e4b647..7647107a 100644 --- a/src/keys.help +++ b/src/keys.help @@ -122,8 +122,8 @@ alt 'l' add lab_pin.sym to schematic ctrl+shift 'o' Load most recent schematic ctrl 'o' Load schematic - 'm' Move selected obj. -shift 'N' Hierarchical netlist -- 'n' Netlist +shift 'N' Top level only netlist +- 'n' Hierarchical Netlist ctrl 'n' New schematic ctrl+shift 'N' New symbol alt 'n' Empty schematic in new window diff --git a/src/options.c b/src/options.c index 2055c80a..d8a5ca7a 100644 --- a/src/options.c +++ b/src/options.c @@ -102,7 +102,7 @@ void check_opt(char *opt, char *optval, int type) } } } else if( (type == SHORT && *opt == 'o') || (type == LONG && !strcmp("netlist_path", opt)) ) { - if(optval) my_strdup(48, &netlist_dir, optval); + if(optval) my_strncpy(cli_opt_netlist_dir, optval, S(cli_opt_netlist_dir)); } else if( (type == SHORT && *opt == 'N') || (type == LONG && !strcmp("netlist_filename", opt)) ) { dbg(1, "process_options(): set netlist name to %s\n", optval); diff --git a/src/scheduler.c b/src/scheduler.c index 0f474fa5..0636ec51 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -271,12 +271,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Tcl_ResetResult(interp); } - else if(!strcmp(argv[1],"clear_netlist_dir") ) - { - cmd_found = 1; - my_strdup(373, &netlist_dir, ""); - } - else if(!strcmp(argv[1], "color_dim")) { cmd_found = 1; @@ -612,9 +606,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg my_snprintf(s, S(s), "%g", xctx->lw); Tcl_SetResult(interp, s, TCL_VOLATILE); } - else if(!strcmp(argv[2],"netlist_dir")) { - Tcl_SetResult(interp, netlist_dir,TCL_VOLATILE); - } else if(!strcmp(argv[2],"netlist_name")) { Tcl_SetResult(interp, xctx->netlist_name, TCL_VOLATILE); } @@ -708,6 +699,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg my_snprintf(s, S(s), "%d",TEXTLAYER); Tcl_SetResult(interp, s,TCL_VOLATILE); } + else if(!strcmp(argv[2],"topwindow")) { + char *top_path; + top_path = xctx->top_path[0] ? xctx->top_path : "."; + Tcl_SetResult(interp, top_path,TCL_VOLATILE); + } else if(!strcmp(argv[2],"version")) { char s[30]; /* overflow safe 20161122 */ my_snprintf(s, S(s), "XSCHEM V%s",XSCHEM_VERSION); @@ -850,7 +846,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg { cmd_found = 1; printf("*******global variables:*******\n"); - printf("netlist_dir=%s\n", netlist_dir? netlist_dir: ""); printf("INT_WIDTH(lw)=%d\n", INT_WIDTH(xctx->lw)); printf("wires=%d\n", xctx->wires); printf("instances=%d\n", xctx->instances); @@ -2252,13 +2247,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Tcl_ResetResult(interp); } - else if(!strcmp(argv[1],"set_netlist_dir") && argc==3) - { - cmd_found = 1; - dbg(1, "scheduler(): xschem set_netlist_dir: argv[2] = %s\n", argv[2]); - my_strdup(0, &netlist_dir, argv[2]); - } - else if(!strcmp(argv[1], "setprop")) { /* 0 1 2 3 4 5 diff --git a/src/spice_netlist.c b/src/spice_netlist.c index 97818118..8d3a9f51 100644 --- a/src/spice_netlist.c +++ b/src/spice_netlist.c @@ -127,7 +127,7 @@ void global_spice_netlist(int global) /* netlister driver */ } xctx->netlist_count=0; my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", - netlist_dir, skip_dir(xctx->sch[xctx->currsch]), getpid()); + tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]), getpid()); dbg(1, "global_spice_netlist(): opening %s for writing\n",netl_filename); fd=fopen(netl_filename, "w"); @@ -430,7 +430,8 @@ void spice_block_netlist(FILE *fd, int i) my_strncpy(filename, add_ext(abs_sym_path(xctx->sym[i].name, ""), ".sch"), S(filename)); } if(split_f) { - my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", netlist_dir, skip_dir(xctx->sym[i].name), getpid()); + my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", + tclgetvar("netlist_dir"), skip_dir(xctx->sym[i].name), getpid()); dbg(1, "spice_block_netlist(): split_files: netl_filename=%s\n", netl_filename); fd=fopen(netl_filename, "w"); my_snprintf(cellname, S(cellname), "%s.spice", skip_dir(xctx->sym[i].name)); diff --git a/src/tedax_netlist.c b/src/tedax_netlist.c index 5a97a966..dc46f47b 100644 --- a/src/tedax_netlist.c +++ b/src/tedax_netlist.c @@ -45,7 +45,7 @@ void global_tedax_netlist(int global) /* netlister driver */ } xctx->netlist_count=0; my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", - netlist_dir, skip_dir(xctx->sch[xctx->currsch]), getpid()); + tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]), getpid()); fd=fopen(netl_filename, "w"); if(xctx->netlist_name[0]) { diff --git a/src/verilog_netlist.c b/src/verilog_netlist.c index 8cb7cbe3..ef0c11e9 100644 --- a/src/verilog_netlist.c +++ b/src/verilog_netlist.c @@ -51,7 +51,7 @@ void global_verilog_netlist(int global) /* netlister driver */ /* to be printed before any entity declarations */ my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", - netlist_dir, skip_dir(xctx->sch[xctx->currsch]),getpid()); + tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]),getpid()); fd=fopen(netl_filename, "w"); if(xctx->netlist_name[0]) { @@ -385,7 +385,7 @@ void verilog_block_netlist(FILE *fd, int i) } if(split_f) { my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", - netlist_dir, skip_dir(xctx->sym[i].name), getpid()); + tclgetvar("netlist_dir"), skip_dir(xctx->sym[i].name), getpid()); dbg(1, "global_vhdl_netlist(): split_files: netl_filename=%s\n", netl_filename); fd=fopen(netl_filename, "w"); my_snprintf(cellname, S(cellname), "%s.v", skip_dir(xctx->sym[i].name) ); diff --git a/src/vhdl_netlist.c b/src/vhdl_netlist.c index 000486fb..578a0aca 100644 --- a/src/vhdl_netlist.c +++ b/src/vhdl_netlist.c @@ -52,7 +52,7 @@ void global_vhdl_netlist(int global) /* netlister driver */ xctx->netlist_count=0; str_hash_free(subckt_table); my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", - netlist_dir, skip_dir(xctx->sch[xctx->currsch]), getpid()); + tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]), getpid()); fd=fopen(netl_filename, "w"); @@ -441,7 +441,8 @@ void vhdl_block_netlist(FILE *fd, int i) my_strncpy(filename, add_ext(abs_sym_path(xctx->sym[i].name, ""), ".sch"), S(filename)); } if(split_f) { - my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", netlist_dir, skip_dir(xctx->sym[i].name), getpid()); + my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", + tclgetvar("netlist_dir"), skip_dir(xctx->sym[i].name), getpid()); dbg(1, "vhdl_block_netlist(): split_files: netl_filename=%s\n", netl_filename); fd=fopen(netl_filename, "w"); my_snprintf(cellname, S(cellname), "%s.vhdl", skip_dir(xctx->sym[i].name) ); diff --git a/src/xinit.c b/src/xinit.c index 31915879..1131bdaa 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -652,7 +652,6 @@ void xwin_exit(void) for(i=0;i<127;i++) my_free(1140, &character[i]); dbg(1, "xwin_exit(): closed display\n"); my_free(1141, &filename); - my_free(1142, &netlist_dir); my_free(1143, &xschem_executable); record_global_node(2, NULL, NULL); /* delete global node array */ dbg(1, "xwin_exit(): deleted undo buffer\n"); @@ -1702,10 +1701,12 @@ int Tcl_AppInit(Tcl_Interp *inter) /* */ /* set tcl netlist_dir if netlist_dir given on cmdline */ - if(netlist_dir && netlist_dir[0]) tclsetvar("netlist_dir", netlist_dir); + if(cli_opt_netlist_dir[0]) tclsetvar("netlist_dir", cli_opt_netlist_dir); if(!set_netlist_dir(0, NULL)) { - fprintf(errfp, "problems creating netlist directory %s\n", netlist_dir ? netlist_dir : ""); + const char *n; + n = tclgetvar("netlist_dir"); + fprintf(errfp, "problems creating netlist directory %s\n", n ? n : ""); } if(initial_netlist_name[0]) my_strncpy(xctx->netlist_name, initial_netlist_name, S(initial_netlist_name)); @@ -1762,7 +1763,7 @@ int Tcl_AppInit(Tcl_Interp *inter) fprintf(errfp, "xschem: cant do a netlist without a filename\n"); tcleval("exit"); } - if(netlist_dir && netlist_dir[0]) { + if(tclgetvar("netlist_dir")[0]) { if(xctx->netlist_type == CAD_SPICE_NETLIST) global_spice_netlist(1); /* 1 means global netlist */ else if(xctx->netlist_type == CAD_VHDL_NETLIST) diff --git a/src/xschem.h b/src/xschem.h index acaf679c..00d7c98e 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -822,7 +822,6 @@ extern xcb_visualtype_t *visual_xcb; extern int cadlayers; extern int has_x; extern int rainbow_colors; -extern char *netlist_dir; extern int color_ps; extern double nocairo_vert_correct; extern double cairo_vert_correct; @@ -867,6 +866,7 @@ extern char old_winpath[PATH_MAX]; /* previous focused schematic window (used to extern int cli_opt_netlist_type; extern int cli_opt_flat_netlist; extern char cli_opt_plotfile[PATH_MAX]; +extern char cli_opt_netlist_dir[PATH_MAX]; /*********** Following data is relative to the current schematic ***********/ extern Xschem_ctx *xctx; diff --git a/src/xschem.tcl b/src/xschem.tcl index e902d7ab..9a9d0abc 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -353,7 +353,8 @@ proc load_recent_file {} { if {[catch { source $USER_CONF_DIR/recent_files } err] } { puts "Problems opening recent_files: $err" if {[info exists has_x]} { - tk_messageBox -message "Problems opening recent_files: $err" -icon warning -parent . -type ok + tk_messageBox -message "Problems opening recent_files: $err" \ + -icon warning -parent [xschem get topwindow] -type ok } } } @@ -449,7 +450,8 @@ proc set_sim_defaults {} { if { [catch {source ${USER_CONF_DIR}/simrc} err]} { puts "Problems opening simrc file: $err" if {[info exists has_x]} { - tk_messageBox -message "Problems opening simrc file: $err" -icon warning -parent . -type ok + tk_messageBox -message "Problems opening simrc file: $err" -icon warning \ + -parent [xschem get topwindow] -type ok } set failure 1 } @@ -1519,7 +1521,7 @@ proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}} {init if {[file exists "$myload_dir1/$myload_retval"]} { if {$confirm_overwrt == 1 } { set answer [tk_messageBox -message "Overwrite $myload_dir1/${myload_retval}?" \ - -icon warning -parent . -type okcancel] + -icon warning -parent [xschem get topwindow] -type okcancel] } else { set answer ok } @@ -1534,7 +1536,7 @@ proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}} {init if { $myload_type eq {0} } { set answer [ tk_messageBox -message "$myload_dir1/$myload_retval does not seem to be an xschem file...\nContinue?" \ - -icon warning -parent . -type yesno] + -icon warning -parent [xschem get topwindow] -type yesno] if { $answer eq "no"} { set myload_retval {} return {} @@ -1544,7 +1546,7 @@ proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}} {init } elseif { $myload_type ne {SYMBOL} && ($ext eq {.sym}) } { set answer [ tk_messageBox -message "$myload_dir1/$myload_retval does not seem to be a SYMBOL file...\nContinue?" \ - -icon warning -parent . -type yesno] + -icon warning -parent [xschem get topwindow] -type yesno] if { $answer eq "no"} { set myload_retval {} return {} @@ -1799,7 +1801,6 @@ proc simuldir {} { set simdir [xschem get current_dirname]/simulation file mkdir $simdir set netlist_dir $simdir - xschem set_netlist_dir $netlist_dir return $netlist_dir } return {} @@ -1821,7 +1822,6 @@ proc select_netlist_dir { force {dir {} }} { file mkdir $netlist_dir } regsub {^~/} $netlist_dir ${env(HOME)}/ netlist_dir - xschem set_netlist_dir $netlist_dir return $netlist_dir } if { $dir eq {} } { @@ -1835,7 +1835,8 @@ proc select_netlist_dir { force {dir {} }} { } } # 20140409 do not change netlist_dir if user Cancels action - set new_dir [tk_chooseDirectory -initialdir $initdir -parent . -title {Select netlist DIR} -mustexist false] + set new_dir [tk_chooseDirectory -initialdir $initdir \ + -parent [xschem get topwindow] -title {Select netlist DIR} -mustexist false] } else { set new_dir $dir } @@ -1847,7 +1848,6 @@ proc select_netlist_dir { force {dir {} }} { set netlist_dir $new_dir } regsub {^~/} $netlist_dir ${env(HOME)}/ netlist_dir - xschem set_netlist_dir $netlist_dir return $netlist_dir } diff --git a/tests/cleanup_debug_file.awk b/tests/cleanup_debug_file.awk index 158f4909..01f1291d 100644 --- a/tests/cleanup_debug_file.awk +++ b/tests/cleanup_debug_file.awk @@ -51,6 +51,8 @@ function replace_pattern(old, new) replace_pattern("zoom_full[:(:][:):]:.*$", "zoom_full(): ***Removed***") replace_pattern("bbox[:(:][:):]: bbox=.*$", "bbox(): bbox=***Removed***") replace_pattern("draw_string()[:(:][:):]:.*$", "draw_string(): ***Removed***") + replace_pattern("find_best_color.*$", "find_best_color ***Removed***") + replace_pattern("trim_wires.*$", "trim_wires ***Removed***") __a[__lines++] = $0 }