annotate_op: delete current raw file (to replace with new OP raw) ONLY if current loaded raw file is an OP simulation (npoints==1)

This commit is contained in:
stefan schippers 2024-12-11 01:54:31 +01:00
parent 13e38b803d
commit a97b47623f
1 changed files with 5 additions and 6 deletions

View File

@ -338,16 +338,15 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
my_snprintf(f, S(f), "%s/%s.raw", tclgetvar("netlist_dir"), get_cell(xctx->sch[xctx->currsch], 0));
}
tclsetboolvar("live_cursor2_backannotate", 1);
if(xctx->raw && xctx->raw->rawfile) {
res = extra_rawfile(3, xctx->raw->rawfile, "op", -1.0, -1.0);
if(res != 1 && xctx->raw && xctx->raw->rawfile) {
extra_rawfile(3, xctx->raw->rawfile, "dc", -1.0, -1.0); /* Xyce OP is saved as a 1-point DC */
}
/* delete previously loaded OP */
if(xctx->raw && xctx->raw->rawfile && xctx->raw->allpoints == 1 &&
(!strcmp(xctx->raw->sim_type, "op") || !strcmp(xctx->raw->sim_type, "dc"))) {
res = extra_rawfile(3, xctx->raw->rawfile, xctx->raw->sim_type, -1.0, -1.0);
}
tcleval("array unset ngspice::ngspice_data");
res = extra_rawfile(1, f, "op", -1.0, -1.0);
if(res != 1) {
/* Xyce uses a 1-point dc transfer characteristic for operating point data */
/* Xyce uses a 1-point DC transfer characteristic for operating point (OP) data */
res = extra_rawfile(1, f, "dc", -1.0, -1.0);
}
if(res == 1) {