From a97b47623f1265b2e6b3f3ad1d4ecc4b40fafaa6 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Wed, 11 Dec 2024 01:54:31 +0100 Subject: [PATCH] annotate_op: delete current raw file (to replace with new OP raw) ONLY if current loaded raw file is an OP simulation (npoints==1) --- src/scheduler.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/scheduler.c b/src/scheduler.c index 936d4db3..beff7ada 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -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) {