Device Control Panel Overview
Device Control Panel shows hierarchical representation of devices and nodes and can be customized per instrument. Each item in the hierarchy represents a device, node, or container section.
Each device/node item is shown in display mode, by default, for compactness’ sake. When the users click on any of the devices/nodes, the view changes into a control view allowing the user to move or dryrun devices and nodes.
Here is an example for a typical representation for a device. If device has a primary node, its current and target values are be displayed in a manner showed below.
Display mode:
Control mode:
In control mode, you can also view the rest of the properties that belong to the device by clicking the […] button.
| Every property (device node) also has meta properties that can be changed by clicking the double error button |
|
Depending on the setup, the users may be able to change units, precision, and whether the node can actually allowed to be moved.
Customizing Device Control Panel
Device Control Panel represents a collection of devices and nodes that can be hierarchically organized based on scientists’ needs. The hierarchy itself is stored in a json file called device_hierarchy.json. Every instrument has its own version and is stored under “instrument_configs” folder in our code base. For example for bt7 instrument, the file is located at:
instrument_configs/bt7/device_hierarchy.json.
If you look at the contents of the file, you might get a bit overwhelmed trying to modify it. For that reason, I have created a utility that allows you to update the contents of the file programmatically. This way, the users don’t have to deal with json format.
|
JsonTreeNode rootNode = new JsonTreeNode("Devices"); |
4. Here is the corresponding json structure:
|
{ "nodeID": "Devices", "children": { "elementClass": "nice.general.json.JsonTreeNode", "elements": [ { "nodeID": "DFM System", "children": { "elementClass": "nice.general.json.JsonTreeNode", "elements": [ { "nodeID": "ei", "children": { "elementClass": "java.lang.Object", "elements": [] }, "isDevice": false }, { "nodeID": "monoTheta", "children": { "elementClass": "java.lang.Object", "elements": [] }, "isDevice": true, "widgetClass": "nice.client.swing.panels.device.MonoThetaNodeControlComponent" }, |
5. Here is an example of how it might actually look on a real instrument: