diff --git a/src/save.c b/src/save.c index 573fbb13..e8448d93 100644 --- a/src/save.c +++ b/src/save.c @@ -834,6 +834,10 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) } my_free(_ALLOC_ID_, &line); } /* while((line = my_fgets(fd, NULL)) */ + + + /* no analysis was found: delete */ + if(exit_status != 1) extra_rawfile(3, NULL, NULL, -1.0, -1.0); read_dataset_done: if(line) my_free(_ALLOC_ID_, &line); if(lowerline) my_free(_ALLOC_ID_, &lowerline); diff --git a/src/scheduler.c b/src/scheduler.c index f4c8a2de..210fb5c5 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -321,6 +321,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg else if(!strcmp(argv[1], "annotate_op")) { int level = -1; + int res = 0; char f[PATH_MAX + 100]; if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} if(argc > 3) { @@ -340,13 +341,19 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg /* clear all raw files */ extra_rawfile(3, NULL, NULL, -1.0, -1.0); /* free_rawfile(&xctx->raw, 1); */ - raw_read(f, &xctx->raw, "op", -1.0, -1.0); - if(level >= 0) { - xctx->raw->level = level; - my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[level]); + res = raw_read(f, &xctx->raw, "op", -1.0, -1.0); + if(res != 1) { + /* Xyce uses a 1-point dc transfer characteristic for operating point data */ + res = raw_read(f, &xctx->raw, "dc", -1.0, -1.0); + } + if(res == 1) { + if(level >= 0) { + xctx->raw->level = level; + my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[level]); + } + update_op(); + draw(); } - update_op(); - draw(); } /* arc