home *** CD-ROM | disk | FTP | other *** search
/ GRIPS 2: Government Rast…rocessing Software & Data / GRIPS_2.cdr / dos / imdisp / source / help.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-08  |  16.6 KB  |  340 lines

  1. /*************************************************************/
  2. /*  Copyright (C) 1989, California Institute of Technology   */
  3. /*  U. S. Government Sponsorship under NASA Contract         */
  4. /*  NAS7-918 is acknowledged.                                */
  5. /*************************************************************/
  6.  
  7. /***  IMDISP module HELP.C
  8.  
  9.     HELP.C contains the command which services help requests from
  10.     the IMDISP main menu.  All help text for new commands goes here.
  11.  
  12. ***/
  13.  
  14. /* * * * INCLUDE files * * * */
  15.  
  16. #include <stdio.h>
  17. #include <conio.h>
  18. #include "imdef.h"
  19. #include "imdisp.h"
  20. #include "dispio.h"
  21. #include "disputil.h"
  22. #include "labutil.h"
  23.  
  24. /* * * * External functions * * * */
  25.  
  26. /* * * * Function declarations * * * */
  27.  
  28. int GiveHelp (void);
  29.  
  30. /* * * * Global Variables * * * */
  31.  
  32.  
  33.  
  34. int GiveHelp (void)
  35. {
  36.     int  command;
  37.  
  38.  
  39.     if (OneScreen)
  40.     {
  41.         ClearDisplay (0);
  42.         TextLine = TextHeight + 5;   TextSample = 1;
  43.     }
  44.  
  45.     command = GetCommand (&CommandString[4],
  46.     "FIL DIS ERA SET HIS PAL STR CUR PRO REF SAV BAT MEN LAB TEX BRO OVE CD DIR TYP SYS PLO SER PRI NEG");
  47.  
  48.     switch (command)
  49.     {
  50.     case 0 :
  51.           WriteText ("The following commands are available :");
  52.           WriteText ("BATch        . . . .  to execute a batch command file");
  53.           WriteText ("BROwse       . . . .  to display multiple files");
  54.           WriteText ("CD           . . . .  MSDOS change directory command");
  55.           WriteText ("CURsor       . . . .  to move the cursor around");
  56.           WriteText ("DIR          . . . .  MSDOS directory command");
  57.           WriteText ("DISplay      . . . .  to display the image");
  58.           WriteText ("ERAse        . . . .  to erase the display");
  59.           WriteText ("EXIt or QUIt . . . .  to exit from the program");
  60.           WriteText ("FILe         . . . .  to specify the name of the image");
  61.       if (dispnl < 300)
  62.        {
  63.            WriteText ("Press any key to continue>>");
  64.            getch();
  65.            ClearDisplay (0);
  66.            TextLine = TextHeight + 5;   TextSample = 1;
  67.        }
  68.            WriteText ("HIStogram    . . . .  to display the histogram of the image");
  69.            WriteText ("LABel        . . . .  to show image label");
  70.            WriteText ("MENu         . . . .  to invoke menu list");
  71.            WriteText ("NEGative     . . . .  to photo negative the image");
  72.            WriteText ("OVErlay      . . . .  to draw grid lines on image");
  73.            if (dispnl > 300 && dispnl < 400)
  74.            {
  75.                WriteText ("Press any key to continue>>");
  76.                getch();
  77.                ClearDisplay (0);
  78.                TextLine = TextHeight + 5;   TextSample = 1;
  79.            }
  80.  
  81.            WriteText ("PALette      . . . .  to adjust the palette for the display");
  82.            WriteText ("PLOt         . . . .  to display and plot spectral data");
  83. /*
  84.            WriteText ("PRInt        . . . .  to print out the image");
  85. */
  86.            WriteText ("PROfile      . . . .  to plot a profile of the image");
  87.            WriteText ("REFresh      . . . .  to refresh the image plane");
  88.            WriteText ("SAVe         . . . .  to save the image display to a file");
  89.            if (dispnl < 300)
  90.            {
  91.                WriteText ("Press any key to continue>>");
  92.                getch() ;
  93.                ClearDisplay (0);
  94.                TextLine = TextHeight + 5;   TextSample = 1;
  95.            }
  96.  
  97. /*
  98.            WriteText ("SERial       . . . .  to send commands to the serial port");
  99. */
  100.            WriteText ("SET          . . . .  to set display options");
  101.            WriteText ("STRetch      . . . .  to do a linear gray scale stretch");
  102.            WriteText ("SYStem       . . . .  to execute MSDOS commands");
  103.            WriteText ("TEXt         . . . .  to place text on screen");
  104.            WriteText ("TYPe         . . . .  MSDOS type command");
  105.            WriteText (" ");
  106.  
  107.            if (dispnl < 600)
  108.            {
  109.                WriteText ("Press any key to continue>>");
  110.                getch();
  111.                ClearDisplay (0);
  112.                TextLine = TextHeight + 5;   TextSample = 1;
  113.            }
  114.  
  115.            WriteText ("Only the capitalized letters are required for the command.");
  116.            WriteText ("The commands take optional keywords and values.");
  117.            WriteText ("   The syntax is: COMMAND  KEY1=VAL1  KEY2 VAL2  . . .");
  118.            WriteText ("Type 'HELP command' for help on a particular command.");
  119.            break;
  120.      case 1 :
  121.            WriteText ("FILE takes a required string value, i.e. the file name");
  122.            WriteText ("FILE without filename enters file prompt mode");
  123.            WriteText ("FILE with a filename mask enters file prompt mode with");
  124.            WriteText ("     only the matching filenames");
  125.            break;
  126.      case 2 :
  127.            WriteText ("DISPlay takes the following keywords :");
  128.            WriteText (" ");
  129.            WriteText ("SUBsample    a positive integral subsampling factor");
  130.            WriteText ("ZOOm         a positive integral zoom factor");
  131.            WriteText ("CENter       to display area around cursor");
  132.            WriteText ("NL NS        number of lines and samples to display in image");
  133.            WriteText ("SL SS        starting line and sample in image");
  134.            WriteText ("LEFT RIGHT   move starting sample left or right from previous");
  135.            WriteText ("UP DOWN      move starting line up or down from previous");
  136.            WriteText ("DSL DSS      starting line and sample on display");
  137.            WriteText ("FLIp         flips the image top-to-bottom");
  138.            break;
  139.      case 3 :
  140.            WriteText ("ERAse takes no parameters");
  141.            break;
  142.      case 4 :
  143.            WriteText ("SET takes the following keywords :");
  144.            WriteText (" ");
  145.            WriteText ("DNLOw  DNHIgh   the DN range to compress into display pixel");
  146.            WriteText ("                Use no parameters to see the current values");
  147.            WriteText ("BROwse fname    sets the default filename for use with BROWSE");
  148.            WriteText ("SELect fname    sets default filename for use with BROWSE SELECT");
  149.            WriteText ("NS = n          sets the number of samples/line for display");
  150.            WriteText ("SWAP            swaps bytes when reading the image (>8 bits)");
  151.            WriteText ("UNSWAP          resets SWAP, so bytes aren't swapped");
  152.       if (dispnl < 300)
  153.        {
  154.            WriteText ("Press any key to continue>>");
  155.            getch();
  156.            ClearDisplay (0);
  157.            TextLine = TextHeight + 5;   TextSample = 1;
  158.        }
  159.            WriteText ("DISplay vname   changes the display type to the one specified.");
  160.            WriteText ("                Standard graphics modes supported:");
  161.            WriteText ("                  CGA     (640x200x2)    EGA     (640x350x16)");
  162.            WriteText ("                  EGA480  (640x480x16)   VGA320  (320x200x256)");
  163.            WriteText ("                  VGA     (640x480x16)");
  164.       if (dispnl < 400)
  165.        {
  166.            WriteText ("Press any key to continue>>");
  167.            getch();
  168.            ClearDisplay (0);
  169.            TextLine = TextHeight + 5;   TextSample = 1;
  170.        }
  171.            WriteText ("                Super VGA supported for the following:");
  172.            WriteText ("                 ATI640      (640x480x256) - ATI VGA Wonder Board");
  173.            WriteText ("                 ATI800      (800x600x256) - ATI VGA Wonder Board");
  174.            WriteText ("                 ATI1024     (1024x768x16) - ATI VGA Wonder Board");
  175.            WriteText ("                 EVGA512     (512x480x256) - Everex Board");
  176.            WriteText ("                 EVGA640     (640x480x256) - Everex Board");
  177.            WriteText ("                 ORCHID      (640x480x256) - Orchid Board");
  178.            WriteText ("                 ORCHID800   (800x600x256) - Orchid Board");
  179.            WriteText ("                 ORCHID1024 (1024x768x256) - Orchid Board");
  180.            WriteText ("                 PARADISE    (640x400x256) - Paradise Board 256K");
  181.            WriteText ("                             (640x480x256) - Paradise Board 512K");
  182.            WriteText ("                 PGA         (640x480x256) - PGA Board");
  183.            WriteText (" Use the DOS SET command before starting IMDISP to set the default");
  184.            WriteText (" display type. EG: SET IMDISP=VGA will start up in VGA mode.");
  185.  
  186.            break;
  187.      case 5 :
  188.            WriteText ("HISTogram takes the following keywords :");
  189.            WriteText (" ");
  190.            WriteText ("SUBsample    a integral subsample factor for speed");
  191.            WriteText ("NL NS        number of lines and samples from image");
  192.            WriteText ("SL SS        starting line and sample in image");
  193.            WriteText ("CENter       do histogram on displayed portion of image");
  194.            WriteText ("VOY          Use histogram from standard PDS Voyager image");
  195.            WriteText ("VIK          Use histogram from standard PDS Viking image");
  196.            WriteText ("COL          draw histogram using current color settings");
  197.            break;
  198.      case 6 :
  199.            WriteText ("PALette takes the following keywords :");
  200.            WriteText (" ");
  201.            WriteText ("EDIt = n    to interactively adjust n color palette");
  202.            WriteText ("            using the arrow keys on numeric keypad:");
  203.            WriteText ("     left(4) and right(6) move to different palette color,");
  204.            WriteText ("     ^left and ^right move to colors in larger steps,");
  205.            WriteText ("     HOME and END move to the beginning/end colors,");
  206.            WriteText ("     up(2), down(8) to increment/decrement all colors,");
  207.            WriteText ("     letters R, r, G, g, B, b to incr/decr the color, ");
  208.            WriteText ("     invert the palette with x or X, scroll with S or s, ");
  209.            WriteText ("     and . or carriage return to end.");
  210.            WriteText ("PSeudo color    PS = 0  for default palette");
  211.            WriteText ("                PS = 1  for gray scale palette");
  212.            WriteText ("                PS = 2  IBM EGA palette");
  213.            WriteText ("                PS = 3  Redorange  PS = 4 Prism");
  214.            WriteText ("                PS = 5  Topo       PS = 6 Contour");
  215.            WriteText ("                PS = 7  BGRY       PS = 8 Glasses1");
  216.            WriteText ("                PS = 9  Glasses2");
  217.            WriteText ("SAVe = file     saves palette in text file");
  218.            WriteText ("LOAd = file     loads palette from file");
  219.            WriteText ("DISplay         displays the current palette on the screen");
  220.            WriteText ("ERAse           erases the current palette from the screen");
  221.            break;
  222.      case 7 :
  223.            WriteText ("STREtch takes the following keywords :");
  224.            WriteText (" ");
  225.            WriteText ("LOw, HIgh     the low and high DN values of the stretch");
  226.            WriteText ("  e.g.  STRET HI=128     for a stretch between 0 and 128");
  227.            break;
  228.      case 8 :
  229.            WriteText ("CURSor takes no parameters");
  230.            WriteText ("Use the numeric keypad to move the cursor around,");
  231.            WriteText (" '-' and '+' to change the cursor step size, ");
  232.            WriteText (" and '.' or carriage return to end.");
  233.            break;
  234.      case 9 :
  235.           WriteText ("PROFile takes no parameters");
  236.           WriteText ("Move the cursor around as in cursor command");
  237.           WriteText (" '.' or carriage return to select the first and second points");
  238.           break;
  239.     case 10 :
  240.           WriteText ("REFResh takes no parameters");
  241.           WriteText ("Redisplays the images from the refresh buffer");
  242.           WriteText ("and erases any graphics currently on the screen.");
  243.           break;
  244.     case 11 :
  245.           WriteText ("SAVe takes the following keywords :");
  246.           WriteText (" ");
  247.           WriteText ("filename     filename of image to save.");
  248.           WriteText ("NL NS        number of lines and samples to save");
  249.           WriteText ("SL SS        starting line and sample to save");
  250.           WriteText ("BP           number of bits per pixel in output image");
  251.           break;
  252.     case 12 :
  253.           WriteText ("BATch takes the following keywords :");
  254.           WriteText (" ");
  255.           WriteText ("filename     filename of batch command file");
  256.           break;
  257.     case 13 :
  258.           WriteText ("MENu takes the following keywords :");
  259.           WriteText (" ");
  260.           WriteText ("filename     filename of menu list file");
  261.           break;
  262.     case 14 :
  263.           WriteText ("LABel prints the label for the current PDS or FITS");
  264.           WriteText ("format image.");
  265.           break;
  266.     case 15 :
  267.           WriteText ("TEXt takes the following format :");
  268.           WriteText (" ");
  269.           WriteText ("LINe         line number to position text at");
  270.           WriteText ("SAMple       sample number to position text at");
  271.           WriteText ("TEXT         'text to type out on screen' <cr>");
  272.           break;
  273.     case 16 :
  274.           WriteText ("BROwse takes the following keywords :");
  275.           WriteText (" ");
  276.           WriteText ("mask         a wildcard (ie. *.IMG) to select files to browse");
  277.           WriteText ("SIZE         the size to use for displaying multiple images");
  278.           WriteText ("SUB          a subsampling factor to use to display images");
  279.           WriteText ("             ie. 'SUB 2' scales the image to half size");
  280.           WriteText ("NOLabel      do not put the filename label on displayed images");
  281.           WriteText ("DNLow DNHigh sets the DN range for all images (see SET)");
  282.           WriteText ("PAUse        pauses display when the screen gets full");
  283.           WriteText ("ALL          searches all subdirectories in addition to");
  284.           WriteText ("             the current directory");
  285.           WriteText ("SELect       interactively selects files as they are being");
  286.           WriteText ("             displayed and writes the filenames out to a");
  287.           WriteText ("             select file");
  288.           WriteText ("FILe fname   select files to browse from a file instead of");
  289.           WriteText ("             using a mask");
  290.  
  291.           break;
  292.     case 17 :
  293.           WriteText ("OVErlay takes the following keywords :");
  294.           WriteText (" ");
  295.           WriteText ("MAXLAT       the upper left latitude of the current image");
  296.           WriteText ("MAXLON       the upper left longitude of the current image");
  297.           WriteText ("LEGend       draw a legend with the current color assignments");
  298.           WriteText ("DN           the dn value to use for drawing grid lines");
  299.           break;
  300.     case 18 : case 19 : case 20 : case 21 : 
  301.           WriteText ("The following MSDOS commands are supported:");
  302.           WriteText (" ");
  303.           WriteText ("drive letter:  Change default drive to specified letter");
  304.           WriteText ("CD    path     MSDOS change directory command");
  305.           WriteText ("DIR   mask     MSDOS directory command");
  306.           WriteText ("TYPe  filename MSDOS type command");
  307.           WriteText ("SYStem         Spawns an MSDOS process");
  308.           break;
  309.     case 22:
  310.           WriteText("PLOt takes the following keywords :");
  311.           WriteText (" ");
  312.           WriteText ("LIN n    plot line n of the image (2-D file only)");
  313.           WriteText ("SYMbol x draw the plot using character x instead of a line");
  314.           WriteText ("ZOOm     prompt user to zoom the plot");
  315.           WriteText ("OVErlay  overplot - do not erase the current plot");
  316.           WriteText ("CENter   plot the image line containing the cursor");
  317.           WriteText ("MAX n    set the maximum value in the plot");
  318.           WriteText ("MIN n    set the minimum value in the plot");
  319.           WriteText ("COLor n  use DN value n to plot the data");
  320.           break;
  321.     case 23 :
  322.           WriteText ("SERial takes the following keywords :");
  323.           WriteText (" ");
  324.           WriteText ("INIt               initialize the serial port");
  325.           WriteText ("COM  n             set COMn as the serial port to use");
  326.           WriteText ("BAUd n             set the baud rate to n");
  327.           WriteText ("COMmand 'string'   write 'string' out the serial port");
  328.           break;
  329.     case 24 :
  330.           WriteText ("PRInt takes the following keyword :");
  331.           WriteText (" ");
  332.           WriteText ("TEK4693      use the Tektronix 4693DX driver");
  333.           break;
  334.     case 25 :
  335.           WriteText ("NEGative takes no parameters");
  336.           break;
  337.     }
  338.     WriteText (" ");
  339. }
  340.