Labels

Labels are variables which have a textual value. An example might be a Label called Alarm State which might have the text value: "FULLY ARMED" or "PART ARMED" or "DISARMED".

Labels have a default value when the app starts, unless they are global variables, or the settings option Remember Last Page / Settings is applied, in which case the Label will have the last known value.

Managing Labels

Labels can be created from the Labels screen - which can be accessed from the Project Settings tab.

Labels are organised into groups (folders) just like flags.

Labels

Labels also have the following properties:

Adding Labels

To add a label, first select or create the folder that the label will reside in, and click Add Label. Labels must be given a unique name, you can edit the name by single clicking on the label in the tree view.

Creating Multiple Labels

It is possible to select a label & duplicate several copies of it, and each copy will be named with an incrementing number at the end, eg:

Duplicating Labels

Setting Label Values

You can set the value of a label with an action. Labels can be set to a specific text value by typing in the Data field, or one of the following, which can be selected from the drop down list:

Setting the Label Value


Inserting Label values

It is possible to use the value of a label variable using [LABELNAME] or a number variable using {NUMBERNAME} brackets. For example, you could create a command:

SET INPUT [CurrentInput]

would insert the current value of the variable called "CurrentInput" into the command, eg, if the label value was "HDMI1" then the command would become:

SET INPUT HDMI1

You can also set the value of variables equal to other variables in a similar way using the Data field, eg:

Set a label called "Command" equal to "INPUT", and set a label called "Parameter" to "HDMI1", then set a label equal to:

SET [Command] [Parameter]

which would be equal to:

SET INPUT HDMI1

When using the value of variables with or { } (number) brackets you must ensure that the variable name is spelt exactly, case sensitive.

Using Labels

Replacing Text

The most common use of a label is to replace the text on a button. This is done using the Dynamic Label option from the Text menu:

Using a Label on a Button

In this case, when you view the project on the iOS/Android app, the text DOOR IS CLOSED will be replaced by the current value of the label variable called Alarm Status

External Images

It is possible to use a label variable to point to the location of an image, and to instruct the control app to use that image as the main image on a page object:

Using a Label to alter the image

In this case, if the label called Camera Image was set to a valid image location, eg:

http://www.demopad.com/images/logo.png

or even a local image which is contained within the project itself, eg:

button.png

then that image will be displayed as the page object main image. You have the option of refreshing the image every x seconds, which is useful for situations where the image changes, eg if the image location pointed to a changing live camera image. If the image is not constantly refreshing, it will only change when the value of the label changes. Hence you can alter the image at will simply by changing the value of the label as an action.

Altering a Web View

When using a Web View, it is possible to override the web view URL with the current value of a label:

Using a Label to alter a webview

In this case, instead of the web view browsing to http://www.demopad.com it will browse to the value of the label called Web Location, which could be any valid URL, eg http://192.168.1.100 or http://www.google.com. The Web View will refresh each time the value of the label changes - hence you could have several buttons which alter the value of the label, causing the web view to change accordingly.