Status Definition Files (*.tr)
Previous  Top  Next

Status definition files (formerly Text Reference Files) let you map numeric values to text or images for display. This is especially useful for status values. Besides the text representation a color code can be defined with the status value. If you display a data item represented as a Status Text the colors will be displayed accordingly. Status Image items will be scaled to the largest image within a Status Image definition.

Status Text
Each text reference must have a unique name, enclosed in curly brackets. Then the lookup items are listed. The value to be looked up or a range indicated by low limit - high limit is followed by a comma and the text to be displayed. The last parameter is a color code, alternatively the color code can also be spelled out by listing the color by name in the order:
foreground color on background color
The colors are only used for display purposes, if you access the text reference through Python you will only retrieve the string but you can also request the color code if you want to implement your own color display.

Color Names

The following strings are valid color names (the names are case insensitive):

·BLACK  
·BLUE  
·GREEN  
·CYAN  
·RED  
·MAGENTA  
·BROWN  
·LIGHTGRAY  
·DARKGRAY  
·LIGHTBLUE  
·LIGHTGREEN  
·LIGHTCYAN  
·LIGHTRED  
·LIGHTMAGENTA  
·YELLOW  
·WHITE  

#
#  Sample text reference file.
#
DigSnsr         { 0, "OK ", 0xA0;
                  1, "Err", 0xC0}

PriSec          { 0, "Primary  " , 0xb0;
                  1, "Secondary" , 0xb0}

AliceState      { 0, " Off      ", 0x0C;
                  1, " Checkout ", 0xB0;
                  2, " Safe     ", 0xB0;
                  3, " Acquire  ", 0xB0}

AcqMode         { 0, " Pixel ", 0x70;
                  1, " Histo ", 0x70}

StateMode       { 0,    " Off           ", BLACK on WHITE;
                  1,    " Checkout      ", MAGENTA on LIGHTRED;
                  2,    " Safe          ", GREEN on WHITE;
                  3,    " Acquire-Pixel ", GREEN on WHITE;
                  4,    " OFF (4)       ", GREEN on WHITE;
                  5,    " Checkout      ", RED on WHITE;
                  6,    " Safe          ", RED on WHITE;
                  7-10, " Acquire-Histo ", RED on WHITE}

Status Image
Status images are defined similarly to the Status Text items above. However, instead of listing each image file we define symbolic image names that we will use in the actual definitions. See below for an example:

Image: Name="Green"      File="Green.jpg"
Image: Name="YellowLow"  File="YL.jpg"
Image: Name="YellowHigh" File="YH.jpg"
Image: Name="RedLow"     File="RL.jpg"
Image: Name="RedHigh"    File="RH.jpg"

ImageMap: Alarms {
                 0, Green;
                 1, YellowLow;
                 2, YellowHigh;
               }

ImageMap: Errors {
                    0-12, Green;
                   13-15, RedHigh;
                 }