X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctgraphics%2Fezset.cpp;h=872d4e95cc5be57eb292baec38208ce807cdc11b;hp=6cc4e94f9b247f8b191152026863d77cff906f53;hb=1a050c98763fbbc0662731b0b76953acede6f5d7;hpb=c8b19dfaffba9f06d8b6c40cb1bb83a8964867f7 diff --git a/libctgraphics/ezset.cpp b/libctgraphics/ezset.cpp index 6cc4e94..872d4e9 100644 --- a/libctgraphics/ezset.cpp +++ b/libctgraphics/ezset.cpp @@ -1,7 +1,7 @@ /***************************************************************************** ** 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 @@ -33,19 +33,19 @@ EZPlot::ezset (const std::string& command) 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; @@ -56,8 +56,8 @@ EZPlot::ezcmd (const char* const comm) } else retval = do_cmd (code); - - m_pol.closefile(); /* close input string file */ + + m_pol.closefile(); /* close input string file */ return (retval); } @@ -69,7 +69,7 @@ EZPlot::do_cmd (int lx) 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) { @@ -187,7 +187,7 @@ EZPlot::do_cmd (int lx) } if (m_iCurrentCurve < 0) o_linestyle = ls; - else + else setLinestyle (m_iCurrentCurve, ls); break; case S_NOLINE: @@ -200,7 +200,7 @@ EZPlot::do_cmd (int lx) if (n >= 0) { if (m_iCurrentCurve < 0) o_color = n; - else + else setColor (m_iCurrentCurve, n); } else bad_option("The color you picked"); @@ -296,7 +296,7 @@ EZPlot::do_cmd (int lx) sym = n; if (m_iCurrentCurve < 0) o_symfreq = sym; - else + else setSymbolFreq (m_iCurrentCurve, sym); } } else if (m_pol.readWord ("none",4) == TRUE) { @@ -309,7 +309,7 @@ EZPlot::do_cmd (int lx) 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; @@ -376,14 +376,14 @@ EZPlot::do_cmd (int lx) fprintf (stderr, "Unimplemented EZPLOT command\n"); break; } - + m_pol.reader (); return (true); } -void +void EZPlot::bad_option (char *opt) { sys_error (ERR_WARNING, "INVALID option: %s", opt); @@ -391,92 +391,92 @@ EZPlot::bad_option (char *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++)