PGPLOT Replacement

The existing PGPLOT program family runs on the MODCOMP Central Computer and provides a graphic plot of various different datasets on a TekTronix display termal (or a TekTronix terminal emulator in some instances). To date, the PGPLOT replacement program is capable of producing the following plots:  PLTDSP, PLTPRS, PLTTMP and most of the PLTVIB plots.

pgPlot is capable of operating in full color, significantly enhancing the readability of the plots being displayed. It still retains the capability for different line styles (solid, dots, dashes, etc) as well and styles and colors may be combined to further enhance visibility. pgPlot also has the ability to both print the plots (in color or B&W, with or without line styles) and to save exact copies of a plot while it is being viewed (to BMP, JPG or PNG file format).

All twelve of the function keys of a standard PC keyboard may be assigned to activate specific plots or pgPlot commands (like PRINT). In addition, ALL of the combinations of control, alt, and shift with the twelve function keys may also be assigned, allowing a total of 96 different programmable key combinations. The program is designed such that the key assignments may be different for each machine and/or control room.

While the basic layout of each of the plots is predefined, pgPlot is very configurable for many of the particular details, especially those details which were unavailable in the TekTronix version, such as line color, style, and thickness, typefaces for text, etc.

pgPlot may also be configured to activate (that means execute or switch to) an external program, such as a terminal emulator where commands could be entered to the central computer. The external program activation is one of the many pgPlot commands that may be assigned to a function key, making terminal activation a snap!

pgPlot Support Files

The configuration data for pgPlot is stored in four different files (all located in the PICS Config folder). Each file contains a different type of configuration information and in general, the files should not be edited manually. However, because some users might want to fine tune some of the settings available, the files are documented and you may view each file's documentation by following the links below.

File Name Content Description
pgPlot.ini All configuration and settings that are not included in one of the more specific files that follow.
pgPlot.keys Function Key Assignments
pgPlot.points Data Set Definitions
pgPlot.wp Window Position

pgPlot Screen Shots

The easiest way to describe the capabilities of pgPlot and how to use them is to show images of all of the control dialogs and describe what the settings in each dialog mean, how they interact, etc. Dialogs that include an "Apply" button offer the option of trying out new settings without closing the dialog. This allows you to try out a number of different settings before closing the dialog. One word of caution: the "Apply" button is similar to pressing the "OK" button and having the sample dialog panel automatically redisplayed. In other words, once applied, settings cannot be cancelled using the "Cancel" button. Pressing "Cancel" only affects the changes that have not yet been applied, which is the standard from the Windows User Interface Guidelines.


The chooser dialog allows selection of a plot from all of those available using a set of hierarchical choices. At times, some of the options may be disabled (grayed-out) to indicate that there is no plot available for that particular selection. The names in parenthesis inside the "Type of Plot" box are the original names of the programs ran on the MODCOMP system to produce these plots. They were include to help users that were familiar with that system start using this one.


The Colors tab in the Preferences dialog allows you to specify each of the colors that are used by pgPlot on all of the different plots. pgPlot maintains three distinct color sets, one for the screen (or display), one for a color printer and one for a black & white printer. The set being edited is show (and changed) in the "Current Color Set" control. The buttons in the "Copy this color set" box contains a set of buttons that allow you to copy the current set from or to either of the other sets. The "Color Sample" control uses the current color set's Background color to show an example of what the selected color would look like as text (using the current title font) and as lines (the surrounding box). Clicking on the sample itself or on the "Change" button displays the standard Windows Color selection dialog (shown below). Clicking on the "Defaults" button will display a confirmation dialog to remind you that ALL of the colors will be reset to the defaults, even all of the data tracks. If you click OK to confirm, then the developer's favorite colors will be selected for the current color set.


pgPlot is capable of executing an external command on demand. This dialog is where you define the command to be executed (except for the key that triggers it, which is done by assigning a function key (or key combination, see pgPlot.keys) to the "!EXEC" command). Most of the fields in this panel should be familiar, at least to anyone who has looked at a Windows Shortcut before. The last two fields are used by pgPlot to determine if the external application is already running. If the external program is a Windows application, you should specify the Window Class that the program's main window registeres (I use the Spy++ program that came with Microsoft Visual C, but there are many free/share/payware programs that will also work, to locate the Window Class). If the external app is a command line program or 16-bit DOS program, you should create a command (or batch) file to run your program, and configure pgPlot to have a command shel lrun your command file. Inside the command file you can set the window's title to the value that you put here for "Window Title." For example, to run the 16-bit DOS program MYPROG from the directory C:\MYDIR, you could create a command file like this:

@echo off
c:
cd \MYDIR
title MyProg
MYPROG
exit

To have pgPlot use a command shell to run this command file (which we assume is named MYCF.CMD and is available in the current path), use these values for the fields:

If your program requires a command line, you may put something in that field, otherwise it may be blank. The next two dialogs show what you will see if you press the elipses button beside the program name or execution path. In both of these dialogs you will need to select a file in order for pgPlot to recognize your selection -- even to select the execution path. (This will be corrected in a later version of pgPlot that is able to use the COM dialogs for path selection.)


