projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r323: *** empty log message ***
[ctsim.git]
/
libctgraphics
/
ezset.cpp
diff --git
a/libctgraphics/ezset.cpp
b/libctgraphics/ezset.cpp
index 69131447e5e0da40c8c49475a03c14fe4f2cfc8f..222b3cd5a77c08d1986847f7b0be87cf9002a160 100644
(file)
--- a/
libctgraphics/ezset.cpp
+++ b/
libctgraphics/ezset.cpp
@@
-6,7
+6,7
@@
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezset.cpp,v 1.1
3 2000/12/27 03:16:02
kevin Exp $
+** $Id: ezset.cpp,v 1.1
5 2000/12/29 15:45:06
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
**
** 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
@@
-49,7
+49,7
@@
EZPlot::ezcmd (const char* const comm)
char str [POL::MAXTOK+1];
int code;
bool retval = true;
char str [POL::MAXTOK+1];
int code;
bool retval = true;
- if (! m_pol.
usertok
(str, &code)) {
+ if (! m_pol.
readUserToken
(str, &code)) {
sys_error (ERR_WARNING, "Illegal EZSET command: %s", str);
m_pol.reader();
retval = false;
sys_error (ERR_WARNING, "Illegal EZSET command: %s", str);
m_pol.reader();
retval = false;
@@
-72,7
+72,7
@@
EZPlot::do_cmd (int lx)
switch (lx) {
case S_TEXTSIZE:
switch (lx) {
case S_TEXTSIZE:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
if (f >= 0.0 && f <= 1.0) {
v_textsize = f;
s_textsize = TRUE;
if (f >= 0.0 && f <= 1.0) {
v_textsize = f;
s_textsize = TRUE;
@@
-81,37
+81,37
@@
EZPlot::do_cmd (int lx)
}
break;
case S_REPLOT:
}
break;
case S_REPLOT:
- plot ();
+ plot (
m_pSGP
);
break;
case S_CLEAR:
clearCurves ();
break;
case S_TITLE:
break;
case S_CLEAR:
clearCurves ();
break;
case S_TITLE:
- m_pol.
gett
ext (strIn, sizeof(strIn));
+ m_pol.
readT
ext (strIn, sizeof(strIn));
c_title = strIn;
break;
case S_LEGEND:
c_title = strIn;
break;
case S_LEGEND:
- m_pol.
gett
ext (strIn, sizeof(strIn));
\r
+ m_pol.
readT
ext (strIn, sizeof(strIn));
\r
if (m_iCurrentCurve >= 0)
\r
setLegend (m_iCurrentCurve, strIn);
break;
case S_XLABEL:
if (m_iCurrentCurve >= 0)
\r
setLegend (m_iCurrentCurve, strIn);
break;
case S_XLABEL:
- m_pol.
gett
ext (strIn, sizeof(strIn));
+ m_pol.
readT
ext (strIn, sizeof(strIn));
c_xlabel = strIn;
break;
case S_YLABEL:
c_xlabel = strIn;
break;
case S_YLABEL:
- m_pol.
gett
ext (strIn, sizeof(strIn));
+ m_pol.
readT
ext (strIn, sizeof(strIn));
c_ylabel = strIn;
break;
case S_XCROSS:
c_ylabel = strIn;
break;
case S_XCROSS:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
v_xcross = f;
s_xcross = TRUE;
} else
s_xcross = FALSE;
break;
case S_YCROSS:
v_xcross = f;
s_xcross = TRUE;
} else
s_xcross = FALSE;
break;
case S_YCROSS:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
v_ycross = f;
s_ycross = TRUE;
} else
v_ycross = f;
s_ycross = TRUE;
} else
@@
-144,25
+144,25
@@
EZPlot::do_cmd (int lx)
s_ymax = FALSE;
break;
case S_XMIN:
s_ymax = FALSE;
break;
case S_XMIN:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
v_xmin = f;
s_xmin = TRUE;
}
break;
case S_XMAX:
v_xmin = f;
s_xmin = TRUE;
}
break;
case S_XMAX:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
v_xmax = f;
s_xmax = TRUE;
}
break;
case S_YMIN:
v_xmax = f;
s_xmax = TRUE;
}
break;
case S_YMIN:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
v_ymin = f;
s_ymin = TRUE;
}
break;
case S_YMAX:
v_ymin = f;
s_ymin = TRUE;
}
break;
case S_YMAX:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
v_ymax = f;
s_ymax = TRUE;
}
v_ymax = f;
s_ymax = TRUE;
}
@@
-173,7
+173,7
@@
EZPlot::do_cmd (int lx)
case S_DASH:
int ls;
\r
ls = SGP::LS_DASH1;
\r
case S_DASH:
int ls;
\r
ls = SGP::LS_DASH1;
\r
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
\r
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
\r
if (n == 1)
ls = SGP::LS_DASH1;
else if (n == 2)
if (n == 1)
ls = SGP::LS_DASH1;
else if (n == 2)
@@
-195,7
+195,7
@@
EZPlot::do_cmd (int lx)
break;
case S_PEN:
case S_COLOR:
break;
case S_PEN:
case S_COLOR:
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
{
if (n >= 0) {
\r
if (m_iCurrentCurve < 0)
{
if (n >= 0) {
\r
if (m_iCurrentCurve < 0)
@@
-219,47
+219,47
@@
EZPlot::do_cmd (int lx)
o_grid = FALSE;
break;
case S_XLENGTH:
o_grid = FALSE;
break;
case S_XLENGTH:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
if (f > 0.0 && f <= 1.0)
o_xlength = f;
break;
case S_YLENGTH:
if (f > 0.0 && f <= 1.0)
o_xlength = f;
break;
case S_YLENGTH:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
if (f > 0.0 && f <= 1.0)
o_ylength = f;
break;
case S_XPORIGIN:
if (f > 0.0 && f <= 1.0)
o_ylength = f;
break;
case S_XPORIGIN:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
if (f >= 0.0 && f < 1.0)
o_xporigin = f;
break;
case S_YPORIGIN:
if (f >= 0.0 && f < 1.0)
o_xporigin = f;
break;
case S_YPORIGIN:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
if (f >= 0.0 && f < 1.0)
o_yporigin = f;
break;
case S_TAG:
if (f >= 0.0 && f < 1.0)
o_yporigin = f;
break;
case S_TAG:
- if (m_pol.
w
ord("no", 2) == TRUE)
+ if (m_pol.
readW
ord("no", 2) == TRUE)
o_tag = FALSE;
o_tag = FALSE;
- else if (m_pol.
w
ord("off", 2) == TRUE)
+ else if (m_pol.
readW
ord("off", 2) == TRUE)
o_tag = FALSE;
else
o_tag = TRUE;
break;
case S_LEGENDBOX:
o_tag = FALSE;
else
o_tag = TRUE;
break;
case S_LEGENDBOX:
- if (m_pol.
w
ord("inside", 2) == TRUE)
+ if (m_pol.
readW
ord("inside", 2) == TRUE)
o_legendbox = INSIDE;
o_legendbox = INSIDE;
- else if (m_pol.
w
ord("outside", 3) == TRUE)
+ else if (m_pol.
readW
ord("outside", 3) == TRUE)
o_legendbox = OUTSIDE;
o_legendbox = OUTSIDE;
- else if (m_pol.
w
ord("none",2) == TRUE)
+ else if (m_pol.
readW
ord("none",2) == TRUE)
o_legendbox = NOLEGEND;
else {
o_legendbox = NOLEGEND;
else {
- m_pol.
gett
ext (str, POL::MAXTOK);
+ m_pol.
readT
ext (str, POL::MAXTOK);
bad_option(str);
}
break;
case S_XLEGEND:
bad_option(str);
}
break;
case S_XLEGEND:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
{
if (f >= 0.0 && f < 1.0) {
v_xlegend = f;
{
if (f >= 0.0 && f < 1.0) {
v_xlegend = f;
@@
-270,7
+270,7
@@
EZPlot::do_cmd (int lx)
}
break;
case S_YLEGEND:
}
break;
case S_YLEGEND:
- if (m_pol.read
f
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (m_pol.read
F
loat (&f, POL::TT_REAL, FALSE, 0.0, 0.0) == TRUE)
{
if (f >= 0.0 && f < 1.0) {
v_ylegend = f;
{
if (f >= 0.0 && f < 1.0) {
v_ylegend = f;
@@
-281,7
+281,7
@@
EZPlot::do_cmd (int lx)
}
break;
case S_SYMBOL:
}
break;
case S_SYMBOL:
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
if (n > 0 && n <= MAXSYMBOL) {
if (m_iCurrentCurve < 0)
\r
o_symbol = n;
\r
if (n > 0 && n <= MAXSYMBOL) {
if (m_iCurrentCurve < 0)
\r
o_symbol = n;
\r
@@
-289,8
+289,8
@@
EZPlot::do_cmd (int lx)
setSymbol (m_iCurrentCurve, n);
\r
}
\r
} else {
setSymbol (m_iCurrentCurve, n);
\r
}
\r
} else {
- if (m_pol.
w
ord("every",5) == TRUE) {
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
\r
+ if (m_pol.
readW
ord("every",5) == TRUE) {
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
\r
int sym = 1;
if (n > 0)
\r
sym = n;
\r
int sym = 1;
if (n > 0)
\r
sym = n;
\r
@@
-299,22
+299,22
@@
EZPlot::do_cmd (int lx)
else
\r
setSymbolFreq (m_iCurrentCurve, sym);
\r
}
else
\r
setSymbolFreq (m_iCurrentCurve, sym);
\r
}
- } else if (m_pol.
w
ord ("none",4) == TRUE) {
+ } else if (m_pol.
readW
ord ("none",4) == TRUE) {
o_symbol = -1;
}
}
break;
case S_CURVE:
\r
o_symbol = -1;
}
}
break;
case S_CURVE:
\r
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
\r
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
\r
if (n > 0)
\r
m_iCurrentCurve = n - 1;
\r
} else {
\r
if (n > 0)
\r
m_iCurrentCurve = n - 1;
\r
} else {
\r
- if (m_pol.
w
ord ("all",3) == TRUE)
\r
+ if (m_pol.
readW
ord ("all",3) == TRUE)
\r
m_iCurrentCurve = -1;
\r
}
\r
break;
\r
case S_XTICKS:
m_iCurrentCurve = -1;
\r
}
\r
break;
\r
case S_XTICKS:
- if (m_pol.
usertok
(str,&lx) == FALSE)
+ if (m_pol.
readUserToken
(str,&lx) == FALSE)
break;
if (lx == S_ABOVE)
o_xticks = ABOVE;
break;
if (lx == S_ABOVE)
o_xticks = ABOVE;
@@
-325,16
+325,16
@@
EZPlot::do_cmd (int lx)
else if (lx == S_LABEL)
o_xtlabel = TRUE;
else if (lx == S_MAJOR) {
else if (lx == S_LABEL)
o_xtlabel = TRUE;
else if (lx == S_MAJOR) {
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
if (n > 1 && n < 100)
o_xmajortick = n;
} else if (lx == S_MINOR)
if (n > 1 && n < 100)
o_xmajortick = n;
} else if (lx == S_MINOR)
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
if (n >= 0 && n < 100)
o_xminortick = n;
break;
case S_YTICKS:
if (n >= 0 && n < 100)
o_xminortick = n;
break;
case S_YTICKS:
- if (m_pol.
usertok
(str,&lx) == FALSE)
+ if (m_pol.
readUserToken
(str,&lx) == FALSE)
break;
if (lx == S_RIGHT)
o_yticks = RIGHT;
break;
if (lx == S_RIGHT)
o_yticks = RIGHT;
@@
-345,16
+345,16
@@
EZPlot::do_cmd (int lx)
else if (lx == S_LABEL)
o_ytlabel = TRUE;
else if (lx == S_MAJOR) {
else if (lx == S_LABEL)
o_ytlabel = TRUE;
else if (lx == S_MAJOR) {
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
if (n > 1 && n < 100)
o_ymajortick = n;
} else if (lx == S_MINOR)
if (n > 1 && n < 100)
o_ymajortick = n;
} else if (lx == S_MINOR)
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE)
if (n >= 0 && n < 100)
o_yminortick = n;
break;
case S_LXFRAC:
if (n >= 0 && n < 100)
o_yminortick = n;
break;
case S_LXFRAC:
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
if (n >= 0) {
v_lxfrac = n;
s_lxfrac = TRUE;
if (n >= 0) {
v_lxfrac = n;
s_lxfrac = TRUE;
@@
-363,7
+363,7
@@
EZPlot::do_cmd (int lx)
s_lxfrac = FALSE;
break;
case S_LYFRAC:
s_lxfrac = FALSE;
break;
case S_LYFRAC:
- if (m_pol.
i
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
+ if (m_pol.
readI
nteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) {
if (n >= 0) {
v_lyfrac = n;
s_lyfrac = TRUE;
if (n >= 0) {
v_lyfrac = n;
s_lyfrac = TRUE;
@@
-480,6
+480,5
@@
void
EZPlot::initKeywords ()
{
for (int i = 0; i < NKEYS; i++)
EZPlot::initKeywords ()
{
for (int i = 0; i < NKEYS; i++)
- if (! m_pol.installKeyword (m_sKeywords[i].keyword, m_sKeywords [i].code))
- sys_error (ERR_SEVERE, "error installing ezset keywords [EZPlot::initKeywords]");
+ m_pol.addKeyword (m_sKeywords[i].keyword, m_sKeywords [i].code);
}
}