** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezset.cpp,v 1.14 2000/12/27 20:09:19 kevin Exp $
+** $Id: ezset.cpp,v 1.16 2001/01/02 16:02:13 kevin Exp $
**
** 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
#include "ezplot.h"
#include "pol.h"
-\r
-bool\r
-EZPlot::ezset (const std::string& command)\r
-{\r
- return ezset (command.c_str());\r
-}\r
+
+bool
+EZPlot::ezset (const std::string& command)
+{
+ return ezset (command.c_str());
+}
bool
EZPlot::ezset (const char* const command)
{
-\r
+
return ezcmd (command);
}
}
break;
case S_REPLOT:
- plot ();
+ plot (m_pSGP);
break;
case S_CLEAR:
clearCurves ();
c_title = strIn;
break;
case S_LEGEND:
- m_pol.readText (strIn, sizeof(strIn));\r
- if (m_iCurrentCurve >= 0)\r
+ m_pol.readText (strIn, sizeof(strIn));
+ if (m_iCurrentCurve >= 0)
setLegend (m_iCurrentCurve, strIn);
break;
case S_XLABEL:
o_linestyle = SGP::LS_SOLID;
break;
case S_DASH:
- int ls;\r
- ls = SGP::LS_DASH1;\r
- if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {\r
+ int ls;
+ ls = SGP::LS_DASH1;
+ if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
if (n == 1)
ls = SGP::LS_DASH1;
else if (n == 2)
ls = SGP::LS_DASH2;
else if (n == 3)
ls = SGP::LS_DASH3;
- else if (n == 4)\r
- ls = SGP::LS_DASH4;\r
- else if (n == 5)\r
- ls = SGP::LS_DOTTED;\r
- }\r
- if (m_iCurrentCurve < 0)\r
- o_linestyle = ls;\r
- else \r
- setLinestyle (m_iCurrentCurve, ls);\r
+ else if (n == 4)
+ ls = SGP::LS_DASH4;
+ else if (n == 5)
+ ls = SGP::LS_DOTTED;
+ }
+ if (m_iCurrentCurve < 0)
+ o_linestyle = ls;
+ else
+ setLinestyle (m_iCurrentCurve, ls);
break;
case S_NOLINE:
o_linestyle = SGP::LS_NOLINE;
case S_COLOR:
if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
{
- if (n >= 0) {\r
+ if (n >= 0) {
if (m_iCurrentCurve < 0)
- o_color = n;\r
- else \r
- setColor (m_iCurrentCurve, n);\r
+ o_color = n;
+ else
+ setColor (m_iCurrentCurve, n);
} else
bad_option("The color you picked");
}
case S_SYMBOL:
if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
if (n > 0 && n <= MAXSYMBOL) {
- if (m_iCurrentCurve < 0)\r
- o_symbol = n;\r
- else\r
- setSymbol (m_iCurrentCurve, n);\r
- }\r
+ if (m_iCurrentCurve < 0)
+ o_symbol = n;
+ else
+ setSymbol (m_iCurrentCurve, n);
+ }
} else {
if (m_pol.readWord("every",5) == TRUE) {
- if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {\r
+ if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
int sym = 1;
- if (n > 0)\r
- sym = n;\r
- if (m_iCurrentCurve < 0)\r
- o_symfreq = sym;\r
- else \r
- setSymbolFreq (m_iCurrentCurve, sym);\r
+ if (n > 0)
+ sym = n;
+ if (m_iCurrentCurve < 0)
+ o_symfreq = sym;
+ else
+ setSymbolFreq (m_iCurrentCurve, sym);
}
} else if (m_pol.readWord ("none",4) == TRUE) {
o_symbol = -1;
}
}
break;
- case S_CURVE:\r
- if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {\r
- if (n > 0)\r
- m_iCurrentCurve = n - 1;\r
- } else {\r
- if (m_pol.readWord ("all",3) == TRUE) \r
- m_iCurrentCurve = -1;\r
- }\r
- break;\r
+ case S_CURVE:
+ if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
+ if (n > 0)
+ m_iCurrentCurve = n - 1;
+ } else {
+ if (m_pol.readWord ("all",3) == TRUE)
+ m_iCurrentCurve = -1;
+ }
+ break;
case S_XTICKS:
if (m_pol.readUserToken(str,&lx) == FALSE)
break;
}
-\r
+
void
EZPlot::bad_option (char *opt)
{
sys_error (ERR_WARNING, "INVALID option: %s", opt);
}
-\r
+
//----------------------------------------------------------------------
// KEYWORDS / CODES TABLE
//----------------------------------------------------------------------
-const struct KeywordCodeTable EZPlot::m_sKeywords[] =\r
-{\r
+const struct KeywordCodeTable EZPlot::m_sKeywords[] =
+{
{"solid", S_SOLID},
- {"dash", S_DASH},\r
+ {"dash", S_DASH},
{"curve", S_CURVE},
{"noline", S_NOLINE},
{"black", S_BLACK},
{"textsize", S_TEXTSIZE},
};
-\r
+
const int EZPlot::NKEYS = (sizeof(EZPlot::m_sKeywords) / sizeof (struct KeywordCodeTable));
void