393 lines
11 KiB
Plaintext
393 lines
11 KiB
Plaintext
{
|
|
"custom": {},
|
|
"params": {
|
|
"enableTooltip": true,
|
|
"label": null,
|
|
"tagPath": "",
|
|
"tagPathControl": "",
|
|
"view": ""
|
|
},
|
|
"propConfig": {
|
|
"params.enableTooltip": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.label": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.tagPath": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.tagPathControl": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.view": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 40,
|
|
"width": 135
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\tself.parent.openWindow()"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Status"
|
|
},
|
|
"position": {
|
|
"height": "100%",
|
|
"width": "100%"
|
|
},
|
|
"propConfig": {
|
|
"props.style.backgroundColor": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"tagPath": "{view.params.tagPath}"
|
|
},
|
|
"tagPath": "{tagPath}.jsonValues"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "try(\r\n\tif(jsonGet({value}, \"Estop_Active\") \u0026\u0026 {[default]Gateway/ToggleTag},\r\n\t\t\"#F00\",\t\t// Estop\r\n\t\tif(jsonGet({value}, \"bStarted\"),\r\n\t\t\t\"#0F0\",\t// Running\r\n\t\t\t\"#AAA\"\t// Stopped\r\n\t\t)\r\n\t),\r\n\t\"#808080\" // Unknown\r\n)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"borderColor": "#000",
|
|
"borderStyle": "solid",
|
|
"borderWidth": 1
|
|
}
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\tself.parent.openWindow()"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Text"
|
|
},
|
|
"position": {
|
|
"height": "calc(100% - 10px)",
|
|
"width": "calc(100% - 10px)",
|
|
"x": 5,
|
|
"y": 5
|
|
},
|
|
"propConfig": {
|
|
"props.text": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"tagPath": "{view.params.tagPath}"
|
|
},
|
|
"tagPath": "{tagPath}/Parameters.LabelFull"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({view.params.label}, {value}, \"Unknown\")",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"backgroundColor": "#FFF",
|
|
"borderColor": "#000",
|
|
"borderStyle": "solid",
|
|
"borderWidth": 1,
|
|
"fontSize": "12px",
|
|
"fontWeight": "bold",
|
|
"overflow": "hidden",
|
|
"paddingLeft": "5px",
|
|
"textOverflow": "ellipsis",
|
|
"textTransform": "uppercase",
|
|
"user-select": "none",
|
|
"whiteSpace": "nowrap"
|
|
}
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\tself.parent.openWindow()"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "TooltipOverlay"
|
|
},
|
|
"position": {
|
|
"height": "100%",
|
|
"width": "100%"
|
|
},
|
|
"propConfig": {
|
|
"meta.visible": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.params.enableTooltip"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.status.tooltip": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"tagPath": "{view.params.tagPath}"
|
|
},
|
|
"tagPath": "{tagPath}/Graphics"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "if(isGood({value}),\r\n\tjsonGet({value}, \"tooltip\"),\r\n\t\"Tooltip not configured\"\r\n)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"status": {}
|
|
},
|
|
"type": "dex.display.tooltipoverlay"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\ttagPath \u003d self.view.params.tagPathControl\n\tif tagPath \u003c\u003e \"\":\n\t\ttags \u003d [tagPath + \"/SetStart\"]\n\t\tvalues \u003d [1]\n\t\tsystem.tag.writeAsync(tags, values)"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Start"
|
|
},
|
|
"position": {
|
|
"height": 25,
|
|
"width": 25,
|
|
"x": "calc(100% - 60px)",
|
|
"y": "calc(50% - 12.5px)"
|
|
},
|
|
"propConfig": {
|
|
"props.enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"tagPathControl": "{view.params.tagPathControl}"
|
|
},
|
|
"tagPath": "{tagPathControl}/SetStart"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "isGood({value})",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
},
|
|
"props.textStyle.color": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"tagPathControl": "{view.params.tagPathControl}"
|
|
},
|
|
"tagPath": "{tagPathControl}/Alarms/bStarted"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value}, false)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"fallback": "#888888",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": true,
|
|
"output": "#32CD32"
|
|
}
|
|
],
|
|
"outputType": "color",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"classes": "Buttons/Grey"
|
|
},
|
|
"text": "►",
|
|
"textStyle": {
|
|
"fontFamily": "Arial",
|
|
"fontSize": "14px"
|
|
}
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\ttagPath \u003d self.view.params.tagPathControl\n\tif tagPath \u003c\u003e \"\":\n\t\ttags \u003d [tagPath + \"/SetStop\"]\n\t\tvalues \u003d [1]\n\t\tsystem.tag.writeAsync(tags, values)"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Stop"
|
|
},
|
|
"position": {
|
|
"height": 25,
|
|
"width": 25,
|
|
"x": "calc(100% - 32.5px)",
|
|
"y": "calc(50% - 12.5px)"
|
|
},
|
|
"propConfig": {
|
|
"props.enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"tagPathControl": "{view.params.tagPathControl}"
|
|
},
|
|
"tagPath": "{tagPathControl}/SetStop"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "isGood({value})",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
},
|
|
"props.textStyle.color": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"tagPathControl": "{view.params.tagPathControl}"
|
|
},
|
|
"tagPath": "{tagPathControl}/Alarms/bStarted"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value}, true)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"fallback": "#888888",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": false,
|
|
"output": "#FF0000"
|
|
}
|
|
],
|
|
"outputType": "color",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"classes": "Buttons/Grey"
|
|
},
|
|
"text": "■",
|
|
"textStyle": {
|
|
"fontFamily": "monospace",
|
|
"fontSize": "14px"
|
|
}
|
|
},
|
|
"type": "ia.input.button"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"cursor": "pointer"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [
|
|
{
|
|
"name": "openWindow",
|
|
"params": [],
|
|
"script": "\tview \u003d self.view.params.view\n\tif view in [\"\", None]:\n\t\tview \u003d \"Windows/Graphics/\"+self.getChild(\"Text\").props.text.replace(\" \", \"_\")\n\t# Open window:\n\twindow \u003d \"Windows/GraphicsWrapper\"\n\tparams \u003d {\"view\": view}\n\tsystem.perspective.navigate(\"/\")\n\tsystem.perspective.navigate(view\u003dwindow, params\u003dparams)"
|
|
}
|
|
],
|
|
"messageHandlers": []
|
|
},
|
|
"type": "ia.container.coord"
|
|
}
|
|
} |