/*****************************************************************************
** FILE IDENTIFICATION
**
-** EZSET - Parameter control for EZPLOT
+** EZSET - Parameter control for EZPLOT
**
** This is part of the CTSim program
-** Copyright (c) 1983-2001 Kevin Rosenberg
-**
-** $Id: ezset.cpp,v 1.17 2001/01/28 19:10:18 kevin Exp $
+** Copyright (c) 1983-2009 Kevin Rosenberg
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
return ezset (command.c_str());
}
-bool
+bool
EZPlot::ezset (const char* const command)
{
return ezcmd (command);
}
-bool
+bool
EZPlot::ezcmd (const char* const comm)
{
m_pol.usefile (POL::P_USE_STR, "");
m_pol.set_inputline (comm);
-
+
char str [POL::MAXTOK+1];
int code;
bool retval = true;
}
else
retval = do_cmd (code);
-
- m_pol.closefile(); /* close input string file */
+
+ m_pol.closefile(); /* close input string file */
return (retval);
}
char strIn [1024];
int n;
double f;
-
+
switch (lx) {
case S_TEXTSIZE:
if (m_pol.readFloat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
}
if (m_iCurrentCurve < 0)
o_linestyle = ls;
- else
+ else
setLinestyle (m_iCurrentCurve, ls);
break;
case S_NOLINE:
if (n >= 0) {
if (m_iCurrentCurve < 0)
o_color = n;
- else
+ else
setColor (m_iCurrentCurve, n);
} else
bad_option("The color you picked");
sym = n;
if (m_iCurrentCurve < 0)
o_symfreq = sym;
- else
+ else
setSymbolFreq (m_iCurrentCurve, sym);
}
} else if (m_pol.readWord ("none",4) == TRUE) {
if (n > 0)
m_iCurrentCurve = n - 1;
} else {
- if (m_pol.readWord ("all",3) == TRUE)
+ if (m_pol.readWord ("all",3) == TRUE)
m_iCurrentCurve = -1;
}
break;
fprintf (stderr, "Unimplemented EZPLOT command\n");
break;
}
-
+
m_pol.reader ();
return (true);
}
-void
-EZPlot::bad_option (char *opt)
+void
+EZPlot::bad_option (const char *opt)
{
sys_error (ERR_WARNING, "INVALID option: %s", opt);
}
//----------------------------------------------------------------------
-// KEYWORDS / CODES TABLE
+// KEYWORDS / CODES TABLE
//----------------------------------------------------------------------
const struct KeywordCodeTable EZPlot::m_sKeywords[] =
{
- {"solid", S_SOLID},
+ {"solid", S_SOLID},
{"dash", S_DASH},
{"curve", S_CURVE},
- {"noline", S_NOLINE},
- {"black", S_BLACK},
- {"red", S_RED},
- {"blue", S_BLUE},
- {"green", S_GREEN},
- {"pen", S_PEN},
- {"symbol", S_SYMBOL},
- {"every", S_EVERY},
- {"none", S_NONE},
- {"legend", S_LEGEND},
- {"xlegend", S_XLEGEND},
- {"ylegend", S_YLEGEND},
-
- {"xlin", S_XLIN},
- {"ylin", S_YLIN},
- {"xlog", S_XLOG},
- {"ylog", S_YLOG},
- {"xlabel", S_XLABEL},
- {"ylabel", S_YLABEL},
- {"xlength", S_XLENGTH},
- {"ylength", S_YLENGTH},
-
- {"xticks", S_XTICKS},
- {"yticks", S_YTICKS},
- {"above", S_ABOVE},
- {"label", S_LABEL},
- {"below", S_BELOW},
- {"nolabel", S_NOLABEL},
- {"right", S_RIGHT},
- {"left", S_LEFT},
-
- {"xautoscale", S_XAUTOSCALE},
- {"yautoscale", S_YAUTOSCALE},
- {"xmin", S_XMIN},
- {"ymin", S_YMIN},
- {"xmax", S_XMAX},
- {"ymax", S_YMAX},
- {"lxfrac", S_LXFRAC},
- {"lyfrac", S_LYFRAC},
- {"xcross", S_XCROSS},
- {"ycross", S_YCROSS},
- {"noxaxis", S_NOXAXIS},
- {"noyaxis", S_NOYAXIS},
- {"xporigin", S_XPORIGIN},
- {"yporigin", S_YPORIGIN},
- {"title", S_TITLE},
- {"xtitle", S_XTITLE},
- {"ytitle", S_YTITLE},
-
- {"replot", S_REPLOT},
- {"clear", S_CLEAR},
- {"store", S_STORE},
- {"restore", S_RESTORE},
- {"amark", S_AMARK},
- {"units", S_UNITS},
- {"inches", S_INCHES},
- {"user", S_USER},
-
- {"data", S_DATA},
- {"help", S_HELP},
- {"exit", S_EXIT},
-
- {"box", S_BOX},
- {"nobox", S_NOBOX},
- {"grid", S_GRID},
- {"nogrid", S_NOGRID},
- {"major", S_MAJOR},
- {"minor", S_MINOR},
- {"color", S_COLOR},
- {"legendbox", S_LEGENDBOX},
-
- {"no", S_NO},
-
- {"textsize", S_TEXTSIZE},
+ {"noline", S_NOLINE},
+ {"black", S_BLACK},
+ {"red", S_RED},
+ {"blue", S_BLUE},
+ {"green", S_GREEN},
+ {"pen", S_PEN},
+ {"symbol", S_SYMBOL},
+ {"every", S_EVERY},
+ {"none", S_NONE},
+ {"legend", S_LEGEND},
+ {"xlegend", S_XLEGEND},
+ {"ylegend", S_YLEGEND},
+
+ {"xlin", S_XLIN},
+ {"ylin", S_YLIN},
+ {"xlog", S_XLOG},
+ {"ylog", S_YLOG},
+ {"xlabel", S_XLABEL},
+ {"ylabel", S_YLABEL},
+ {"xlength", S_XLENGTH},
+ {"ylength", S_YLENGTH},
+
+ {"xticks", S_XTICKS},
+ {"yticks", S_YTICKS},
+ {"above", S_ABOVE},
+ {"label", S_LABEL},
+ {"below", S_BELOW},
+ {"nolabel", S_NOLABEL},
+ {"right", S_RIGHT},
+ {"left", S_LEFT},
+
+ {"xautoscale", S_XAUTOSCALE},
+ {"yautoscale", S_YAUTOSCALE},
+ {"xmin", S_XMIN},
+ {"ymin", S_YMIN},
+ {"xmax", S_XMAX},
+ {"ymax", S_YMAX},
+ {"lxfrac", S_LXFRAC},
+ {"lyfrac", S_LYFRAC},
+ {"xcross", S_XCROSS},
+ {"ycross", S_YCROSS},
+ {"noxaxis", S_NOXAXIS},
+ {"noyaxis", S_NOYAXIS},
+ {"xporigin", S_XPORIGIN},
+ {"yporigin", S_YPORIGIN},
+ {"title", S_TITLE},
+ {"xtitle", S_XTITLE},
+ {"ytitle", S_YTITLE},
+
+ {"replot", S_REPLOT},
+ {"clear", S_CLEAR},
+ {"store", S_STORE},
+ {"restore", S_RESTORE},
+ {"amark", S_AMARK},
+ {"units", S_UNITS},
+ {"inches", S_INCHES},
+ {"user", S_USER},
+
+ {"data", S_DATA},
+ {"help", S_HELP},
+ {"exit", S_EXIT},
+
+ {"box", S_BOX},
+ {"nobox", S_NOBOX},
+ {"grid", S_GRID},
+ {"nogrid", S_NOGRID},
+ {"major", S_MAJOR},
+ {"minor", S_MINOR},
+ {"color", S_COLOR},
+ {"legendbox", S_LEGENDBOX},
+
+ {"no", S_NO},
+
+ {"textsize", S_TEXTSIZE},
};
const int EZPlot::NKEYS = (sizeof(EZPlot::m_sKeywords) / sizeof (struct KeywordCodeTable));
-void
+void
EZPlot::initKeywords ()
{
for (int i = 0; i < NKEYS; i++)