Check for tran at first when linearize is called.

This commit is contained in:
Holger Vogt 2022-08-17 15:14:06 +02:00
parent a361d63ca1
commit cc866ead29
1 changed files with 6 additions and 5 deletions

View File

@ -30,7 +30,11 @@ com_linearize(wordlist *wl)
struct dvec *lin;
int len, i;
if (!plot_cur || !plot_cur->pl_dvecs || !plot_cur->pl_scale) {
if (!plot_cur || !plot_cur->pl_typename || !ciprefix("tran", plot_cur->pl_typename)) {
fprintf(cp_err, "Error: plot must be a transient analysis\n");
return;
}
if (!plot_cur->pl_dvecs || !plot_cur->pl_scale) {
fprintf(cp_err, "Error: no vectors available\n");
return;
}
@ -39,10 +43,7 @@ com_linearize(wordlist *wl)
plot_cur->pl_typename);
return;
}
if (!ciprefix("tran", plot_cur->pl_typename)) {
fprintf(cp_err, "Error: plot must be a transient analysis\n");
return;
}
/* check if circuit is loaded and TSTART, TSTOP, TSTEP are available
if no circuit is loaded, but vectors are available, obtain
start, stop, step data from scale vector */