Properties Panel
7 minute read
The properties panel on the right of the editor shows the properties of what you selected. Select a widget and it shows that widget’s properties, described per widget in the Widget library. Click the empty canvas and it shows the settings of the whole interface, in six sections that open and close with a click.
What the settings connect
Three sections tell the interface which parameters of your application to read, and which files turn their numbers into names. The finished interface shows the result in the screens bar and in the error handler:
The parameter paths are the defaults of a new grid file. They match the robot application; for another application, set the paths of its own state, error and log parameters.
All settings at a glance
| Section | What you set | Defaults of a new file |
|---|---|---|
| Client connection settings | Address, ports and login of the controller | Page address, 5568, 5567, root |
| Errors | Error and acknowledge parameters, error codes file, help pages | root/Logic/activeErrors, root/Logic/guiFaultAcknowledge, no files |
| States | State parameter and state codes file | root/Logic/state, no file |
| Logs | Log parameter | root/logger/logOut |
| Screen | Title, start screen and visibility of the selected screen; size and colours of all screens | 800 × 600 |
| Raster | Size, colour, show and snap of the raster | 30 × 30, shown, snap on |
The sections
These settings tell the interface how to reach the Motorcortex server on the controller, both in the preview and after you deploy it. Open the section with Client connection settings.
| Field | What it does | Default |
|---|---|---|
| machine IP | The address of the controller, for example controller_ip_addressThe IP address of your controller. In most cases 192.168.2.100.. Leave it empty to connect to the address the interface was loaded from, which is what you want for an interface served by the controller |
Empty |
| request port | The port for requests and replies, such as reading and writing parameters | 5568 |
| subscribe port | The port on which the controller publishes parameter values | 5567 |
| username | The user the interface logs in as | root |
| password | The password of that user | vectioneer |
| secure | Connects over an encrypted connection | On |
| autologin | Logs in with the username and password each time the interface connects | On |
The password is stored in the .grid file, so anyone who can open the file or the deployed interface can read it. Use a user with only the rights the interface needs.
These settings feed the error handler screen: where it reads the active errors, what it writes when you press acknowledge, and where it finds the names and help pages of the errors. Open the section with Errors.
| Field | What it does | Default |
|---|---|---|
| path | The parameter with the list of active errors | root/Logic/activeErrors |
| acknowledge | The parameter that the acknowledge button writes to | root/Logic/guiFaultAcknowledge |
| frequency divider | Reduces how often the value is sent: the controller’s update rate is divided by this number. At 1000 Hz, a divider of 1000 gives one update per second |
1000 |
| Error codes | The JSON file that names each error number | None |
| Definitions | The folder with a help page per error | None |
Error codes file
The error codes file maps each error number to a name, in the same way as any map file. These lines are from the stock errors/errors.json:
{
"0": "SYSTEM_OK",
"100": "WA_SYSTEM_WARNING",
"101": "WA_REALTIME_VIOLATION",
"700": "SD_SYSTEM_ERROR"
}
The prefix of each name is its level in the stock file: WA for a warning, SD for a shutdown.
Definitions
The definitions folder holds one HTML page per error, named after its number: error101.html for error 101. The stock package keeps them in errors/definitions/. A page from it:
<h1>101: Warning Realtime Violation</h1>
<h2>Description</h2>
<p>A realtime task has violated the timing constraints once.</p>
Add a default.html for errors that have no page of their own. The stock one reads:
<h1>No error description available.</h1>
<p>Please consult the troubleshooting manual for more information.</p>
These settings feed the state indicator in the screens bar: which parameter holds the state, and which file turns its number into a name. Open the section with States.
| Field | What it does | Default |
|---|---|---|
| path | The parameter with the state number | root/Logic/state |
| frequency divider | Reduces how often the value is sent: the controller’s update rate is divided by this number | 1000 |
| state codes | The JSON file that names each state number | None |
State codes file
The state codes file is a map file from state number to name. For the robot application, these are its states, from logic/lgc_motion_def.h in the robot application source:
{
"0": "Init",
"1": "Off",
"2": "Idle",
"3": "Paused",
"4": "Engaged",
"5": "Homing",
"6": "Forced idle",
"7": "Emergency stop",
"102": "OFF_TO_IDLE_T",
"201": "IDLE_TO_OFF_T",
"204": "IDLE_TO_ENGAGED_T",
"302": "PAUSED_TO_IDLE_T",
"403": "ENGAGED_TO_PAUSED_T",
"600": "TO_FORCEDIDLE_T",
"602": "RESET_FORCEDIDLE_T",
"700": "TO_ESTOP_T",
"701": "RESET_ESTOP_T"
}
The three-digit numbers are the transitions between two states, which the state parameter shows while the machine changes state: 204 goes from idle (2) to engaged (4).
This setting feeds the Logs list of the error handler screen, which shows what the application reports while it runs. Open the section with Logs.
| Field | What it does | Default |
|---|---|---|
| path | The parameter with the log output | root/logger/logOut |
A Motorcortex application publishes its log messages on logOut of its logger task, which is root/logger/logOut in the robot application.
These settings apply to the screen you are editing, except the size and the colours, which apply to all screens. Open the section with Screen.
| Field | What it does | Default |
|---|---|---|
| title | The name on the screen’s button in the screens bar | screen 1, screen 2 and so on |
| start screen | The screen the interface opens with. It applies to the whole interface | Not set |
| delete | Deletes the selected screen, after you confirm it | |
| visibility | A parameter that decides whether the screen is shown. Leave it empty to always show it. The start screen cannot have one | Empty |
| channel | The element of the visibility parameter, if it is an array | 0 |
| expression | The condition on the value, called x, for example x>0. Use & and | to combine conditions |
Empty |
| freq divider | Reduces how often the values on this screen are sent: the controller’s update rate is divided by this number | 100 |
| group | A group name for the parameters of this screen | Empty |
| W | Width of all screens, in pixels | 800 |
| H | Height of all screens, in pixels | 600 |
| foreground | Foreground colour of all screens | #313c4f |
| background | Background colour of all screens | #282f3a |
How visibility works, with an example from a stock interface, is described on the Screens page.
The raster is a pattern of lines on the canvas that helps you line up widgets. It only shows in the editor, not in the preview or the finished interface. Open the section with Raster.
| Field | What it does | Default |
|---|---|---|
| color | The colour of the raster lines | #282f3a |
| W | The width of a raster cell, in pixels | 30 |
| H | The height of a raster cell, in pixels | 30 |
| show | Shows the raster | On |
| snap | Makes widgets snap to the raster | On |