Files
Stream_PHX_A7/Gateways/FE/projects/.resources/a11de1577cdeb480b85a055e54522de5236fb2aed7b45e814e46ffc78bf2e6ea

274 lines
8.3 KiB
Plaintext

{
"custom": {
"allTags": [
{
"dataType": "Boolean",
"instancePosition": {},
"instanceStyle": {
"classes": ""
},
"name": "Cfg_Target"
}
]
},
"params": {
"auth": {
"almAck": true,
"almShelve": true,
"config": true,
"control": true
},
"tagPath": "[Ignition_Common_IO_Gtwy]Yard/SATB1_YARD_UT-HS1"
},
"propConfig": {
"custom.allTags": {
"binding": {
"config": {
"struct": {
"tagPath": "{view.params.tagPath} + \"/Config\""
},
"waitOnAll": true
},
"transforms": [
{
"code": "\toutput \u003d []\n\ttry:\n\t\t# Simulate fetching tag configurations and sorting by name\n\t\tnodes \u003d system.tag.getConfiguration(value[\u0027tagPath\u0027], True)\n\t\tfor item in nodes:\n\t\t if \u0027tags\u0027 in item:\n\t\t \tsortedTags \u003d sorted(item[\u0027tags\u0027], key\u003dlambda x: x[\u0027name\u0027])\n\t\t \tsortedTags \u003d sorted(sortedTags, key\u003dlambda x: x.get(\u0027engUnit\u0027, \u0027misc\u0027) if x.get(\u0027engUnit\u0027, \u0027misc\u0027) !\u003d \"\" else \u0027misc\u0027)\n\t\t \t\n\t for tagConfig in sortedTags:\n\t if str(tagConfig[\u0027tagType\u0027]) \u003d\u003d \u0027AtomicTag\u0027:\n\t name \u003d tagConfig.get(\"name\", \"\")\n\t dataType \u003d tagConfig.get(\"dataType\", \"\")\n\t tagPath \u003d value[\u0027tagPath\u0027] + \u0027/\u0027 + name\n\t instance \u003d {\n\t \"instanceStyle\": {\n\t \"classes\": \"\"\n\t },\n\t \"instancePosition\": {},\n\t \"name\": name,\n\t \"dataType\": dataType\n\t }\n\t # Group based on name containing \u0027Power\u0027, \u0027Current\u0027, or \u0027Voltage\u0027\n\t output.append(instance)\n\t\t\n\t\t# Return or process the sorted output\n\t\treturn output\n\texcept:\n\t\treturn output",
"type": "script"
}
],
"type": "expr-struct"
},
"persistent": true
},
"params.auth": {
"paramDirection": "input",
"persistent": true
},
"params.tagPath": {
"paramDirection": "input",
"persistent": true
}
},
"props": {},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label",
"tooltip": {
"enabled": true,
"text": "Normal state controls how the alarm react. It will alarm when state is different from normal state value."
}
},
"position": {
"basis": "200px"
},
"props": {
"text": "Switch1 Normal State:"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_0"
},
"props": {
"style": {
"textAlign": "right"
},
"text": "NO"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "ToggleSwitch"
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"path": "view.params.auth.config"
},
"type": "property"
}
},
"props.selected": {
"binding": {
"config": {
"bidirectional": true,
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/Source 1 Switch/Config/Target"
},
"type": "tag"
}
}
},
"props": {
"style": {
"classes": "tglswch"
}
},
"type": "ia.input.toggle-switch"
},
{
"meta": {
"name": "Label_1"
},
"props": {
"text": "NC"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Sw1 Normal State"
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "FlexRepeater"
},
"position": {
"basis": "100%",
"display": false
},
"propConfig": {
"props.instances": {
"binding": {
"config": {
"struct": {
"allTags": "{view.custom.allTags}",
"tagPath": "{view.params.tagPath} + \"/Config\""
},
"waitOnAll": true
},
"transforms": [
{
"code": "\toutput \u003d []\n\tallTags \u003d system.util.jsonDecode(system.util.jsonEncode(value[\u0027allTags\u0027]))\n\t\n\tfor tag in allTags:\n\t\ttagName \u003d tag[\"name\"]\n\t\ttag[\"tagPath\"] \u003d value[\"tagPath\"] + \"/\" +tagName\n\t\toutput.append(tag)\n\t\t\n\treturn output",
"type": "script"
}
],
"type": "expr-struct"
}
}
},
"props": {
"alignContent": "flex-start",
"elementPosition": {
"basis": "50%",
"grow": 0
},
"loading": {
"order": "with-parent"
},
"path": "Library/Framework/Tag Config",
"style": {
"border": "1px solid var(--border)",
"gap": "10px 0",
"padding": "10px"
},
"useDefaultViewHeight": false,
"useDefaultViewWidth": false,
"wrap": "wrap"
},
"type": "ia.display.flex-repeater"
},
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "200px"
},
"props": {
"text": "Switch2 Normal State:"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_0"
},
"props": {
"style": {
"textAlign": "right"
},
"text": "NO"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "ToggleSwitch"
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"path": "view.params.auth.config"
},
"type": "property"
}
},
"props.selected": {
"binding": {
"config": {
"bidirectional": true,
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/Source 2 Switch/Config/Target"
},
"type": "tag"
}
}
},
"props": {
"style": {
"classes": "tglswch"
}
},
"type": "ia.input.toggle-switch"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "50px"
},
"props": {
"text": "NC"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "containers/padded-container"
}
},
"type": "ia.container.flex"
}
}