TempCnf.src Template File

The TempCnf.src file is included with your VTS installation, and is stored in your VTS installation directory within a subdirectory labeled, "Template" (e.g. "C:\VTS\Template\").

TempCnf.src is a template for the ConfigFolder module that handles the tag properties folder for your custom tag type, which enables users to configure the properties for each tag instance without having to directly edit the tag properties database ("Points.mdb").. An example of a tag properties folder is displayed below.

The contents of the TempCnf.src file are included and commented below (comments in gray, italicized text) for your convenience.

{======================== ConfigFolder =========================}

{ The ConfigFolder module provided below is a sample, and is incomplete (it does not handle all of the parameters for this tag.) }

{ This module draws the contents of the tabbed dialog box for editing the parameters of the tag. Changes to these parameters will be written to the ODBC database. This module gets passed two parameters that give a list of the current parameter values and the tab number to display. The properties module (declared within this file) and the shortcut menu calls define the number and labels for the tabs. This module must be manually coded to correspond to the coding for those modules. It is up to you to determine the split of parameters across the parameters of the tag. Changes to these parameters will be written to the ODBC database. This module gets passed two parameters that give a list of the current parameter values and the tab number to display. The properties module (declared within this file) and the navigator calls define the number and labels for the tabs. This module must be manually coded to correspond to the coding for those  modules. It is up to you to determine the split of parameters across the tabs. }

{ A given parameter may appear on multiple tabs, if required. }

{ The first tab is, by convention, the "ID" tab. This tab handles the "Name", "Area", and "Description" parameters. This module uses the "P" modules defined in \DialogLibrary. These modules are also used in the Panel code. There is no restriction to defining the user interface code, although the use of the "P" modules simplifies many common requirements. }

{=================================================================}

(

Parms { Pointer to array of parameters };

Current { Currently selected tab (starts at 0) };

)

[

    Constant WIDTH = 550 { Width of our dialog box };

 

    Temp { Starting value of droplist for data type };

 

    {*************************************************************}

{ The following variables defined as class 1 variables are a list of the tab name variables found in the Config.ini file. (Referring out to the Config.ini file for the text to display on these labels enables users to later modify this text (e.g. translate into another language, or otherwise customize the tab labels.) The order of the variables will be the order of the tabs displayed. If these variables have a default value, and there is no corresponding value set in the Config.ini file, the default value is used for the tab's label. }

    {************************************************************}

    [(1) 

          IDTabLabel = "ID"; 

          IOTabLabel = "I/O"; 

          EventsTabLabel = "Events"; 

    ] 

]

InitConfigFolder [

    If 1 Switch; 

    [ 

          {*************************************************************}

{ Set up default values for parameters that are currently undefined so that the dialog box controls can deal with valid values. }

          {************************************************************}

          Parms[\image\Number_Hatch.gifAlarmInhibit] = PickValid(Parms[\image\Number_Hatch.gifAlarmInhibit], 0);

          Parms[\image\Number_Hatch.gifScanInterval] = PickValid(Parms[\image\Number_Hatch.gifScanInterval], 0);

          Parms[\image\Number_Hatch.gifPriority ] = PickValid(Parms[\image\Number_Hatch.gifPriority], 0);

          Parms[\image\Number_Hatch.gifLogRate ] = PickValid(Parms[\image\Number_Hatch.gifLogRate], 0);

    ] 

]

Switch [

    If Current == 0 ID; 

    If Current == 1 IO; 

    If Current == 2 Events; 

]

ID [

    If Current != 0 Switch; 

    {*************************************************************}

    { Name of the tag (parameter 0). }

    {*************************************************************}

    GUITransform(30, 95, WIDTH - 30, 50 { Boundaries of transform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

    \DialogLibrary\PEditField(0, \NameLabel, 4) ); 

    {*************************************************************}

    { Area to which the tag belongs (parameter 1). }

    {*************************************************************}

    GUITransform(30, 150, WIDTH - 30, 105 { Boundaries of transform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

    \DialogLibrary\PAreaSelect()); 

    {************************************************************}

    { Description of the tag (parameter 2). }

    {************************************************************}

    GUITransform(30, 205, WIDTH - 30, 160 { Boundaries of transform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

    \DialogLibrary\PEditField(2, \DescriptionLabel, 4) ); 

    {************************************************************}

{ Container object – the "Template" string specifies the name of the tag type to which we are contributing. (In this example, the contributor is another tag of our own type.) }

    {************************************************************}

    GUITransform(30, 260, WIDTH - 30, 215 { Boundaries of transform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

\DialogLibrary\PSelectObject(\image\Number_Hatch.gifContainer, "Template", \ContainerLabel));

]

IO [

    If Current != 1 Switch; 

    {*************************************************************}

    { Questionable Data Flag. }

    {************************************************************}

    GUITransform(140, 90, WIDTH - 270, 60 { Boundaries of xform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

    \DialogLibrary\PCheckBox(\image\Number_Hatch.gifQuestionable, \QuestionableLabel, 1, 2));

    {************************************************************}

    { Address within the I/O device. }

    {************************************************************}

    GUITransform(140, 145, WIDTH - 140, 100 { Boundaries of transform }, 

    1, 1, 1, 1, 1 { No scaling }, 

    0, 0, 1, 0 { No movement; visible; reserved }, 

    0, 0, 0 { Not selectable }, 

    \DialogLibrary\PEditField(\image\Number_Hatch.gifAddress, \InputAddressLabel, 4));

    {***************************************************************}

    { Scan interval in seconds. }

    {*******************************************************************}

    GUITransform(140, 200, WIDTH - 140, 155 { Boundaries of transform }, 

    1, 1, 1, 1, 1 { No scaling }, 

    0, 0, 1, 0 { No movement; visible; reserved }, 

    0, 0, 0 { Not selectable }, 

    \DialogLibrary\PEditField(\image\Number_Hatch.gifScanInterval, \ScanRateLabel, 3));

]

Events [

    If Current != 2 Switch; 

    {*************************************************************}

    { Log Rate. }

    {************************************************************}

    GUITransform(110, 95, WIDTH - 110, 50 { Boundaries of transform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

    \DialogLibrary\PEditField(\image\Number_Hatch.gifLogRate, \DataLogRateLabel, 3));

    {*************************************************************}

    { Alarm Inhibited Flag. }

    {************************************************************}

    GUITransform(30, 155, WIDTH/2 - 130, 110 { Boundaries of xform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

    \DialogLibrary\PCheckBox(\image\Number_Hatch.gifAlarmInhibit, \InhibitAlarmLabel, 1, 2));

    {*************************************************************}

    { Alarm Priority. }

    {*************************************************************}

GUITransform(WIDTH/2, 155, WIDTH - 110, 110 { Boundaries of transform },

    1, 1, 1, 1, 1 { No scaling },

    0, 0, 1, 0 { No movement; visible; reserved },

    0, 0, 0 { Not selectable },

\DialogLibrary\PSpinBox(\image\Number_Hatch.gifPriority, \AlarmPriorityLabel, 1, 0, 100, 2));

]

{ End of ConfigFolder }