Fixed CPU overload
This commit is contained in:
parent
72a826aa0d
commit
33c3e2257c
@ -464,15 +464,45 @@
|
|||||||
"props.text": {
|
"props.text": {
|
||||||
"binding": {
|
"binding": {
|
||||||
"config": {
|
"config": {
|
||||||
"path": "this.props.text"
|
"fallbackDelay": 2.5,
|
||||||
|
"mode": "indirect",
|
||||||
|
"references": {
|
||||||
|
"0": "{view.params.tagProps[0]}",
|
||||||
|
"fc": "{session.custom.fc}"
|
||||||
|
},
|
||||||
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Alarm/Full"
|
||||||
},
|
},
|
||||||
"transforms": [
|
"transforms": [
|
||||||
{
|
{
|
||||||
"code": "\tprovider \u003d self.session.custom.fc + \"_SCADA_TAG_PROVIDER\"\n\tbaseTag \u003d self.view.params.tagProps[0]\n\tbasePath \u003d \"[\" + provider + \"]\" + baseTag\n\t\n\t# Choose correct alarm type based on tag name\n\tif \"TPE\" in baseTag or \"JPE\" in baseTag:\n\t fullPath \u003d basePath + \"/Alarm/Jammed\"\n\telse:\n\t fullPath \u003d basePath + \"/Alarm/Full\"\n\t\n\t# Read tag value\n\ttag \u003d system.tag.readBlocking([fullPath])[0]\n\t\n\t# Return \"TRUE\"/\"FALSE\" as string\n\tif not tag.quality.isGood():\n\t return \"UNKNOWN\"\n\t\n\tif bool(tag.value):\n\t return \"TRUE\"\n\telse:\n\t return \"FALSE\"",
|
"expression": "coalesce({value},{view.params.forceFaultStatus},\"UNKNOWN\")",
|
||||||
"type": "script"
|
"type": "expression"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fallback": "UNKNOWN",
|
||||||
|
"inputType": "scalar",
|
||||||
|
"mappings": [
|
||||||
|
{
|
||||||
|
"input": 1,
|
||||||
|
"output": "FULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": 0,
|
||||||
|
"output": "NOT FULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": true,
|
||||||
|
"output": "FULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": false,
|
||||||
|
"output": "NOT JAMMED"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputType": "scalar",
|
||||||
|
"type": "map"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "property"
|
"type": "tag"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"props.textStyle.color": {
|
"props.textStyle.color": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user