pgPlot only uses four different fonts across the various plots. The use for each font is named in the list near the top left of the panel. The two samples show how the font will look horizontally and also vertically (used for some edge labels and legends). Labels written vertically may have the entire label rotated 90 degrees or may have the letters written in their normal orientation, but 'stacked' (as shown in the image above). The "Rotate Vertical Titles" control determines which behavior is desired, clicking it will immediately update the sample to show it using the other method. Pressing the "Change" button allows you to adjust some of the font's primary control settings or to select a new font entirely (see the "Font Tweak" panel, described next). The "Default" button will ask you to confirm that you want to reset ALL fonts to the defaults (i.e. the developer's favorites).


The font tweaker has controls that allow you to "morph" a standard font into some non-standard configurations by 'tweaking' some of the font's fundamental attributes. The best way to learn how the settings affect a font is to play with the controls in the dialog and watch how the samples change as you change the controls (the samples are updated immediately as you adjust the controls).

The farther the "height" setting is from zero, the larger the font (the sign tells Windows if the size is in points or pixels). The "width" setting uses the standard default when it is zero, a value of one causes the letters in the font to be as narrow as possible and larger numbers continue to increase the width of the letters in the font. The "Weight" setting controls any additional 'thickness' (e.g. normal, bold, extra bold, etc.) that might be added to the font. "Italic," "Underline," and "Strikeout" turn on or off those attributes.

The "New Font" button brings up the standard Windows Font selection dialog box allowing you to choose any other font from those installed on your system. After you choose the 'base' font, you will be returned to pgPlot's Font Tweak dialog for further refinement, if any.

Pressing "OK" in the Font Tweak dialog will copy the new settings to the Preferences|Font panel (pressing OK or Apply there will cause pgPlot to start using the new font). Pressing "Cancel" will return you to the Preferences|Font panel without making any changes.


The first Miscellaneous tab in the preferences dialog allows you to set the following:

Setting Description Possible Values
Start Page The initial plot to display when the program starts. Select a function key binding from the drop-list.
Timing Intervals The rates at which various things happen in the program.  
Tick Rate The rate (in seconds) that live data is sampled for plotting. integers
History Ticks The number of live data samples between history samples integers
Sum Ticks The number of live data samples between summation samples integers
  for example: In the image above, live data is sampled (and plots are updated) every 5 seconds. A history sample will be taken every 12th live data sample, or every 60 (12 x 5) seconds. Sums will be computed every time a live data sample is taken, or every 5 seconds.
History Control The Delta Pressure and Pressure plots may include history plots as well. History plots are plots from previous time increments that show how the plot has been changing over time.  
Show History Determines whether or not any history is shown anywhere. checked/unchecked
Delta History If history is being shown, determines if delta pressure plots should show history. checked/unchecked
Pressure History If history is being shown, determines if pressure plots should show history. checked/unchecked
Plot Offset Sets the offset for history points relative to their true plot position. This can be used to make history visible when the data doesn't change. When the offsets are zero, unchanging data will have the history plotted directly beneath the current plot, rendering it effectively invisible. integers
Date/Time Format Choose how the date and/or time is formatted for display. As shown in the dialog.


The second Miscellaneous tab in the preferences dialog allows you to set the following:

Setting Description Possible Values
Use Cosmetic Pens Determines whether or not pgPlot uses "cosmetic" or "geometric" pens for drawing lines on the display. When using cosmetic pens, line thickness is limited to one pixel, but they are designed to look good (and render fast) on a display. When using geometric pens, line thickness is not limited, but they render much slower and don't always look as nice on a display. (Geometric pens are good for printing, see the "Print" tab, below) checked/unchecked
Line Pattern Parts pgPlot allows you to choose a variety of line styles in addition to 'solid.' The additional styles are combinations of dots, dashes, and spaces (or gaps) between the first two. These settings allow you to control the actual size of each of the three parts of the line styles.  
Dash The length (in pixels) of a dash. integers
Dot The length (in pixels) of a dot. integers
Space The length (in pixels) of the gap between dots and/or dashes. integers
Debug Settings The ability to capture a current plot image and save it to a JPG or PNG file is a relatively new capability for pgPlot. If problems are encountered, active the appropriate debug log, try again, and send the log and the image file (if any) to support for analysis.  
Log JPG saves Logs details of the steps performed while capturing a plot and saving it using the JPG (Joint Photographic Experts Group, a.k.a. JPEG) image format. checked/unchecked
Log PNG saves Logs details of the steps performed while capturing a plot and saving it using the PNG (Portable Network Graphic) image format. checked/unchecked


The "Plots" panel begins with a list of the types of plot that pgPlot knows how to generate. Choose the plot you wish to adjust from the list, then use the remaining fields to alter the settings for that particular plot.

The first two fields, "Maximum" and "Minimum" set the high and low bounds for the vertical scale. Generally, these should be set to maximize the use of the vertical space by the plot, based on the actual range of the plotted data. For example, if the largest value plotted is 9.837 and the smallest value plotted is -2.375, using 10.0 for the max and -4.0 for the min might be good choices. Carefully selecting the max/min values makes the next group of settings a little easier to use.

