From 33c3e2257c1bee127518e482cb07e0a8cf2c5a23 Mon Sep 17 00:00:00 2001 From: "gigi.mamaladze" Date: Wed, 15 Oct 2025 04:19:30 +0400 Subject: [PATCH] Fixed CPU overload --- .../view.json | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-StatusNonPowered/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-StatusNonPowered/view.json index e40589e..c67c837 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-StatusNonPowered/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-StatusNonPowered/view.json @@ -464,15 +464,45 @@ "props.text": { "binding": { "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": [ { - "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\"", - "type": "script" + "expression": "coalesce({value},{view.params.forceFaultStatus},\"UNKNOWN\")", + "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": {