249 lines
6.5 KiB
Plaintext
249 lines
6.5 KiB
Plaintext
{
|
|
"custom": {},
|
|
"params": {
|
|
"value": {
|
|
"tagProps": [
|
|
"",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value"
|
|
]
|
|
}
|
|
},
|
|
"propConfig": {
|
|
"params.value": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 50,
|
|
"width": 300
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\tnavigation.navigate_to_page.detailed_view(self, self.view.params.value.tagProps[0],self.view.params.value.tagProps[0], self.view.params.value.tagProps[3])"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"custom.status": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "/root.custom.status"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.status"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "State-Styles/State0",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 1,
|
|
"output": "State-Styles/Background-Fill/State1"
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": "State-Styles/Background-Fill/State2"
|
|
},
|
|
{
|
|
"input": 3,
|
|
"output": "State-Styles/Background-Fill/State3"
|
|
},
|
|
{
|
|
"input": 4,
|
|
"output": "State-Styles/Background-Fill/State4"
|
|
},
|
|
{
|
|
"input": 5,
|
|
"output": "State-Styles/Background-Fill/State5"
|
|
},
|
|
{
|
|
"input": 6,
|
|
"output": "State-Styles/Background-Fill/State6"
|
|
},
|
|
{
|
|
"input": 0,
|
|
"output": "State-Styles/State0"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
},
|
|
{
|
|
"expression": "if({session.custom.colours.colour_impaired},{value}+\u0027_Alt\u0027,{value})",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.text": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.status"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": null,
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 5,
|
|
"output": "HEALTHY"
|
|
},
|
|
{
|
|
"input": 4,
|
|
"output": "DIAGNOSTIC"
|
|
},
|
|
{
|
|
"input": 3,
|
|
"output": "PROCESS DEGRADED"
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": "STOPPED"
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": "FAULTED"
|
|
},
|
|
{
|
|
"input": 6,
|
|
"output": null
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"borderColor": "#555555",
|
|
"borderStyle": "none",
|
|
"cursor": "pointer",
|
|
"marginBottom": 8,
|
|
"marginTop": 8
|
|
},
|
|
"textStyle": {
|
|
"fontSize": 12,
|
|
"textAlign": "center"
|
|
}
|
|
},
|
|
"type": "ia.display.label"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"propConfig": {
|
|
"custom.has_role": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{session.custom.fc}"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\trme_role \u003d value +\"-rme-all\"\n\troles \u003d (self.session.props.auth.user.roles)\n\tif (rme_role.lower() in roles \n\tor rme_role.upper() in roles):\n\t\treturn True\n\telse:\n\t\treturn False",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"custom.status": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"0": "{view.params.value.tagProps[0]}",
|
|
"fc": "{session.custom.fc}"
|
|
},
|
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "if(isNull({value}), 0, {value})",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"fallback": null,
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 4,
|
|
"output": 1
|
|
},
|
|
{
|
|
"input": 3,
|
|
"output": 2
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": 3
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": 4
|
|
},
|
|
{
|
|
"input": 0,
|
|
"output": 5
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
},
|
|
"custom.tag_path_to_lookup": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": " \"[\\\"\" + {view.params.value.tagProps[0]} + \"\\\"]\""
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"direction": "column"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
} |