DurationParameterEdit

(VTScada-Layer function. Must be called with a leading backslash.)

Description: Wrapper for ParameterEdit, used when adding a duration parameter to a control.
Returns: Self
Usage: Steady State only.
Function Groups: Basic Module, Variable
Related to: ParameterEdit| ColorParameterEdit | TagParameterEdit |TextParameterEdit | NumericParameterEdit
Format: \DurationParameterEdit(DurationVal, ParmDef, Enable, Left, Bottom, Right, Top, LabelWidth, HideTitle, PtrWaitClose, DlgRoot, ID[, DefaultMultiplier, DefaultUnit, SingleValueParm, AllowInvalidParm, MaxFiveYears])
Parameters:  
DurationVal
Required. Parameter Value - See comments
ParmDef
Required. Parameter Definition structure
Enable
Required. Show the Graphics for Editing the Parm Val
Left
Required. Any numeric expression for the left edge of the object.
Bottom
Required. Any numeric expression for the bottom edge of the object.
Right
Required. Any numeric expression for the right edge of the object.
Top
Required. Any numeric expression for the top edge of the object.
LabelWidth
Number of pixels allotted for the width of the label
HideTitle
Set to TRUE to hide the title of the control.
PtrWaitClose
Wait to close.
The parameter edit module will set the value of this pointer to true when the caller should wait to close. For example, if the parameter edit is displaying a dialog, or completing a calculation.
DlgRoot
Root of the edit dialog
ID
Focus ID
DefaultMultiplier
(Optional) Initial multiplier to display
DefaultUnit
(Optional) Initial unit to display
SingleValue
(Optional) TRUE to display a "Single Value" option. Default = TRUE
AllowInvalid
(Optional) TRUE to allow an invalid entry (no duration entered, "Set Duration" button will be displayed). Default = FALSE
MaxFiveYears
(Optional) TRUE to limit duration values to five years. Default = TRUE
Comments:

Duration consists of a multiplier and a unit. The units are as follows:

  • S = Seconds
  • M = Minutes
  • H = Hours
  • D = Days
  • W = Weeks
  • C = (Calendar) Months
  • Q = Quarters
  • Y = Years
  • V = Single Value

For example, a duration of one hour would be denoted as 1H. Two weeks would be denoted as 2W.

Single Value (1V) is for the special case where the duration is equal to the entire available period.

For example, If you use DurationParameterEdit while configuring a table in a report and chose a single value TPP, your table will have only a single record covering the entirety of the report period.

When Single Value is chosen, the only valid multiplier is 1.

Example:

  PEObj[1] = DurationParameterEdit(Space                        { Left coordinate         },
                                   PEBot[0] + 2*EditHt + Space  { Bottom coordinate       },
                                   PanelWd - Space              { Right coordinate        },
                                   PEBot[0] + Space             { Top coordinate          },
                                   Parms[#DurationValue]        { Parameter value         },
                                   ParmDefs[#DurationValue]     { Parameter definition    },
                                   "Duration"                   { Title                   },
                                   TitleWd, FALSE               { TitleWd, hide title     },
                                   DurationType                 { Type index              },
                                   &SubWaitClose[1]             { Wait close pointer      },
                                   DialogRoot, 1                { Root, ID                },
                                   1, "D"                       { Default values (1 day)  },
                                   Invalid, Invalid             { Tooltip, description    },
                                   TRUE, FALSE                  { Use expr, single value  },
                                   Invalid, TRUE                { Var name, allow invalid },
                                   FALSE                        { Max five years          });