[Code Refactoring]: Modified the source code for compatibility with the upstream repo (due to 'infix_wire' feature integration with new name 'infix_interface')
This commit is contained in:
commit
3480d9767d
|
|
@ -779,6 +779,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
<li><kbd> lastsel </kbd> number of selected objects </li>
|
||||
<li><kbd> line_width </kbd> get line width </li>
|
||||
<li><kbd> lines </kbd> (xschem get lines n) number of lines on layer 'n' </li>
|
||||
<li><kbd> modified </kbd> schematic is in modified state (needs a save) </li>
|
||||
<li><kbd> netlist_name </kbd> netlist name if set. If 'fallback' given get default name </li>
|
||||
<li><kbd> netlist_type </kbd> get current netlist type (spice/vhdl/verilog/tedax) </li>
|
||||
<li><kbd> no_draw </kbd> disable drawing </li>
|
||||
|
|
@ -875,9 +876,11 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
if returned value is 0 it means that last searched attribute did not exist </pre>
|
||||
<li><kbd> globals</kbd></li><pre>
|
||||
Return various global variables used in the program </pre>
|
||||
<li><kbd> go_back [notitle]</kbd></li><pre>
|
||||
<li><kbd> go_back [what]</kbd></li><pre>
|
||||
Go up one level (pop) in hierarchy
|
||||
if integer 'notitle' given pass it to the go_back() function (1=do not update window title) </pre>
|
||||
if integer 'what' given pass it to the go_back() function
|
||||
what = 1: ask confirm save if current schematic modified.
|
||||
what = 2: do not reset window title </pre>
|
||||
<li><kbd> grabscreen</kbd></li><pre>
|
||||
grab root window </pre>
|
||||
<li><kbd> hash_file file [skip_path_lines]</kbd></li><pre>
|
||||
|
|
|
|||
|
|
@ -2409,13 +2409,20 @@ int descend_schematic(int instnumber, int fallback, int alert, int set_title)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void go_back(int confirm, int set_title) /* 20171006 add confirm */
|
||||
/*
|
||||
* what:
|
||||
* 1: ask gui user confirm if schematic modified
|
||||
* 2: do *NOT* reset window title
|
||||
*/
|
||||
void go_back(int what)
|
||||
{
|
||||
int save_ok;
|
||||
int from_embedded_sym;
|
||||
int save_modified;
|
||||
char filename[PATH_MAX];
|
||||
int prev_sch_type;
|
||||
int confirm = what & 1;
|
||||
int set_title = !(confirm & 2);
|
||||
|
||||
save_ok=1;
|
||||
dbg(1,"go_back(): sch[xctx->currsch]=%s\n", xctx->sch[xctx->currsch]);
|
||||
|
|
@ -2429,9 +2436,13 @@ void go_back(int confirm, int set_title) /* 20171006 add confirm */
|
|||
tcleval("ask_save_optional");
|
||||
if(!strcmp(tclresult(), "yes") ) save_ok = save_schematic(xctx->sch[xctx->currsch], 0);
|
||||
else if(!strcmp(tclresult(), "") ) return;
|
||||
} else {
|
||||
save_ok = save_schematic(xctx->sch[xctx->currsch], 0);
|
||||
}
|
||||
/* do not automatically save if confirm==0. Script developers should take care of this */
|
||||
/*
|
||||
* else {
|
||||
* save_ok = save_schematic(xctx->sch[xctx->currsch], 0);
|
||||
* }
|
||||
*/
|
||||
}
|
||||
if(save_ok==0) {
|
||||
fprintf(errfp, "go_back(): file opening for write failed! %s \n", xctx->current_name);
|
||||
|
|
@ -2458,7 +2469,7 @@ void go_back(int confirm, int set_title) /* 20171006 add confirm */
|
|||
/* by default) to parent schematic if going back from embedded symbol */
|
||||
|
||||
my_strncpy(filename, xctx->sch[xctx->currsch], S(filename));
|
||||
load_schematic(1, filename, (set_title & 1), 1);
|
||||
load_schematic(1, filename, set_title, 1);
|
||||
/* if we are returning from a symbol created from a generator don't set modified flag on parent
|
||||
* as these symbols can not be edited / saved as embedded
|
||||
* xctx->sch_inst_number[xctx->currsch + 1] == -1 --> we came from an inst with no embed flag set */
|
||||
|
|
|
|||
|
|
@ -1903,7 +1903,7 @@ static void context_menu_action(double mx, double my)
|
|||
descend_symbol();
|
||||
break;
|
||||
case 14:
|
||||
go_back(1, 1);
|
||||
go_back(1);
|
||||
break;
|
||||
case 15: /* copy selection into clipboard */
|
||||
rebuild_selected_array();
|
||||
|
|
@ -2749,6 +2749,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
{
|
||||
int prev_state = xctx->ui_state;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
<<<<<<< HEAD
|
||||
|
||||
if(infix_interface) {
|
||||
start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||
|
|
@ -2756,6 +2757,15 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
tcleval("set constr_mv 0");
|
||||
xctx->constr_mv = 0;
|
||||
}
|
||||
=======
|
||||
|
||||
if(infix_interface) {
|
||||
start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||
if(prev_state == STARTWIRE) {
|
||||
tcleval("set constr_mv 0" );
|
||||
xctx->constr_mv=0;
|
||||
}
|
||||
>>>>>>> 025823f14c8ca1f9562a1c452fffe267c7120905
|
||||
} else {
|
||||
xctx->last_command = 0;
|
||||
xctx->ui_state |= MENUSTART;
|
||||
|
|
@ -2808,8 +2818,13 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
if(xctx->semaphore >= 2) break;
|
||||
dbg(1, "callback(): start polygon\n");
|
||||
if(infix_interface) {
|
||||
<<<<<<< HEAD
|
||||
xctx->mx_double_save = xctx->mousex_snap;
|
||||
xctx->my_double_save = xctx->mousey_snap;
|
||||
=======
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
xctx->my_double_save=xctx->mousey_snap;
|
||||
>>>>>>> 025823f14c8ca1f9562a1c452fffe267c7120905
|
||||
xctx->last_command = 0;
|
||||
new_polygon(PLACE, xctx->mousex_snap, xctx->mousey_snap);
|
||||
} else {
|
||||
|
|
@ -2964,12 +2979,20 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
if(key=='r' /* && !xctx->ui_state */ && rstate==0) /* start rect */
|
||||
{
|
||||
dbg(1, "callback(): start rect\n");
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
if(xctx->semaphore >= 2) break;
|
||||
>>>>>>> 025823f14c8ca1f9562a1c452fffe267c7120905
|
||||
if(infix_interface) {
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
xctx->my_double_save=xctx->mousey_snap;
|
||||
xctx->last_command = 0;
|
||||
new_rect(PLACE,xctx->mousex_snap, xctx->mousey_snap);
|
||||
<<<<<<< HEAD
|
||||
} else{
|
||||
=======
|
||||
} else {
|
||||
>>>>>>> 025823f14c8ca1f9562a1c452fffe267c7120905
|
||||
xctx->ui_state |= MENUSTART;
|
||||
xctx->ui_state2 = MENUSTARTRECT;
|
||||
}
|
||||
|
|
@ -3069,7 +3092,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
if( (key=='e' && rstate == ControlMask) || (key==XK_BackSpace)) /* back */
|
||||
{
|
||||
if(xctx->semaphore >= 2) break;
|
||||
go_back(1, 1);break;
|
||||
go_back(1);break;
|
||||
}
|
||||
|
||||
if(key=='a' && rstate == 0) /* make symbol */
|
||||
|
|
@ -3474,7 +3497,11 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
if(key=='l' /* && !xctx->ui_state */ && rstate == 0) /* start line */
|
||||
{
|
||||
int prev_state = xctx->ui_state;
|
||||
<<<<<<< HEAD
|
||||
if(xctx->semaphore>=2) break;
|
||||
=======
|
||||
if(xctx->semaphore >= 2) break;
|
||||
>>>>>>> 025823f14c8ca1f9562a1c452fffe267c7120905
|
||||
if(infix_interface) {
|
||||
start_line(xctx->mousex_snap, xctx->mousey_snap);
|
||||
if(prev_state == STARTLINE) {
|
||||
|
|
|
|||
|
|
@ -3827,7 +3827,8 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
|
|||
clear_cairo_surface(xctx->cairo_ctx, gr->sx1, gr->sy1, sw, sh);
|
||||
#endif
|
||||
autoload = !strboolcmp(get_tok_value(r->prop_ptr,"autoload", 0), "1");
|
||||
if(autoload == 0) autoload = 2; /* 2: switch */
|
||||
if(autoload == 0) autoload = 2; /* 2: switch */
|
||||
else if(autoload == 1) autoload = 33; /* 1: read, 32: no_warning */
|
||||
/* graph box, gridlines and axes */
|
||||
draw_graph_grid(gr, ct);
|
||||
/* get data to plot */
|
||||
|
|
|
|||
65
src/save.c
65
src/save.c
|
|
@ -590,7 +590,7 @@ static void read_raw_data_block(int binary, FILE *fd, Raw *raw, int ac)
|
|||
* 157 i(v1) current
|
||||
* Binary:
|
||||
*/
|
||||
static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
||||
static int read_dataset(FILE *fd, Raw **rawptr, const char *type, int no_warning)
|
||||
{
|
||||
int variables = 0, i, done_points = 0;
|
||||
char *line = NULL, *varname = NULL, *lowerline = NULL;
|
||||
|
|
@ -716,7 +716,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
|||
if(n < 1) {
|
||||
dbg(0, "read_dataset(): WAARNING: malformed raw file, aborting\n");
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(rawptr, 0); */
|
||||
/* free_rawfile(rawptr, 0, 0); */
|
||||
exit_status = 0;
|
||||
goto read_dataset_done;
|
||||
}
|
||||
|
|
@ -749,7 +749,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
|||
if(n < 1) {
|
||||
dbg(0, "read_dataset(): WAARNING: malformed raw file, aborting\n");
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(rawptr, 0); */
|
||||
/* free_rawfile(rawptr, 0, 0); */
|
||||
exit_status = 0;
|
||||
goto read_dataset_done;
|
||||
}
|
||||
|
|
@ -763,7 +763,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
|||
if(n < 1) {
|
||||
dbg(0, "read_dataset(): WAARNING: malformed raw file, aborting\n");
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(rawptr, 0); */
|
||||
/* free_rawfile(rawptr, 0, 0); */
|
||||
exit_status = 0;
|
||||
goto read_dataset_done;
|
||||
}
|
||||
|
|
@ -786,7 +786,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
|||
if(n < 2) {
|
||||
dbg(0, "read_dataset(): WAARNING: malformed raw file, aborting\n");
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(rawptr, 0); */
|
||||
/* free_rawfile(rawptr, 0, 0); */
|
||||
exit_status = 0;
|
||||
goto read_dataset_done;
|
||||
}
|
||||
|
|
@ -838,7 +838,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
|||
|
||||
/* no analysis was found: delete */
|
||||
if(exit_status != 1) {
|
||||
free_rawfile(rawptr, 0);
|
||||
free_rawfile(rawptr, 0, no_warning);
|
||||
}
|
||||
read_dataset_done:
|
||||
if(line) my_free(_ALLOC_ID_, &line);
|
||||
|
|
@ -851,18 +851,22 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
|||
return exit_status;
|
||||
}
|
||||
|
||||
void free_rawfile(Raw **rawptr, int dr)
|
||||
void free_rawfile(Raw **rawptr, int dr, int no_warning)
|
||||
{
|
||||
int i;
|
||||
|
||||
Raw *raw;
|
||||
if(!rawptr || !*rawptr) {
|
||||
dbg(0, "free_rawfile(): no raw file to clear\n");
|
||||
if(!no_warning) {
|
||||
dbg(0, "free_rawfile(): no raw file to clear\n");
|
||||
}
|
||||
if(dr) draw();
|
||||
return;
|
||||
}
|
||||
raw = *rawptr;
|
||||
dbg(0, "free_rawfile(): clearing data\n");
|
||||
if(!no_warning) {
|
||||
dbg(0, "free_rawfile(): clearing data\n");
|
||||
}
|
||||
if(raw->names) {
|
||||
for(i = 0 ; i < raw->nvars; ++i) {
|
||||
my_free(_ALLOC_ID_, &raw->names[i]);
|
||||
|
|
@ -954,7 +958,7 @@ int raw_read_from_attr(Raw **rawptr, const char *type, double sweep1, double swe
|
|||
fwrite(s, decoded_length, 1, fd);
|
||||
fclose(fd);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
res = raw_read(tmp_filename, rawptr, type, sweep1, sweep2);
|
||||
res = raw_read(tmp_filename, rawptr, type, 0, sweep1, sweep2);
|
||||
unlink(tmp_filename);
|
||||
} else {
|
||||
dbg(0, "raw_read_from_attr(): failed to open file %s for reading\n", tmp_filename);
|
||||
|
|
@ -995,7 +999,7 @@ int raw_add_vector(const char *varname, const char *expr, int sweep_idx)
|
|||
}
|
||||
|
||||
/* read a ngspice raw file (with data portion in binary format) */
|
||||
int raw_read(const char *f, Raw **rawptr, const char *type, double sweep1, double sweep2)
|
||||
int raw_read(const char *f, Raw **rawptr, const char *type, int no_warning, double sweep1, double sweep2)
|
||||
{
|
||||
int res = 0;
|
||||
FILE *fd;
|
||||
|
|
@ -1021,7 +1025,7 @@ int raw_read(const char *f, Raw **rawptr, const char *type, double sweep1, doubl
|
|||
int_hash_init(&raw->table, HASHSIZE);
|
||||
fd = fopen(f, fopen_read_mode);
|
||||
if(fd) {
|
||||
if((res = read_dataset(fd, rawptr, type)) == 1) {
|
||||
if((res = read_dataset(fd, rawptr, type, no_warning)) == 1) {
|
||||
int i;
|
||||
set_modify(-2); /* clear text floater caches */
|
||||
my_strdup2(_ALLOC_ID_, &raw->rawfile, f);
|
||||
|
|
@ -1035,8 +1039,10 @@ int raw_read(const char *f, Raw **rawptr, const char *type, double sweep1, doubl
|
|||
dbg(0, "points=%d, vars=%d, datasets=%d sim_type=%s\n",
|
||||
raw->allpoints, raw->nvars, raw->datasets, raw->sim_type ? raw->sim_type : "<NULL>");
|
||||
} else {
|
||||
/* free_rawfile(rawptr, 0); */ /* do not free: already done in read_dataset()->extra_rawfile() */
|
||||
dbg(0, "raw_read(): no useful data found\n");
|
||||
/* free_rawfile(rawptr, 0, 0); */ /* do not free: already done in read_dataset()->extra_rawfile() */
|
||||
if(!no_warning) {
|
||||
dbg(0, "raw_read(): no useful data found\n");
|
||||
}
|
||||
}
|
||||
fclose(fd);
|
||||
if(has_x) {
|
||||
|
|
@ -1050,7 +1056,9 @@ int raw_read(const char *f, Raw **rawptr, const char *type, double sweep1, doubl
|
|||
}
|
||||
return res;
|
||||
}
|
||||
dbg(0, "raw_read(): failed to open file %s for reading\n", f);
|
||||
if(!no_warning) {
|
||||
dbg(0, "raw_read(): failed to open file %s for reading\n", f);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1168,6 +1176,7 @@ int new_rawfile(const char *name, const char *type, const char *sweepvar,
|
|||
* what == 3: remove a raw file. If no filename given remove all
|
||||
* what == 4: print info
|
||||
* what == 5: switch back to previous
|
||||
* if bit 5 (32) of what is set do not issue warnings
|
||||
* return 1 if sucessfull, 0 otherwise
|
||||
*/
|
||||
int extra_rawfile(int what, const char *file, const char *type, double sweep1, double sweep2)
|
||||
|
|
@ -1175,11 +1184,13 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
|||
int i;
|
||||
int ret = 1;
|
||||
char f[PATH_MAX];
|
||||
int no_warning = what & 32;
|
||||
|
||||
what &= 0xf; /* remove warning bit */
|
||||
if(type && !type[0]) type = NULL; /* empty string as type will be considered NULL */
|
||||
|
||||
dbg(1, "extra_rawfile(): what=%d, file=%s, type=%s\n",
|
||||
what, file ? file : "<NULL>", type ? type : "<NULL>");
|
||||
dbg(1, "extra_rawfile(): what=%d, no_warning=%d, file=%s, type=%s\n",
|
||||
what, no_warning, file ? file : "<NULL>", type ? type : "<NULL>");
|
||||
if(what == 0) return 0;
|
||||
/* if not already done insert base raw file (if there is one) into xctx->extra_raw_arr[0] */
|
||||
if(xctx->raw && xctx->extra_raw_n == 0) {
|
||||
|
|
@ -1208,7 +1219,9 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
|||
xctx->extra_raw_n++;
|
||||
} else {
|
||||
ret = 0; /* not found so did not switch */
|
||||
dbg(0, "extra_rawfile() read: %s not found or no \"%s\" analysis\n", f, type);
|
||||
if(!no_warning) {
|
||||
dbg(0, "extra_rawfile() read: %s not found or no \"%s\" analysis\n", f, type);
|
||||
}
|
||||
if(xctx->extra_raw_n) { /* only restore if raw wiles were not deleted due to a failure in read_raw() */
|
||||
xctx->raw = save; /* restore */
|
||||
xctx->extra_prev_idx = xctx->extra_idx;
|
||||
|
|
@ -1239,7 +1252,7 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
|||
Raw *save;
|
||||
save = xctx->raw;
|
||||
xctx->raw = NULL;
|
||||
read_ret = raw_read(f, &xctx->raw, type, sweep1, sweep2);
|
||||
read_ret = raw_read(f, &xctx->raw, type, no_warning, sweep1, sweep2);
|
||||
if(read_ret) {
|
||||
dbg(1, "extra_rawfile(): read %s %s, switch to it. raw->sim_type=%s\n", f,
|
||||
type ? type : "<NULL>", xctx->raw->sim_type ? xctx->raw->sim_type : "<NULL>");
|
||||
|
|
@ -1249,7 +1262,9 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
|||
xctx->extra_raw_n++;
|
||||
} else {
|
||||
ret = 0; /* not found so did not switch */
|
||||
dbg(0, "extra_rawfile() read: %s not found or no \"%s\" analysis\n", f, type ? type : "<unspecified>");
|
||||
if(!no_warning) {
|
||||
dbg(0, "extra_rawfile() read: %s not found or no \"%s\" analysis\n", f, type ? type : "<unspecified>");
|
||||
}
|
||||
if(xctx->extra_raw_n) { /* only restore if raw wiles were not deleted due to a failure in read_raw() */
|
||||
xctx->raw = save; /* restore */
|
||||
xctx->extra_prev_idx = xctx->extra_idx;
|
||||
|
|
@ -1290,7 +1305,9 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
|||
xctx->extra_prev_idx = xctx->extra_idx;
|
||||
xctx->extra_idx = i;
|
||||
} else {
|
||||
dbg(0, "extra_rawfile() switch: %s not found or no %s analysis\n", f, type ? type : "<NULL>");
|
||||
if(!no_warning) {
|
||||
dbg(0, "extra_rawfile() switch: %s not found or no %s analysis\n", f, type ? type : "<NULL>");
|
||||
}
|
||||
ret = 0;
|
||||
}
|
||||
} else { /* switch to next */
|
||||
|
|
@ -1310,7 +1327,7 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
|||
if(!file) { /* clear all */
|
||||
if(xctx->extra_raw_n == 0) ret = 0;
|
||||
for(i = 0; i < xctx->extra_raw_n; i++) {
|
||||
free_rawfile(&xctx->extra_raw_arr[i], 0);
|
||||
free_rawfile(&xctx->extra_raw_arr[i], 0, no_warning);
|
||||
}
|
||||
tcleval("array unset ngspice::ngspice_data");
|
||||
xctx->raw = NULL;
|
||||
|
|
@ -1327,11 +1344,11 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
|||
!strcmp(xctx->extra_raw_arr[i]->rawfile, f) &&
|
||||
!strcmp(xctx->extra_raw_arr[i]->sim_type, type)
|
||||
) {
|
||||
free_rawfile(&xctx->extra_raw_arr[i], 0);
|
||||
free_rawfile(&xctx->extra_raw_arr[i], 0, no_warning);
|
||||
found++;
|
||||
continue;
|
||||
} else if( !(type && type[0]) && !strcmp(xctx->extra_raw_arr[i]->rawfile, f)) {
|
||||
free_rawfile(&xctx->extra_raw_arr[i], 0);
|
||||
free_rawfile(&xctx->extra_raw_arr[i], 0, no_warning);
|
||||
found++;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1455,6 +1455,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
if(!strcmp(argv[2], "modified")) { /* schematic is in modified state (needs a save) */
|
||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
Tcl_SetResult(interp, my_itoa(xctx->modified),TCL_VOLATILE);
|
||||
}
|
||||
break;
|
||||
case 'n':
|
||||
if(!strcmp(argv[2], "netlist_name")) { /* netlist name if set. If 'fallback' given get default name */
|
||||
if(argc > 3 && !strcmp(argv[3], "fallback")) {
|
||||
|
|
@ -2093,17 +2099,19 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
#endif
|
||||
}
|
||||
|
||||
/* go_back [notitle]
|
||||
/* go_back [what]
|
||||
* Go up one level (pop) in hierarchy
|
||||
* if integer 'notitle' given pass it to the go_back() function (1=do not update window title) */
|
||||
* if integer 'what' given pass it to the go_back() function
|
||||
* what = 1: ask confirm save if current schematic modified.
|
||||
* what = 2: do not reset window title */
|
||||
else if(!strcmp(argv[1], "go_back"))
|
||||
{
|
||||
int set_title = 1;
|
||||
int what = 1;
|
||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
if(argc > 2 ) {
|
||||
set_title = atoi(argv[2]);
|
||||
what = atoi(argv[2]);
|
||||
}
|
||||
if((xctx->semaphore == 0)) go_back(1, set_title);
|
||||
if((xctx->semaphore == 0)) go_back(what);
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
|
|
@ -4163,7 +4171,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
{
|
||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0); /* unload additional raw files */
|
||||
/* free_rawfile(&xctx->raw, 1); */ /* unload base (current) raw file */
|
||||
/* free_rawfile(&xctx->raw, 1, 0); */ /* unload base (current) raw file */
|
||||
draw();
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
|
@ -4183,14 +4191,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
* if(sch_waves_loaded() >= 0) {
|
||||
* tcleval("array unset ngspice::ngspice_data");
|
||||
* extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
* free_rawfile(&xctx->raw, 1);
|
||||
* free_rawfile(&xctx->raw, 1, 0);
|
||||
* } else
|
||||
*/
|
||||
if(argc > 2) {
|
||||
double sweep1 = -1.0, sweep2 = -1.0;
|
||||
tcleval("array unset ngspice::ngspice_data");
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(&xctx->raw, 0); */
|
||||
/* free_rawfile(&xctx->raw, 0, 0); */
|
||||
my_snprintf(f, S(f),"regsub {^~/} {%s} {%s/}", argv[2], home_dir);
|
||||
tcleval(f);
|
||||
my_strncpy(f, tclresult(), S(f));
|
||||
|
|
@ -4198,8 +4206,8 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
sweep1 = atof_spice(argv[4]);
|
||||
sweep2 = atof_spice(argv[5]);
|
||||
}
|
||||
if(argc > 3) res = raw_read(f, &xctx->raw, argv[3], sweep1, sweep2);
|
||||
else res = raw_read(f, &xctx->raw, NULL, -1.0, -1.0);
|
||||
if(argc > 3) res = raw_read(f, &xctx->raw, argv[3], 0, sweep1, sweep2);
|
||||
else res = raw_read(f, &xctx->raw, NULL, 0, -1.0, -1.0);
|
||||
if(sch_waves_loaded() >= 0) {
|
||||
draw();
|
||||
}
|
||||
|
|
@ -4218,11 +4226,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
if(sch_waves_loaded() >= 0) {
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(&xctx->raw, 1); */
|
||||
/* free_rawfile(&xctx->raw, 1, 0); */
|
||||
draw();
|
||||
} else {
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(&xctx->raw, 0); */
|
||||
/* free_rawfile(&xctx->raw, 0, 0); */
|
||||
if(argc > 2) raw_read_from_attr(&xctx->raw, argv[2], -1.0, -1.0);
|
||||
else raw_read_from_attr(&xctx->raw, NULL, -1.0, -1.0);
|
||||
if(sch_waves_loaded() >= 0) {
|
||||
|
|
@ -5763,14 +5771,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
if(sch_waves_loaded() >= 0) {
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(&xctx->raw, 1); */
|
||||
/* free_rawfile(&xctx->raw, 1, 0); */
|
||||
draw();
|
||||
} else if(argc > 2) {
|
||||
my_snprintf(f, S(f),"regsub {^~/} {%s} {%s/}", argv[2], home_dir);
|
||||
tcleval(f);
|
||||
my_strncpy(f, tclresult(), S(f));
|
||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||
/* free_rawfile(&xctx->raw, 0); */
|
||||
/* free_rawfile(&xctx->raw, 0, 0); */
|
||||
table_read(f);
|
||||
if(sch_waves_loaded() >= 0) {
|
||||
draw();
|
||||
|
|
|
|||
|
|
@ -1270,10 +1270,10 @@ extern char *base64_encode(const unsigned char *data, const size_t input_length,
|
|||
extern unsigned char *ascii85_encode(const unsigned char *data, const size_t input_length, size_t *output_length);
|
||||
extern int raw_get_pos(const char *node, double value, int dset, int from_start, int to_end);
|
||||
extern int get_raw_index(const char *node, Int_hashentry **entry_ret);
|
||||
extern void free_rawfile(Raw **rawptr, int dr);
|
||||
extern void free_rawfile(Raw **rawptr, int dr, int no_warning);
|
||||
extern int update_op();
|
||||
extern int extra_rawfile(int what, const char *f, const char *type, double sweep1, double sweep2);
|
||||
extern int raw_read(const char *f, Raw **rawptr, const char *type, double sweep1, double sweep2);
|
||||
extern int raw_read(const char *f, Raw **rawptr, const char *type, int no_warning, double sweep1, double sweep2);
|
||||
extern int table_read(const char *f);
|
||||
extern double get_raw_value(int dataset, int idx, int point);
|
||||
extern int plot_raw_custom_data(int sweep_idx, int first, int last, const char *ntok, const char *yname);
|
||||
|
|
@ -1528,7 +1528,7 @@ extern void toggle_ignore(void);
|
|||
extern void get_additional_symbols(int what);
|
||||
extern int change_sch_path(int instnumber, int dr);
|
||||
extern int descend_schematic(int instnumber, int fallback, int alert, int set_title);
|
||||
extern void go_back(int confirm, int set_title);
|
||||
extern void go_back(int what); /* what == 1: confirm save; what == 2: do not reset window title */
|
||||
extern void clear_schematic(int cancel, int symbol);
|
||||
extern void view_unzoom(double z);
|
||||
extern void view_zoom(double z);
|
||||
|
|
|
|||
|
|
@ -7603,7 +7603,7 @@ set tctx::global_list {
|
|||
graph_logy graph_private_cursor graph_rainbow graph_schname graph_sel_color graph_sel_wave
|
||||
graph_selected graph_sort graph_unlocked graph_use_ctrl_key
|
||||
hide_empty_graphs hide_symbols tctx::hsize
|
||||
incr_hilight incremental_select infowindow_text intuitive_interface
|
||||
incr_hilight incremental_select infix_interface infowindow_text intuitive_interface
|
||||
keep_symbols launcher_default_program
|
||||
light_colors line_width live_cursor2_backannotate local_netlist_dir lvs_ignore
|
||||
lvs_netlist measure_text netlist_dir netlist_show netlist_type no_ask_save
|
||||
|
|
@ -9066,6 +9066,7 @@ set_ne big_grid_points 0
|
|||
set_ne draw_grid_axes 1
|
||||
set_ne persistent_command 0
|
||||
set_ne intuitive_interface 1
|
||||
set_ne infix_interface 1
|
||||
set_ne autotrim_wires 0
|
||||
set_ne infix_interface 0
|
||||
set_ne orthogonal_wiring 1
|
||||
|
|
|
|||
|
|
@ -201,6 +201,11 @@
|
|||
#### default: 0
|
||||
# set persistent_command 1
|
||||
|
||||
#### if set to 0 users must click a point after hitting a command key
|
||||
#### like 'w(ire)', 'l(ine)' and so on.
|
||||
#### default is 1 (hitting the command key sets also the first point).
|
||||
# set infix_interface 0
|
||||
|
||||
#### if set to 1 allow click & drag objects in the schematic
|
||||
#### to move them without keyboard commands ('m')
|
||||
#### default: enabled (1)
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ v {xschem version=3.4.6 file_version=1.2
|
|||
}
|
||||
G {}
|
||||
K {type=source
|
||||
format="@name @pinlist @VAR = @FUNC "
|
||||
template="name=B1 VAR=I FUNC=\\"pwl(V(plus,minus),0,0, 1,10m, 2, 100m)\\""}
|
||||
format="@name @pinlist @VAR = @FUNC m=@m"
|
||||
template="name=B1 VAR=I FUNC=\\"'pwl(V(plus,minus),0,0, 1,10m, 2, 100m)'\\" m=1"}
|
||||
V {}
|
||||
S {}
|
||||
E {}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue