X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctgraphics%2Fezset.cpp;h=4e68671507c01eb752204459930e1340460931ac;hb=75a3edd6e6a5c16aea583771dfd1924c7aee9103;hp=c28c76180ac131390c8da4c2b9e875671e772d28;hpb=c85a5b31119b4e0903144c55441717a7ad1e0b8b;p=ctsim.git diff --git a/libctgraphics/ezset.cpp b/libctgraphics/ezset.cpp index c28c761..4e68671 100644 --- 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 ** - ** $Id: ezset.cpp,v 1.6 2000/07/28 10:51:31 kevin Exp $ + ** $Id: ezset.cpp,v 1.9 2000/12/06 15:17:51 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 @@ -62,7 +62,7 @@ EZPlot::ezcmd (char *comm) int code; bool retval = true; if (! pol_usertok (str, &code)) { - cerr << "Illegal EZSET command: " << str << endl; + sys_error(ERR_WARNING, "Illegal EZSET command: %s", str); pol_reader(); retval = false; } @@ -74,7 +74,7 @@ EZPlot::ezcmd (char *comm) } -int +bool EZPlot::do_cmd (int lx) { char str [1024]; @@ -284,38 +284,12 @@ EZPlot::do_cmd (int lx) s_ylegend = FALSE; } break; - case S_CURVES: - if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) { - if (n < 1) - n = 1; - // if (modeinteract == TRUE) { - // curveinteract = n - 1; - // if (o_unknowncurves == FALSE && o_reqcurves < n) - // o_reqcurves = n; - // } else { - // clearCurve (); - // o_reqcurves = n; - // } - } else { - // if (pol_word ("unknown", 7) == TRUE) - // o_unknowncurves = TRUE; - // else if (pol_word ("end", 3) == TRUE) { - // o_unknowncurves = FALSE; - // o_reqcurves = i_numcurves; - // i_plotimmediate = TRUE; - // ezplot (static_cast(NULL), static_cast(NULL), 0); - // i_plotimmediate = FALSE; - // } - } - break; case S_SYMBOL: if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) { if (n > 0 && n <= MAXSYMBOL) o_symbol = n; else o_symbol = 1; - // if (modeinteract == TRUE && curveinteract >= 0) - // curve[curveinteract].symbol = o_symbol; } else { if (pol_word("every",5) == TRUE) { if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) { @@ -323,13 +297,9 @@ EZPlot::do_cmd (int lx) o_symfreq = n; else o_symfreq = 1; - // if (modeinteract == TRUE && curveinteract >= 0) - // curve[curveinteract].symfreq = o_symfreq; } } else if (pol_word ("none",4) == TRUE) { o_symbol = -1; - // if (modeinteract == TRUE && curveinteract >= 0) - // curve[curveinteract].symbol = o_symbol; } } break; @@ -398,7 +368,7 @@ EZPlot::do_cmd (int lx) } pol_reader (); - return (TRUE); + return (true); } @@ -406,7 +376,7 @@ EZPlot::do_cmd (int lx) void EZPlot::bad_option (char *opt) { - cerr << opt << " is an INVALID option\n"; + sys_error (ERR_WARNING, "INVALID option: %s", opt); } /*----------------------------------------------------------------------*/ @@ -417,23 +387,17 @@ static struct key { char *keyword; int code; } keytab[] = { - {"solid", S_SOLID}, - {"dash", S_DASH}, - {"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, */ - - {"curves", S_CURVES}, - {"curve", S_CURVES}, - /* "unknown", S_UNKNOWN, */ - /* "end", S_END, */ - + {"solid", S_SOLID}, + {"dash", S_DASH}, + {"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}, @@ -479,7 +443,6 @@ static struct key { {"store", S_STORE}, {"restore", S_RESTORE}, {"amark", S_AMARK}, - {"interactive", S_INTERACTIVE}, {"units", S_UNITS}, {"inches", S_INCHES}, {"user", S_USER}, @@ -508,6 +471,6 @@ void EZPlot::initkw(void) { for (unsigned int i = 0; i < NKEYS; i++) - if (pol_install(keytab[i].keyword, keytab[i].code) == FALSE) + if (! pol_install(keytab[i].keyword, keytab[i].code)) sys_error(ERR_SEVERE, "error installing ezset keywords [initkw]"); }