Custom Web Interface. Pharos LPC X, DESIGNER, LPC 1/2/4, TPC, BPS, Rio
Quảng cáo
Quảng cáo
Pharos Designer User Manual
Custom Web Interface
To add a custom web page, or set of pages, to the web interface on a Controller, go to Project Mode, Web Interface
Tab, Custom Web Interface and select Edit...
This will open a dialog that shows the files that currently make up your custom web interface:
Adding Files
To Add files to the web interface, click Import. This will allow you to add files to the current folder selected within the
Custom Web Interface tool.
Any file type can be included, but since they are stored as part of the project file, be aware that they will take away from space available for programming, and will increase show upload times.
Adding Folders
To add sub-directories to the web interface structure, use the New Folder button. This will add the folder to the directory structure and allow you to add files to the new folder.
Removing Files Or Folders
To remove a file or folder, select the file or folder and press Delete.
Interaction Between Custom Interface And Project File
Firing Triggers
Custom web pages can trigger the Controller by creating a hyperlink to "/trigger/xyz", where "xyz" is the trigger number, as set in Triggers. Clicking on this hyperlink will fire the numbered trigger, if it exists, but will not cause the page to refresh so there is no need to use Java Script tricks to prevent the page from flickering.
By default, conditions are tested when firing a trigger in this way, but this can be disabled by specifying
"conditions=0" in the URL query string. For example, "/trigger/1?conditions=0" will fire trigger 1 regardless of whether its conditions are satisfied.
- 294 -
Custom Web Interface
Firing Triggers With Variables
You can capture variables and inject them into the numbered trigger by specifying a "var" field in the query string.
The value of this field is expecting a comma-separated list of values, with each value in the format "abc:def" where
"abc" is the captured value and "def" is the range of the value (optional). If the value of "abc" is not a number, it is treated as 0. If value of "def" is not a number, it is treated as 255.
For example, the URL "/trigger/1?var=14" will fire trigger number 1 and will inject the value 14. If this trigger had a
Start Timeline action that expected a variable to select the timeline, then it would start timeline 14.
In another example, the URL "/trigger/2?var=50:100" will fire trigger number 2 and will inject the value 50. If the variable is used by an action that is expecting a value within a range, for example Set intensity expecting a level between 'off' and 'full', then the injected variable will be treated as 50% since 50:100 = 50%.
You can also inject multiple variables. For example, "/trigger/2?var=50:100,3,4:16" will inject 50 (50%), 3 and 4
(25%).
If you want to inject a string to a variable, for example if you want to set the contents of a text slot, the characters must be bound by double quotes ( " or %22 if using character escaping). To include a " in the injected string you must prefix it with a backslash. To include a backslash, write two backslashes. Here are some examples for injecting strings:
/trigger/1?var="hello" -> (hello)
/trigger/1?var=%22hello%22 -> (hello)
/trigger/1?var="hello \"world\"" -> (hello "world")
/trigger/1?var="hello\\world" -> (hello\world)
Anything after the closing " and before the next comma is ignored:
/trigger/1?var="hell"o,"world" -> (hell),(world)
If a closing quote is missing, the remaining string is used:
/trigger/1?var=1,"hello,2 -> (1),(hello,2)
Directly Controlling Outputs
Custom web pages can also directly control Timelines and Scenes without having to create triggers.
The options available are:
Start Timeline, Release Timeline, Pause Timeline, Resume Timeline, Start Scene and Release Scene
To perform these actions you can either type the URL directly into the address bar or set up a hyperlink with the relevant link:
Timelines
URL is of the form <ip_address>/timeline/<action>/<usernumber>
Possible actions are start, release, pause and resume. The release action also has an optional 'fade' field in the query string
- 295 -
Pharos Designer User Manual
Scenes
URL is of the form <ip_address>/scene/<action>/<usernumber>
Possible actions are start and release. The release action also has an optional 'fade' field in the query string
Examples
192.168,0.2/timeline/start/1
192.168.0.2/scene/release/2?fade=3
Javascript Library
Alternatively, the controller's web server includes a JavaScript which can be used to fire triggers and also to query the controller for information about its state and properties.
See the
for more information.
Examples
Examples of Custom Web Interfaces are available on our website.
- 296 -
Tải xuống
Quảng cáo