The tick settings control both visible tick marks and scale labels (placed at major tick marks). The "Major Tick Every" field determines how often a label will be placed on the scale. The "First Tick Value" determines the smallest (or lowest) major tick on the scale and need not match the scale's minimum value. The "Minor Tick Every" field determines how often a minor tick will be placed between the majors. For aesthetic reasons, it is good for the major tick value to be evenly divisble by the minor, otherwise the final minor tick will be closer to the next major tick than any of the others are from each other or the previous major.

The "Bad Value Location" field determines the pseudo-value used for points whose value is not (or cannot) be known. The default setting of 1% places bad values just above the baseline of a plot, regardless of the max/min settings for the scale. You may also omit the percent sign and specify an exact value to plot, but an exact value's location will vary with changes to max/min. The "Actial Value" shown beneath the field is the exact value that pgPlot will be plotting. It is computed from the percentage (or copied from the value) entered in the field.


The "Print" tab has settings for both color and black&white printers, as well as some settings that are common to both. pgPlot determines the type of printer being used by asking Windows at the time a plot is sent to a specific printer.

The "Print in Black&White" and "Print in Color (grayscale)" options cause pgPlot to use the opposite setting group for the printer type with the option selected. Generally, this would be used generate draft output to test with (or to conserve color ink/toner),

When "Disable Line Patterns" is checked, all lines on a color printout will be solid lines, even if they are patterned lines on the display. This option is not available on black&white printers because using patterned lines is generally the only way to distinguish them on a b&w printout.

"Thicken Lines" causes pgPlot to add 5 pixels (configurable as "Print Width Adjust" in the [Settings] section of the pgPlot.ini file) to the line width on the printout. This can be very helpful on high resolution printers (such as laser printers) where single pixel lines are so thin that they are nearly invisible. Note that using cosmetic pens for printing is an option, but is not recommended. When cosmetic pens are used for printing, the "Thicken Lines" option has no effect.

The "Color Set" selection allows you to alter the default color set used in order to force a color printer to use the screen or b&w color set, or to have a b&w printer use the screen or color printer set.

The "Printer Selection" radios should be fairly self-explanatory. The one thing that might not be clear is that regardless of your selection, you will be prompted to select a printer if pgPlot is unable to determine the system default. Otherwise, the choices behave exactly as they are labelled in the image above.

The "Print Orientation" selections are also fairly self-explanatory. The only exception being that "Printer Select" means that pgPlot will use the orientation selected in the printer settings dialog (or the default page setting for the system default printer). The other two selections cause pgPlot to ignore the externally configured orientation and force the printer to orient the plot as directed.

"Use Cosmetic Pens" is available as an option here, but it is not recommended that you enable it. The primary reason it exists is for people who are interested in the difference it causes on the printouts.


The "Symbols" tab allows you to assign special symbols for plotted data points in various conditions and qualities. The conditions are:

Condition Name Meaning/Quality
EMPTY no known data (or at least one input for a calculated value is EMPTY)
ACTIVE Being scanned, no alarms or exceptions or errors.
ALARM Being scanned, in alarm (EU or Rate).
INACTIVE Not being scanned or otherwise inactive.
OFFLINE Unit not reporting.
INVALID In exception and/or validity alarm.

To set the symbol for a condition, click on the name, then click on the desired symbol. The names and pictoral images of each symbol are on the buttons to the right of the condition list. The 'None' button tells pgPlot not to associate any symbol with the condition.

NOTE: Individual tracks may not show all of these symbols because the track settings (see below) may consider a condition


On this tab you may alter the appearance of any of the tracks plotted by pgPlot. Note that some tracks may appear on more than one plot. Start by selecting the track (from the "Track Name" list) to be modified.

The "Style" group specifies what data points will be drawn, and how they should look and/or be connected (if at all). "Status -> Symbol" sets whether or not the value's current status/condition (as listed in the "Symbols" tab section, above) is displayed using the assigned symbol. "No Line" determines if a line is drawn between data points on the track or not (not all tracks honor this one, so you might need to experiment a bit). "Skip 'Bad' Values" causes the plot to place values whose status/quality is NOT selected in the "'Good' Status Set" list in the 'bad value position' (typically at or near the bottom of the plot) and no line will connect to or from the 'bad' value. "Stepwise" indicates that the track's like should be drawn using perpendicular segment pairs rather than single segments directly from data point to data point, producing a 'stair-step' like plot.

The "'Good' Status Set" line shows which point statuses will be considered good enough to plot.

The "Data Symbol" selected will be drawn centered on the location of each data point on the track.

The "Line Thickness" should be 1 unless geometric pens are used. Then the number may be any integer.

The "Bad Position" overrides the default set on the "Plots" tab. It may be specified as a percentage, an exact value, or an 'X' to indicate that bad values are plotted anyway.

The "Color" is a button that displays the standard Windows color selection dialog and allows you to choose any displayable color for the track.




(descriptions needed)