|
|
|
|
For DV-Draw Usage Notes, click here.
The application performs the following tasks: mapping the static database cache, subscribing to all real time data points, loads views from disk, maps the appropriate view variables directly (or indirectly) to PICS data sources, and controls when DataViews renders each view. There is a glossary at the end of this document, intended to clarify terms that may have a different meaning in the DataViews system. Click here to see some annotated screen shots.
PICSViews is capable of loading two different types of file as the 'base' view. The first type is a single view file. The second type is called a layout file. A single view file contains one DataViews drawing (although a single DataViews drawing may actually contain multiple objects, or object sets, that the users considers 'drawings'). A layout is a special form of the single view file that contains a number of named rectangle objects. Each rectangle's name matches the name of a single view file that is to be loaded in the rectangle's position in the layout. The rectangles in a layout may overlap, but views are not transparent, so the topmost rectangle (actually, the view loaded in that position) will obscure any other views that are behind it. See the Layout Files section below for more details.
When the File | Open menu item is selected, PICSViews displays a list of available layouts by default. You may change the listed file type to 'Views' or 'All Files' if the file you're seeking isn't shown. The file open dialog is also a standard system dialog, so you may also browse the drives and/or directories on your system to locate a view.
A layout file is simply a regular view that contains only named rectangle objects that are used to locate and place other views within the display window. Each rectangle should be named to match the view file that is to be placed within. For example:
The layout file shown in Figure 1 (above) contains four rectangles, named: "Background.v", "Overlay1.v", "Overlay2.v", and "MiniSpds.v". When PicsViews loads this layout file, it will get the names of each of the rectangles and attempt to load the views from files matching the rectangle names. It will also do the work necessary to have DataViews display each view in the given position and layer. If the rectangle named "Background.v" in the example were to be saved with the "in front" attribute (available in DV-Draw) then the other views would be obscured, even though they would still be loaded because PicsViews actually knows nothing about the layering of the layout rectangles, or what obscures what.
Any other information included in a layout file will be ignored by PicsViews. This allows you to include text items for documentation purposes. If any rectangles are used in the documentation portion of a layout file, they should remain UNNAMED or an error will result. By default, PicsViews uses the complete extents of all existing objects in the layout view to determine the overall size of the display viewport, so any documentation or special text settings should be placed within the boundaries of the display rectangles to avoid inadvertently increasing the area used to place the views.
Some special text items may also be included to control how the layout is fitted into the display window. These settings may be placed within the view by creating named text objects (the object names must match the setting name):
| STRETCH: | (YES or NO) | Controls how the layout is fitted into the display viewport. NO causes DataViews to retain the aspect ratio of the layout area, maximizing either the horizontal or vertical so that the other dimension is not clipped. YES causes DataViews to stretch the misfitted dimension to match the window extents, possibly distorting the view. |
| EXTENT: | (objName) | When this setting is present, PicsViews uses the given object name to locate the rectangle that will be used as the viewport extents. If this setting is missing, or the object does not exist within the layout, then the complete extent of the layout will be used. This may also be specified by naming a rectangle "Layout:Extent" |
| REFRESH: | (milliseconds) | This specifies the desired update rate for a view. When missing, the default of 250ms is used. If this setting is present and set to zero, the view will only be refreshed after new real time data has been received. |
| PLANTMODE: | (string or index) | Use to specify the plant mode to be used for the views on this layout. See the PICS documentation for a list of plant operating modes. Currently this would only affect the initial selection of the alarm threshold attributes. |
| TIMEMODE: | (Plant or PICS) | When time strings are formatted, this setting chooses whether the time value will be adjusted to the time zone specified for the installation, or use PICS internal time (GMT). |
The DataViews product, DV-Draw is used to construct view and layout files for PICSViews to load. Most of the features available within DV-Draw are supported by PICSViews. All known exceptions are listed at the end of this section. DataViews is relatively new to the Windows platform, so their TrueType font support is somewhat lacking compared to the other features of the product. (Some of the weaknesses in TrueType are in the Windows font rendering engine, not all can be blamed on DataViews.)
For full-screen views, keep in mind the aspect ratio of your target display hardware when designing your view. The DataViews design surface is a perfect square defined using a logical coordinate system of -16K,-16K to +16K,+16K. Out of that perfect square, PicsViews only uses either the extent rectangle or the bounds of the layout (or view when a single view is loaded). Views constructed specifically to be embedded (or overlayed) on a larger view may have any aspect ration, but remember, even those views may have their aspects changed, based on how the extent is fitted into the display window.
The off-the-shelf view editor (DV-Draw) supports a number of different data sources, including file, memory, constant and function. While PicsViews will rebind any variable whose name matches either a reserved name, or a data point name, the use of file data sources is not recommended. When a file data source is used, the file must exist in order for the view to function properly, even when all of the variables contained within the file have been rebound. For this reason it is suggested that all variables reside in either a memory or function data source. Constants may be used if necessary, but variables in a Constant data source should never be given reserved or data point names because constants cannot be rebound. If you need a PICS constant, create a memory variable using its name in the data base, or enter the value directly as a constant variable.
DV-Draw refers to function data sources as FDSeval and FDSrandom. FDSrandom data is of very limited use in production views. However, FDSeval may be used to greatly enhance the capabilities of your views. For example, you might create an FDSeval variable that is computed by multiplying the value of a number of digitals together and change a color dynamic based on the entire group's state. Or you might use relatively raw inputs to compute useful values that are not produced by the PICS compute applications.
The variables assigned to active objects within a view may be named using the following syntax to access PICS data:
PointName:attribute
For example, RECL-0:value would return the floating point value of the point named RECL-0. The variable's data type (in the DataViews drawing) should correspond to the attribute named. The following attributes are supported in this program:
|
Source |
Name |
Type |
Notes |
|---|---|---|---|
|
RTDB |
value |
float |
default, if there's no :attribute present |
|
RTDB |
quality |
text[1] |
Single letter quality, as per SPDS Display rules. |
|
RTDB |
status |
ulong |
Use a function data source to extract the interesting bits within the view. |
|
RTDB |
alarm |
short |
See PICS.H for translations |
|
SDBCACHE |
name |
text[16] |
|
|
SDBCACHE |
desc |
text[32] |
|
|
SDBCACHE |
color |
short |
0-15, matching the standard PC text color table |
|
SDBCACHE |
state |
text[6] |
Digital value state names |
|
SDBCACHE |
units |
text[6] |
|
|
SDBCACHE |
hicrit |
float |
|
|
SDBCACHE |
hialrt |
float |
|
|
SDBCACHE |
hiwarn |
float |
|
|
SDBCACHE |
lowarn |
float |
|
|
SDBCACHE |
loalrt |
float |
|
|
SDBCACHE |
locrit |
float |
PicsViews will automatically map any variable whose name matches a PICS data point to the associated real time value (or static, as the attribute indicates). PicsViews will also map matrix variables to a matrix translation table for variables specified as Filename.m:matrix. See the section on matrix files below for detailed information. PicsViews will also map the following variable names to internal values:
|
Variable Name |
Data Type |
Description |
|---|---|---|
|
DetailLevel |
Short |
The current detail level [0..n] for the view. This may be used to alter the visibility dynamic of objects on a view. |
|
Hour |
Short |
Current hour, range 1..12 |
|
Minute |
Short |
Current minute, range 0..59 |
|
Time |
String[16] |
Plant (or PICS) Time: HH:MM:SS am |
|
Date |
String[16] |
Plant (or PICS) Date: Mon DD, YYYY |
|
DateTime |
String[32] |
Mon DD, YYYY HH:MM:SS am |
|
TimeDate |
String[32] |
HH:MM:SS am Mon DD, YYYY |
|
PlantModeString |
String[32] |
Current plant mode, translated to a string |
|
PlantMode |
Ulong |
Current plant mode number |
|
DataSourceString |
String[32] |
Current data source, translated to a string |
|
DataSource |
Ulong |
Current data source number |
Every view may have its own, internal variables in addition to the PICS and PicsViews values that are available. Internal variables will generally be contained within a function data source (FDS) and will compute a value at runtime based on PICS and/or PicsViews values. Internal variables should have a colon (':') as their first character to signal PicsViews that the variable is internal and should not be mapped. This will allow files to load a bit faster, since PICSViews will not need to search for the variable name in the list of point names and known pre-defined names.
Some DataViews objects (such as size graphs) accept input in the form of a single matrix variable, rather than in an array of individual values. To support this feature, PicsViews allows you to name the matrix variable using the syntax Filename.m:matrix, where Filename.m specifies the name of an ASCII file containing a matrix map, and :matrix signals PicsViews that it is to attempt to load the named matrix file. Any matrix variables whose names do not include the :matrix tag will not be rebound by PicsViews. Here's a sample of a matrix file (a detailed description of the contents follows):
;Sample Matrix File
5,5
*, *, P100, *, *
*, P101, P102, P103, *
P104, P105, P106, P107, P108
*, P109, P110, P111, *
*, *, P112, *, *
The first line, beginning with a semi-colon, is a comment. Comments and blank lines are ignored by the matrix mapper. The next line "5,5" indicates the dimensions of the matrix. These dimensions should match exactly the dimensions specified in the variable's data definition for the view. The map must be defined using the given dimensions. Using an asterisk ('*') indicates that there is no point at that location, zero will be used. You may also place a constant value in place of an asterisk. The other positions in the sample all have real time data point names. The matrix mapper will create a table to move the values of these points into the appropriate places in the matrix at run time. A point may appear in the matrix as often as the dimensions allow.
A vector variable may be created using a matrix file, by defining only one row.
DV-Draw has the ability to read any ASCII file (using white space as value delimiters) for test data. The default file (default.dat) contains roughly 5000 random values ranging between zero and one. However, data files produced by the PICS Retrieve application would also work (once the headers are removed and empty value cells were filled). In general, special views would be constructed (at this time, at least) to review ASCII file data.
An active subdrawing is defined as any subdrawing that contains internal dynamics. For example, a common gage may include an internal variable that controls the needle. Active subdrawings present a special problem for PicsViews because of the way DataViews links them to their data. For views designed to be displayed by PicsViews, the following procedure will be used.
The subdrawing's internal variables should be given meaningful names (e.g. Needle for the needle in a gage subview). The meaningful names should be mapped to actual PICS points when the subdrawing is inserted into a view. Remember however, that variable ranges and dynamic definitions are contained within the subdrawing, so active subdrawings may be of more limited utility than first glance may suggest.
DataViews is a very powerful package with many, many features and capabilities. In the interest of getting something functional working and delivered to FPC, some of the DataViews features are not supported. Inclusion on any of these features in a view to be displayed by PICSViews will result in unpredictable behavior
PicsViews supports command line parameters, for use in pre-defining default settings for a view. This allows you to avoid embedding some configuration parameters in the layouts or views themselves. The following items may be placed on the command line in any order:
| -Refresh:nn | Specify the default refresh interval in milliseconds. |
| -Stretch:Yes | Specify the default view fitting mode. Use 'Yes' to indicate that the view should be stretched by default, any other value will be interpreted as 'No.' |
| -PlantMode:Mode | Specify the current plant operating mode for alarm limit extraction. This may be specified as a number or a mode name. See the PICS documentation for a detailed list of modes. |
| -TimeMode:PICS | Specify the time translation mode. 'PICS' indicates that time will not be translated from PICS (GMT) internal time to the plant's local time zone. Any other value will be interpreted as 'Plant.' |
| ViewFileName | This may name either a single view file (.v) or a layout file (.lay). If the name contains spaces, it must be quoted (both single and double quotes will work OK, as long as the filename doesn't contain any of the matching characters itself). |
For example, this command line:
PicsViews -Refresh:1000 -Stretch:Yes -PlantMode:Operate "Core Dynamics.lay"
would load all of the views referenced in the layout file "Core Dynamics.lay" using a default refresh of 1 second (1,000 milliseconds) and stretch the views to fit the viewports defined in the layout.
Prefixing a command line parameter with an exclamation point will cause PicsViews to ignore any settings contained within a view, in addition to setting a default value. For example:
PicsViews -!Refresh:1000 -!Stretch:Yes -PlantMode:Operate "Core Dynamics.lay"
would be the same as described before, but any refresh and stretch settings in the layout or view being loaded will be ignored.
With the exception of the menu bar and Windows default keys, all of the key/mouse events that PICSViews handles are completely configurable through the use of Action Files. The default action file maps the following key and mouse events to the described actions:
|
Input Event |
Affects |
Description |
|---|---|---|
|
Arrow keys (left, right, up, down) |
Active View |
Pan the viewport [over the view] in the direction indicated. |
|
Home |
Active View |
Pan the view's original center point to the viewport's center point. (Restore original center.) |
|
Page Up, Page Down |
DetailLevel variable |
Increment/decrement the DetailLevel variable which may be used by views to assign visibility dynamics to objects. |
|
Ctrl+Page Up, Ctrl+Page Down |
DetailLevel variable |
Maximize/minimize the DetailLevel variable. |
|
Ctrl+Home |
Active View |
Restore the view to its originally loaded size and position. |
|
+, - |
Active View |
Zoom in or out on the view. |
|
Right Mouse Button Click |
n/a |
Display a popup with point details on some graph types (most notably size graphs). |
|
Shift Left/Right Mouse Button Click |
Active View |
Zoom in or out on the active view. |
|
Control Left Mouse Button Click |
Active View |
Center on the point clicked. |
| B, b | Application | Send PicsViews to the back (bottom of the Z-Order). |
| F, f | Application | Bring PicsViews to the front (top of the Z-Order). |
The 'Active View' is defined by DataViews as the view currently under the mouse pointer. PicsViews extends this concept slightly to keep the most recently active view when the mouse moves (a) out of the program window or (b) over a non-drawport portion of the display. The second event (b) can occur if a template contains areas between boundary rectangles that do not belong to any view (as in the sample given in the Layout Files section of this document).
PicsViews supports additional view behavior instructions in the form of 'Action Files' (*.x). Action files are ASCII text files that are loaded in conjunction with a view. To associate an Action file with a view, both files must be given the same base filename (only the extension changes from '.v' to '.x'). The file format is very similar to INI files used by Windows applications. There must be a header section, there may be an OnLoad section, and one or more action definition sections. The header section defines information about the Action file, such as version number, that may be used in configuration control and/or by PicsViews to determine how to interpret the file.
Action files follow the INI file syntax exactly. Blank lines are ignored. If the first character on a line in a semi-colon, the line is treated as a comment and ignored (e.g. ;This is a comment). Section names appear on a line by themselves and are encapsulated in square brackets (e.g. [Section]). Item-value pairs are listed one pair per line and are separated by an equal sign (e.g. item=value). Any spaces within square brackets or around the equal sign in an item-value pair are significant, so be sure any spaces in those locations are intended.
This section contains information about the file and how it should be interpreted by PicsViews. The following items are found in the Header section:
| Item | Required? | Description |
|---|---|---|
ProgramName |
YES |
Must be PICSVIEWS. This is included to allow different programs to determine if they should interpret this action file. |
ProgramVersion |
YES |
Specifies the version of PicsViews that this action file was created for. (Currently 1.00) |
FileVersion |
No |
Specifies the version of this action file. May be included for configuration control. |
Author |
No |
May be included for configuration control |
EditDate |
No |
May be included for configuration control |
Other items |
Ignored |
Any other items in this section are ignored by PicsViews, but may be included for configuration control (such as revision history). |
This section is not implemented in PICSViews v1.0. The intent of this section is to define a special action to be executed immediately after the view has been loaded. For example, loading related views, etc. Other special event sections may be added in a future version.
Each action section corresponds to the name of an object contained within the view. Currently, the only item that is contained within an action section is 'OnClick' which indicates that
PicsViews supports a 'global' action file (which must be named 'PicsViews.x' and located in the DataViews search path, preferably in the PICSViews or PICSViews\Views directory) to define actions common to all views and layouts. Generally these actions will include things like a view to be loaded when a specific condition occurs, such as a plant trip or a specific keypress (like F8 always loads the RCP Status display). This file is not required, but must have the correct name and location if it is intended for use. Typically all global actions will be unbound (not attached to specified objects, see the next section), but if a standard layout is defined at a site, that layout might contain a standard set of objects that are always visible. In that situation it may appear sensible to make those actions global, but it would be more sensible to attach them to the common view to avoid coupling the layout too tightly to the base application.
An action section of the extra file contains information describing the trigger for an action as well as the action itself. The section name represents an object in a view, or an asterisk ('*') to indicate that the action is not bound to any particular object. PicsViews scans the action list in the same sequence that it exists in the file (at load time, changes while a view is open have no effect), so in the event that conflicting or overlapping actions are defined, PicsViews will only execute the first matching action. This allows you to use the asterisk to bind 'global' actions to the same triggers used for object-specific actions earlier in your file.
Since PicsViews action files are not used by any Windows INI file functions, you may use the same section name (object name) multiple times in order to define multiple actions for a single object. You cannot define more than one action (or trigger) per section. If you try to define multiple actions and/or triggers in a single section, PicsViews behavior is undefined and may result in a program error.
There are currently (version 1.0) seven keywords defined for an action section. Each of these is discussed in detail in the following sections.
As the name implies, this key will define the action to be taken. This is the most complex of all action section keywords and will be dealt with in excruciating detail later, for now, here's a list of possible actions and a short definition of each:
| Load | Loads a new view to replace the current view. In PicsViews 1.0, this action always replaces the entire main window drawing area with the named view (or layout). A future version may be capable of replacing an individual view within a layout without changing other views. A future version may retain a stack of previous views to support a 'go back'-type feature similar to current Web browsers. |
| Popup | Loads a view into the popup view window. PicsViews 1.0 only supports one popup view at a time, so this action also automatically closes the previous popup view window, if it is open, before loading the new view. |
| ClosePopup | Closes the popup view window, if it is open. |
| ZoomTo | Zooms the view to the named rectangle. This allows you to have hidden (or visible, if you desire) named rectangles that define areas of interest within a view. |
| UnZoom | Restores the view zoom state to its pre-ZoomTo state, or to the initial load state, if no previous ZoomTo was performed. Future versions of PicsViews may create a stack of zoom contexts to allow multiple levels on unzoom. |
| CenterOn | Exactly like ZoomTo, except the view is centered on an object, rather than zoomed. |
| UnCenter | Exactly like UnZoom, except the previous center is restored, instead of the previous zoom level. |
| SetVar | Sets a named variable to a specific value. These variables should not reference PICS or PicsViews Internal variables, since those will generally be changing by themselves. The one exception is DetailLevel, which may be safely altered using the SetVar (and IncVar/DecVar) actions. |
| IncVar | Increments a named variable by a specific value. See SetVar for more details. |
| DecVar | Decrements a named variable by a specific value. See SetVar for more details. |
| MapVar | Map view variables to a PICS or PicsViews variables. PicsViews 1.0 only supports the syntax, "ViewVar=PicsVar" but a future version might support a longer replacement string which would be indexed by a specific variable's value, for example, a selected loop or current mode variable would be used to map appropriate data points. |
| Zoom | Zooms the view one level in or out. |
| Pan | Pans the view one step in the specified direction |
| Reset | Reset the view to the initial zoom level and center point. |
| Refresh | Refresh the view. This causes the view to be redrawn completely, in theory eliminating any artifacts created by things like overlapping windows or animated objects that are using ineffective erase/redraw mechanisms (these are set in DV-Draw when the view is constructed). |
| ExitApp | Exit the PICSViews application. Just like choosing File | Exit from the menu. |
| ToFront | Bring the PICSViews application to the top of the Windows Z-Order. |
| ToBack | Send PICSViews to the bottom of the Windows Z-Order. |
| Center | Similar to 'Reset,' except only the view center point is restored, any zoom level changes remain intact. |
| SetAttribute | NOT IMPLEMENTED IN 1.0 Allows alteration of some object attributes. For example, a different graph formatter may be selected using this action. |
| NOTE: PicsViews 1.0 only supports a single action per event, but a future version may incorporate action sets, allowing more complex view behavior. | |
The following list of action entries is provided to show the basic syntax of each of the actions.
Action=Load,ViewFile.v
Action=Popup,ViewFile.v
Action=ClosePopup
Action=ZoomTo,RectangleObjectName
Action=UnZoom
Action=CenterOn,ObjectName
Action=UnCenter
Action=SetVar,VarName,Value
Action=IncVar,VarName
Action=DecVar,VarName
Action=MapVar,DVName,PICSName
Action=Zoom,In
Action=Zoom,Out
Action=Pan,Left
Action=Pan,Up
Action=Pan,Right
Action=Pan,Down
Action=Reset
Action=Refresh
Action=ExitApp
Action=ToFront
Action=ToBack
Action=Center
The button keyword is used to specify which mouse button (optionally combined with shift-keys) will trigger this event. The mouse button is specified first, using one of the following names: Left, Middle, or Right. If any modifier keys are required, they should be listed using commas (or plus signs) to separate them using the following names: Alt, Control, and Shift. Modifiers may be combined, but button names may not. For example, to define Control+Shift+Left Button as a trigger, this entry would be included in the action section:
Button=Left+Ctrl+Shift
The key keyword is used to specify which function key (optionally combined with shift-keys) will trigger this event. The key name is specified first, followed by any modifier key names, if necessary. If any modifier keys are required, they should be listed using plus signs (or commas) to separate them using the following names: Alt, Control, and Shift. Modifiers may be combined, but key names may not. For example, to define Shift+Alt+F8 as a trigger, this entry would be included in the action section
Key=F8+Alt+Shift
To make it easier for one action to refer to another, you may give each action a name. These names should be unique (if not, then PicsViews will use the first match it encounters). When searching for an action by name, the other triggers (mouse buttons and/or keys) are ignored.
If an action fails for some reason (e.g. a view to be loaded cannot be found) then this item defines how PicsViews will respond to that failure. You may specify any of the following:
| Exit | This will cause PicsViews to exit. |
| Fail | PicsViews will issue a failure notification to the monitoring task (TaskMon or ACC). This could be useful for overhead nodes that are responding to remotely generated action events. |
| Log | PicsViews will place a message in the Windows NT Application Event Log describing the action and the failure. |
| Action | The named action will be executed instead. This item is specified using an equal sign to delimit between the keyword and the action name (e.g. Action=PopupAlertView). |
| These actions may be used in any combination, with only one restriction: when the 'Action' handler is used, it must be the last hander specified. Otherwise, PicsViews will use any following handlers as part of the action name. | |
|
TBD: Where do I define what PicsViews does when a failure action fails? More specifically, what if the named failure action cannot be found in the action table? |
|
Define a data trigger for this action. A data trigger monitors the value of a variable and triggers an action when the variable crosses some threshold or enters a particular state. When implemented, it is planned that triggers may include more than one variable and/or condition, with the additional possibility of having the ability to define different actions for different regions (or results) of trigger testing.
Specifies text to display on the action menu in PicsViews. If this keyword is missing, then no entry is made on the menu. PicsViews, in theory, supports as many menu items as actions, however in practice, Windows supports a much more limited number. Currently, PicsViews 1.0 stores but otherwise ignores this setting. Menu management will be added at a later date.
|
|
|
|