# view1d.pro

At APS this program is installed in the /usr/local/epics/extensions/bin/$HOST_ARCH directory. This program allows the user to view 1D scan data. This program can be directly accessed by the viewer.

# List of Routines

- BOX_CURSOR
- VIEW1D
- XDISPLAYFILE

# Routine Descriptions

## BOX_CURSOR

[Next Routine] [List of Routines]

     NAME:
    	BOX_CURSOR

     PURPOSE:
    	Emulate the operation of a variable-sized box cursor (also known as
    	a "marquee" selector).

     CATEGORY:
    	Interactive graphics.

     CALLING SEQUENCE:
    	BOX_CURSOR, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]

     INPUTS:
    	No required input parameters.

     OPTIONAL INPUT PARAMETERS:
    	x0, y0, nx, and ny give the initial location (x0, y0) and
    	size (nx, ny) of the box if the keyword INIT is set.  Otherwise, the
    	box is initially drawn in the center of the screen.

     KEYWORD PARAMETERS:
    	INIT:  If this keyword is set, x0, y0, nx, and ny contain the initial
    	parameters for the box.

    	FIXED_SIZE:  If this keyword is set, nx and ny contain the initial
    	size of the box.  This size may not be changed by the user.

    	MESSAGE:  If this keyword is set, print a short message describing
    	operation of the cursor.

     OUTPUTS:
    	x0:  X value of lower left corner of box.
    	y0:  Y value of lower left corner of box.
    	nx:  width of box in pixels.
    	ny:  height of box in pixels.

    	The box is also constrained to lie entirely within the window.

     COMMON BLOCKS:
    	None.

     SIDE EFFECTS:
    	A box is drawn in the currently active window.  It is erased
    	on exit.

     RESTRICTIONS:
    	Works only with window system drivers.

     PROCEDURE:
    	The graphics function is set to 6 for eXclusive OR.  This
    	allows the box to be drawn and erased without disturbing the
    	contents of the window.

    	Operation is as follows:
    	Left mouse button:   Move the box by dragging.
    	Middle mouse button: Resize the box by dragging.  The corner
    		nearest the initial mouse position is moved.
    	Right mouse button:  Exit this procedure, returning the
    			     current box parameters.

     MODIFICATION HISTORY:
    	DMS, April, 1990.
    	DMS, April, 1992.  Made dragging more intutitive.
    	June, 1993 - Bill Thompson
    			prevented the box from having a negative size.
           04-18-96   bkc  Made the box color more visible.
           05-28-98   bkc  Reset bounding box color

(See view1d.pro)

## VIEW1D

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           VIEW1D

     PURPOSE:

           This program is specially written for the data catcher. It
           provides the IDL user a convenient post data acquisition
           1D data display program. It shares the common 1D data file
           with data catcher without interrupting the process of data
           scanning of data catcher.

     CATEGORY:
    	Widgets.

     CALLING SEQUENCE:
    	VIEW1D [,Data='test.dat'] [,Config='test.config'] [,/XDR] [GROUP=Group]

     INPUTS:
    	None

     KEYWORD PARAMETERS:
         CONFIG:   Specifies whether the configuration file to be used in the
                   startup of the VIEW1D.
         DATA:     Specifies the 1D file name to be used for displaying
                   captured 1D scan data. If not specified, the default
                   data file name 'catch1d.trashcan' is assumed.
         XDR:      Indicates whether the data file entered on the command line is
                   in XDR format.
         GROUP:    The widget ID of the group leader of the widget.  If this
                   keyword is specified, the death of the group leader results in
                   the death of VIEW1D.

     OUTPUTS:
           It provides various post acquistion 1D scan displaying features.
           Various levels of report files can be generated by this program.
           All the file generated will be prefixed by the DATA file name.

     COMMON BLOCKS:
           VIEW1D_COM
           W_PLOTSPEC_BLOCK
           W_VIEWSCAN_BLOCK

     SIDE EFFECTS:
           New scan data may be appended at the end of data file if the
           data catcher is runing at the same time and new data
           is detected by the data catcher. Reload the data file will
           let you access the newly captured scan data from the file.

     RESTRICTIONS:

     PROCEDURE:
           The 'os.init' must be loaded into IDL before invoking the
           VIEW1D application.

     EXAMPLE:
           Use default setting for view1d

           	VIEW1D

           Override the default setting by specifying config and data file
           on the command line

           	VIEW1D, CONFIG='test.config', DATA='test.dat'

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, 05-27-97.

           08-01-97  bkc   Add the 2D scan # in the header
           10-16-97  bkc   Upgrade to R1.3
                           Automatic figure out the type of binary data read in
                           only works for IDL 5.0.1 and up
                           Add the support for ez_fit curve fitting package
           01-28-98  bkc   Fix the error in standard deviation calc if max occurs
                           at y(0)
           02-17-98  bkc   If the user entered an existing ASCII file it will be
                           backuped for user
           05-14-98  bkc   Upgrade to R1.4
           11-24-98  bkc   Upgrade to R1.5
                           Accommondate the read problem introdued by too many
                           characters entered in comment fields
           01-12-99  bkc   R1.5a dynamic read in u_read PS_open cw_term sources

(See view1d.pro)

## XDISPLAYFILE

[Previous Routine] [List of Routines]

     NAME:
    	XDISPLAYFILE

     PURPOSE:
    	Display an ASCII text file using widgets and the widget manager.

     CATEGORY:
    	Widgets.

     CALLING SEQUENCE:
    	XDISPLAYFILE, Filename

     INPUTS:
         Filename:	A scalar string that contains the filename of the file
    		to display.  The filename can include a path to that file.

     KEYWORD PARAMETERS:
    	FONT:   The name of the font to use.  If omitted use the default
    		font.
    	GROUP:	The widget ID of the group leader of the widget.  If this
    		keyword is specified, the death of the group leader results in
    		the death of XDISPLAYFILE.

    	HEIGHT:	The number of text lines that the widget should display at one
    		time.  If this keyword is not specified, 24 lines is the
    		default.

    	TEXT:	A string or string array to be displayed in the widget
    		instead of the contents of a file.  This keyword supercedes
    		the FILENAME input parameter.

    	TITLE:	A string to use as the widget title rather than the file name
    		or "XDisplayFile".

    	WIDTH:	The number of characters wide the widget should be.  If this
    		keyword is not specified, 80 characters is the default.

     OUTPUTS:
    	No explicit outputs.  A file viewing widget is created.

     SIDE EFFECTS:
    	Triggers the XMANAGER if it is not already in use.

     RESTRICTIONS:
    	None.

     PROCEDURE:
    	Open a file and create a widget to display its contents.

     MODIFICATION HISTORY:
    	Written By Steve Richards, December 1990
    	Graceful error recovery, DMS, Feb, 1992.
           12 Jan. 1994  - KDB
                   If file was empty, program would crash. Fixed.
           4 Oct. 1994     MLR Fixed bug if /TEXT was present and /TITLE was not.
          14 Jul. 1995     BKC Increased the max line to variable size.
          16 Jun. 1997     BKC Max dispalyable line is 10000 for non-unix OS system.
          28 Aug. 1997     BKC Add the printer button, file name label, it uses the
                           PS_print,file to print.

(See view1d.pro)