X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tools%2Fif-2.cpp;h=dfea498540fc2f028aa11b05ce2ed8d00babe943;hb=d158a6da6ec776fe98961f73f2ea74cf55de4700;hp=2558360f32341352d12a4ab612fbc93ae4405d76;hpb=711cae0ee02e046370fdb4d6c6f440596ff71980;p=ctsim.git diff --git a/tools/if-2.cpp b/tools/if-2.cpp index 2558360..dfea498 100644 --- a/tools/if-2.cpp +++ b/tools/if-2.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if-2.cpp,v 1.2 2000/07/28 08:28:08 kevin Exp $ +** $Id: if-2.cpp,v 1.5 2000/08/03 09:57:29 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 @@ -45,6 +45,8 @@ static struct option my_options[] = {0, 0, 0, 0} }; +static const char* g_szIdStr = "$Id: if-2.cpp,v 1.5 2000/08/03 09:57:29 kevin Exp $"; + void if2_usage (const char *program) { @@ -79,7 +81,7 @@ if2_main (int argc, char *const argv[]) int opt_sub = 0; int opt_mul = 0; int opt_comp = 0; - int opt_outputFile = 0; + bool opt_outputFile = false; int opt_rowPlot = -1; int opt_columnPlot = -1; Timer timerProgram; @@ -94,26 +96,28 @@ if2_main (int argc, char *const argv[]) switch (c) { case O_ADD: opt_add = 1; - opt_outputFile = 1; + opt_outputFile = true; break; case O_SUB : opt_sub = 1; - opt_outputFile = 1; + opt_outputFile = true; break; case O_MUL: opt_mul = 1; - opt_outputFile = 1; + opt_outputFile = true; break; case O_ROW_PLOT: opt_rowPlot = strtol(optarg, &endptr, 10); if (endptr != optarg + strlen(optarg)) { if2_usage(argv[0]); } + break; case O_COLUMN_PLOT: opt_columnPlot = strtol(optarg, &endptr, 10); if (endptr != optarg + strlen(optarg)) { if2_usage(argv[0]); } + break; case O_COMP: opt_comp = 1; break; @@ -122,7 +126,7 @@ if2_main (int argc, char *const argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl; + cout << "Version " << VERSION << endl << g_szIdStr << endl; #else cout << "Unknown version number" << endl; #endif @@ -231,15 +235,16 @@ if2_main (int argc, char *const argv[]) SGPDriver driver ("Column Plot"); SGP sgp (driver); EZPlot ezplot (sgp); - ezplot.ezset ("clear."); - ezplot.ezset ("xticks major 5."); - ezplot.ezset ("xlabel Column"); - ezplot.ezset ("ylabel Pixel"); - ezplot.ezset ("curves 2"); - ezplot.ezset ("box."); - ezplot.ezset ("grid."); - ezplot.addCurve (v1[opt_columnPlot], plot_xaxis, im_in1.ny()); - ezplot.addCurve (v2[opt_columnPlot], plot_xaxis, im_in2.ny()); + ezplot.ezset ("clear."); + ezplot.ezset ("xticks major 5."); + ezplot.ezset ("xlabel Column"); + ezplot.ezset ("title Column Plot"); + ezplot.ezset ("ylabel Pixel"); + ezplot.ezset ("box."); + ezplot.ezset ("grid."); + ezplot.addCurve (plot_xaxis, v1[opt_columnPlot], im_in1.ny()); + ezplot.addCurve (plot_xaxis, v2[opt_columnPlot], im_in2.ny()); + ezplot.plot(); cout << "Press enter to continue" << flush; cio_kb_getc(); #endif @@ -256,23 +261,24 @@ if2_main (int argc, char *const argv[]) for (int i = 0; i < ny; i++) plot_xaxis[i] = i; for (int i = 0; i < nx; i++) - v1Row[i] = v1[opt_rowPlot][i]; + v1Row[i] = v1[i][opt_rowPlot]; for (int i = 0; i < nx2; i++) - v2Row[i] = v2[opt_rowPlot][i]; + v2Row[i] = v2[i][opt_rowPlot]; #if HAVE_SGP - SGPDriver driver ("Column Plot"); + SGPDriver driver ("Row Plot"); SGP sgp (driver); EZPlot ezplot (sgp); - ezplot.ezset ("clear."); - ezplot.ezset ("xticks major 5."); - ezplot.ezset ("xlabel Column"); - ezplot.ezset ("ylabel Pixel"); - ezplot.ezset ("curves 2"); - ezplot.ezset ("box."); - ezplot.ezset ("grid."); - ezplot.addCurve (v1Row, plot_xaxis, im_in1.nx()); - ezplot.addCurve (v2Row, plot_xaxis, im_in2.nx()); + ezplot.ezset ("clear."); + ezplot.ezset ("xticks major 5."); + ezplot.ezset ("title Row Plot"); + ezplot.ezset ("xlabel Row"); + ezplot.ezset ("ylabel Pixel"); + ezplot.ezset ("box."); + ezplot.ezset ("grid."); + ezplot.addCurve (plot_xaxis, v1Row, im_in1.nx()); + ezplot.addCurve (plot_xaxis, v2Row, im_in2.nx()); + ezplot.plot(); cout << "Press enter to continue" << flush; cio_kb_getc(); #endif