Improve two error messages: in d_cosim, report the filename given,

not the last one tried; and report attempted use of iplot or
tclplot in batch mode only once.
This commit is contained in:
Giles Atkinson 2024-11-30 12:37:36 +00:00 committed by Holger Vogt
parent 721aab9624
commit 932ef50cc3
4 changed files with 24 additions and 5 deletions

View File

@ -15,6 +15,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "breakp.h"
#include "breakp2.h"
#include "runcoms2.h"
#include "com_plot.h"
#include "completion.h"
@ -213,6 +214,9 @@ com_trce(wordlist *wl)
void
com_iplot(wordlist *wl)
{
if (check_batch("iplot"))
return;
/* Check for an active circuit */
if (ft_curckt == (struct circ *) NULL) {
fprintf(cp_err, "No circuit loaded. "

View File

@ -9,15 +9,27 @@
extern bool ft_batchmode;
/* Utility function to check for batch mode. */
int check_batch(const char *cmd)
{
if (ft_batchmode) {
fprintf(stderr,
"\nWarning: command '%s' is not available during "
"batch simulation, ignored!\n",
cmd);
fprintf(stderr, " You may use Gnuplot instead.\n\n");
return 1;
}
return 0;
}
/* plot name ... [xl[imit]] xlo xhi] [yl[imit ylo yhi] [vs xname] */
void
com_plot(wordlist *wl)
{
if (ft_batchmode) {
fprintf(stderr, "\nWarning: command 'plot' is not available during batch simulation, ignored!\n");
fprintf(stderr, " You may use Gnuplot instead.\n\n");
if (check_batch("plot"))
return;
}
plotit(wl, NULL, NULL);
}
@ -25,6 +37,8 @@ com_plot(wordlist *wl)
void
com_bltplot(wordlist *wl)
{
if (check_batch("bltplot"))
return;
plotit(wl, NULL, "blt");
}

View File

@ -5,4 +5,5 @@ void com_plot(wordlist *wl);
#ifdef TCL_MODULE
void com_bltplot(wordlist *wl);
#endif
extern int check_batch(const char *cmd); // Also used by iplot etc.
#endif

View File

@ -166,7 +166,7 @@ static void *cosim_dlopen(const char *fn)
break;
}
fprintf(stderr, "Cannot open " SLIBFILE " %s: %s\n", path, dlerror());
fprintf(stderr, "Cannot open " SLIBFILE " %s: %s\n", fn, dlerror());
return NULL;
}