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:
parent
721aab9624
commit
932ef50cc3
|
|
@ -15,6 +15,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||||
#include "breakp.h"
|
#include "breakp.h"
|
||||||
#include "breakp2.h"
|
#include "breakp2.h"
|
||||||
#include "runcoms2.h"
|
#include "runcoms2.h"
|
||||||
|
#include "com_plot.h"
|
||||||
|
|
||||||
#include "completion.h"
|
#include "completion.h"
|
||||||
|
|
||||||
|
|
@ -213,6 +214,9 @@ com_trce(wordlist *wl)
|
||||||
void
|
void
|
||||||
com_iplot(wordlist *wl)
|
com_iplot(wordlist *wl)
|
||||||
{
|
{
|
||||||
|
if (check_batch("iplot"))
|
||||||
|
return;
|
||||||
|
|
||||||
/* Check for an active circuit */
|
/* Check for an active circuit */
|
||||||
if (ft_curckt == (struct circ *) NULL) {
|
if (ft_curckt == (struct circ *) NULL) {
|
||||||
fprintf(cp_err, "No circuit loaded. "
|
fprintf(cp_err, "No circuit loaded. "
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,27 @@
|
||||||
|
|
||||||
extern bool ft_batchmode;
|
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] */
|
/* plot name ... [xl[imit]] xlo xhi] [yl[imit ylo yhi] [vs xname] */
|
||||||
void
|
void
|
||||||
com_plot(wordlist *wl)
|
com_plot(wordlist *wl)
|
||||||
{
|
{
|
||||||
if (ft_batchmode) {
|
if (check_batch("plot"))
|
||||||
fprintf(stderr, "\nWarning: command 'plot' is not available during batch simulation, ignored!\n");
|
|
||||||
fprintf(stderr, " You may use Gnuplot instead.\n\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
plotit(wl, NULL, NULL);
|
plotit(wl, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -25,6 +37,8 @@ com_plot(wordlist *wl)
|
||||||
void
|
void
|
||||||
com_bltplot(wordlist *wl)
|
com_bltplot(wordlist *wl)
|
||||||
{
|
{
|
||||||
|
if (check_batch("bltplot"))
|
||||||
|
return;
|
||||||
plotit(wl, NULL, "blt");
|
plotit(wl, NULL, "blt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,5 @@ void com_plot(wordlist *wl);
|
||||||
#ifdef TCL_MODULE
|
#ifdef TCL_MODULE
|
||||||
void com_bltplot(wordlist *wl);
|
void com_bltplot(wordlist *wl);
|
||||||
#endif
|
#endif
|
||||||
|
extern int check_batch(const char *cmd); // Also used by iplot etc.
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ static void *cosim_dlopen(const char *fn)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "Cannot open " SLIBFILE " %s: %s\n", path, dlerror());
|
fprintf(stderr, "Cannot open " SLIBFILE " %s: %s\n", fn, dlerror());
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue