BNA8/.resources/1dafeda7a0e18e77a1e223af3d46121f97007a03d1666d607f63e461fb213a1e

395 lines
11 KiB
Plaintext

{
"custom": {
"hasControls": null,
"isRunning": false
},
"params": {
"label": "System",
"tagPath": "[default]SystemStatus",
"tagPaths": [],
"view": "Windows/Graphics/Overview"
},
"propConfig": {
"custom.hasControls": {
"binding": {
"config": {
"expression": "// Force refresh:\r\nif(now(1000)\u003dnow(1000),\r\n\t{view.params.tagPaths},\r\n\t{view.params.tagPaths}\r\n)"
},
"transforms": [
{
"code": "\ttags \u003d [tagPath + \"/SetStart.Quality\" for tagPath in value] + [tagPath + \"/SetStop.Quality\" for tagPath in value]\n\tqualities \u003d [v.getQuality() for v in system.tag.readBlocking(tags)]\n\tqualities \u003d [v \u003d\u003d v.Good for v in qualities]\n\treturn any(qualities) and len(qualities) \u003e 0",
"type": "script"
}
],
"type": "expr"
},
"persistent": true
},
"custom.isRunning": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/bStarted"
},
"type": "tag"
},
"persistent": true
},
"params.label": {
"paramDirection": "input",
"persistent": true
},
"params.tagPath": {
"paramDirection": "input",
"persistent": true
},
"params.tagPaths": {
"paramDirection": "input",
"persistent": true
},
"params.tagPaths[0]": {
"paramDirection": "input",
"persistent": true
},
"params.tagPaths[1]": {
"paramDirection": "input",
"persistent": true
},
"params.tagPaths[2]": {
"paramDirection": "input",
"persistent": true
},
"params.tagPaths[3]": {
"paramDirection": "input",
"persistent": true
},
"params.view": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 40,
"width": 125
}
},
"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": "if({view.params.label} \u003d None || {view.params.label} \u003d \"\",\r\n\t{value},\r\n\t{view.params.label}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"backgroundColor": "#FFF",
"borderColor": "#000",
"borderStyle": "solid",
"borderWidth": 1,
"fontFamily": "var(--font-NotoSans)",
"fontSize": "12px",
"fontWeight": "bold",
"paddingLeft": "5px",
"textTransform": "uppercase",
"user-select": "none"
}
},
"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": {
"props.status.tooltip": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/Graphics"
},
"transforms": [
{
"expression": "//\"System\u003cbr\u003eStatus: \"+if({view.custom.hasControls}, if({view.custom.isRunning}, \"Running\", \"Stopped\"), \"Unknown\")\r\njsonGet({value}, \"tooltip\")",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"status": {}
},
"type": "dex.display.tooltipoverlay"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPaths \u003d self.view.params.tagPaths\n\tif len(tagPaths) \u003e 0:\n\t\ttags \u003d [tagPath + \"/SetStart\" for tagPath in tagPaths]\n\t\tvalues \u003d [1]*len(tagPaths)\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": {
"path": "view.custom.hasControls"
},
"type": "property"
}
},
"props.textStyle.color": {
"binding": {
"config": {
"path": "view.custom.isRunning"
},
"transforms": [
{
"expression": "if(isGood({value}), {value}, \"\")",
"type": "expression"
},
{
"fallback": "#888888",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#32CD32"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Buttons/Grey"
},
"text": "►",
"textStyle": {
"fontFamily": "Arial",
"fontSize": "14px"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPaths \u003d self.view.params.tagPaths\n\tif len(tagPaths) \u003e 0:\n\t\ttags \u003d [tagPath + \"/SetStop\" for tagPath in tagPaths]\n\t\tvalues \u003d [1]*len(tagPaths)\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": {
"path": "view.custom.hasControls"
},
"type": "property"
}
},
"props.textStyle.color": {
"binding": {
"config": {
"path": "view.custom.isRunning"
},
"transforms": [
{
"expression": "if(isGood({value}), {value}, \"\")",
"type": "expression"
},
{
"fallback": "#888888",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"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)"
}
],
"extensionFunctions": null,
"messageHandlers": []
},
"type": "ia.container.coord"
}
}