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 also have the following properties:
Default Value - The initial value of the variable
Is Graphable - for centralised (ticked) Centro labels, this determines whether the values of the label can be viewed via the Centro web interface.
Processor Label ID - in the (uncommon) case of using multiple different projects with a Centro-8 / 8M, this ID ensures that labels in one project are associated with labels in another project.
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:
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:
#CURRENTTIMETEXT - sets the label equal to the current time in the format HH:MM, eg "13:05"
#CURRENTTIME - sets the label equal to the current time in the format HH:MM, eg "1305"
#CURRENTHOUR - sets the label equal to the current hour in the format HH eg "09"
#CURRENTMINUTE - sets the label equal to the current minute in the format MM eg "05"
#CURRENTSECOND - sets the label equal to the current second in the format SS eg "05"
#CURRENTDAYOFWEEKTEXT - sets the label equal to the day eg "Monday"
#CURRENTDAYOFWEEKTEXTSHORT - sets the label equal to the day in short format eg "Mon"
#CURRENTDAYOFWEEK - sets the label equal to the day in number format eg "01"
#CURRENTDAY - sets the label equal to the day of the month eg "28"
#CURRENTMONTHTEXT - sets the label equal to the current month eg "January"
#CURRENTMONTHTEXTSHORT - sets the label equal to the current month in short format eg "Jan"
#CURRENTMONTH - sets the label equal to the current month eg "01" for January
#CURRENTYEAR - sets the label equal to the current year eg "2017"
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:
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:
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:
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.