ISY Developers:API:V5:NLS:Formatting for Programs

From Universal Devices, Inc. Wiki
Revision as of 18:05, 14 January 2019 by Chris (talk | contribs) (Created page with "<!-- ** DO NOT EDIT ON THE WIKI WEBSITE - Source file is ** --> ISY_Developers : API : ISY_Dev...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ISY_Developers : API : V5 : Language Support : Formatting for Programs

Formatting in Programs

Each line of a program is formatted and displayed in different way. Custom formatting entries in the NLS file(s) are used for node conditions and commands, as follows:


The format and lookup order of the NLS entry for program command entries is:


e.g. (All on one line)

     PGM-CMD-DON-FMT = /level/${c}/to ${v}/ /ramprate// in ${v}/ /offtimer//, turn off ${v} later/

/<>/param text if omitted/param text if not omitted/ [.. next parameter, …]

e.g. /level/${c}/to ${v}/ /ramprate// in ${v}/
       First character defines what character to use as separator, normally '/' is used
Id of the parameter (e.g. 'level')

This is blank for an unnamed parameter

param text if omitted
String to show if the parameter was omitted
param text if not omitted
String to show if the parameter was specified

The string for parameter text supports the following variables:

       ${c} Name of the command
${v} Formatted value of the parameter (including UOM)
${vo} Formatted value of the parameter (without UOM)
${uom} Formatted UOM without the value
${op} Operator used (conditions only)

Command Formatting Examples

Assume commands are for node 'MyDevice'

1) A command with three named parameters, 'num', 'val', 'len'

/num//${c} Parameter ${v}/ /val/ default/ = ${v}/ /len// (${v} bytes)/

The following program action line would be shown for:

     ${c} = "Config", num=1, val=20, and len=4:
[Config Parameter 1][ = 20][ (4 bytes)]
 --> "Set 'MyDevice' Config Parameter 1 = 20 (4 bytes)"
${c} = "Config", num=5, val=25, and len omitted:
[Config Parameter 5][ = 25][]
 --> "Set 'MyDevice' Config Parameter 5 = 25"
${c} = "Device", num=5, val omitted, and len=2:
[Device Parameter 5][ default][ (2 bytes)]  --> "Set 'MyDevice' Device Parameter 5 default (2 bytes)"

2) A command with one unnamed parameter

result if unnamed parameter omitted: [default] --> "Set 'MyDevice' default"
result if unnamed parameter = 50 percent: [50%] --> "Set 'MyDevice' 50%"

3) A command with no parameters shows just the command name and does not require a PGM-xxxxx entry

     DFON --> "Set 'MyDevice' Fast On"

Another example:

     PGM-CMD-DON-FMT = /level/${c}/to ${v}/ /ramprate// in ${v}/ /offtimer//, turn off ${v} later/
level=50%, ramprate=3 seconds, offtimer=5 minutes
"[to 50%][ in 3 seconds][, turn off 5 minutes later]"
 --> "Set 'MyDevice' to 50% in 3 seconds, turn off 5 minutes later"

Status Conditions

The format and lookup order of the NLS entry for status condition format entries is:


The value is a single param text string similar to that specified for a command parameter.

    PGM-ST-CLISPH-FMT = ${c} ${op} ${v}

If not specified, then the following is used: ${c} ${op} ${v}

Control Conditions

There are currently no custom entries for control conditions because control conditions do not include any of the command parameters.