From c0d785bea03b5c9850c97f8dbb867fee088b659e Mon Sep 17 00:00:00 2001 From: beka makharadze Date: Wed, 9 Jul 2025 17:15:24 +0400 Subject: [PATCH] Update CommandControl page --- .../Information-Docked-East-MCM/view.json | 22 +- .../CommandControlActions/view.json | 282 ++++++++++++++++-- .../CommandControlAlarms/view.json | 50 ++-- 3 files changed, 299 insertions(+), 55 deletions(-) diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-MCM/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-MCM/view.json index 8d0ce2f..1905b88 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-MCM/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Controller-Equipment/Information-Docked-East-MCM/view.json @@ -2459,7 +2459,7 @@ "0": "{view.params.tagProps[0]}", "fc": "{session.custom.fc}" }, - "tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Motor_Fault_Reset_PB" + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Motor_Fault_Reset_PB_STATE" }, "transforms": [ { @@ -2491,7 +2491,7 @@ "image": { "icon": { "color": "#000000", - "path": "material/sync_problem" + "path": "material/refresh" } }, "style": { @@ -2597,7 +2597,7 @@ "image": { "icon": { "color": "#000000", - "path": "material/sync_problem" + "path": "material/power" } }, "style": { @@ -2671,7 +2671,7 @@ "0": "{view.params.tagProps[0]}", "fc": "{session.custom.fc}" }, - "tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Low_Air_Pressure_Reset_PB" + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Low_Air_Pressure_Reset_PB_STATE" }, "transforms": [ { @@ -2702,7 +2702,7 @@ "props": { "image": { "icon": { - "path": "material/sync_problem" + "path": "material/waves" } }, "style": { @@ -2785,8 +2785,12 @@ "inputType": "scalar", "mappings": [ { - "input": 1, + "input": 2, "output": "JAM RESTART PRESSED" + }, + { + "input": 4, + "output": "" } ], "outputType": "scalar", @@ -2900,6 +2904,12 @@ } }, "props": { + "image": { + "icon": { + "color": "#000000", + "path": "material/speed" + } + }, "style": { "classes": "Background-Styles/Controller" }, diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlActions/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlActions/view.json index ff7215a..d782399 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlActions/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlActions/view.json @@ -3,7 +3,7 @@ "params": { "value": { "tagProps": [ - "", + "MCM01", "value", "value", "value", @@ -35,7 +35,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Start_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" + "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Start_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])\n\t" }, "scope": "G", "type": "script" @@ -72,11 +72,47 @@ "props.image.icon.color": { "binding": { "config": { - "expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)" + "expression": "if({this.props.enabled},\u0027#FFFFFF\u0027,\u0027#979797\u0027)" }, "type": "expr" } }, + "props.style.backgroundColor": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "0": "{view.params.value.tagProps[0]}", + "fc": "{session.custom.fc}" + }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Start_PB_STATE" + }, + "transforms": [ + { + "expression": "coalesce({value},{view.params.forceFaultStatus},0)", + "type": "expression" + }, + { + "fallback": "#00A700", + "inputType": "scalar", + "mappings": [ + { + "input": 2, + "output": "#41E841" + }, + { + "input": 4, + "output": "#41E841" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "tag" + } + }, "props.style.borderStyle": { "binding": { "config": { @@ -96,7 +132,6 @@ "width": 32 }, "style": { - "backgroundColor": "#D4D4D4", "borderColor": "#4A4A4A", "borderWidth": 2, "classes": "\n", @@ -107,6 +142,7 @@ }, "text": "", "textStyle": { + "color": "#000000", "fontSize": 12, "fontWeight": "bold", "textAlign": "center" @@ -119,7 +155,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Stop_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" + "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Stop_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" }, "scope": "G", "type": "script" @@ -156,11 +192,43 @@ "props.image.icon.color": { "binding": { "config": { - "expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)" + "expression": "if({this.props.enabled},\u0027#FFFFFF\u0027,\u0027#979797\u0027)" }, "type": "expr" } }, + "props.style.backgroundColor": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "0": "{view.params.value.tagProps[0]}", + "fc": "{session.custom.fc}" + }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Stop_PB" + }, + "transforms": [ + { + "expression": "coalesce({value},{view.params.forceFaultStatus},0)", + "type": "expression" + }, + { + "fallback": "#CA0D0D", + "inputType": "scalar", + "mappings": [ + { + "input": 1, + "output": "#FF0000" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "tag" + } + }, "props.style.borderStyle": { "binding": { "config": { @@ -180,7 +248,6 @@ "width": 32 }, "style": { - "backgroundColor": "#D4D4D4", "borderColor": "#4A4A4A", "borderWidth": 2, "classes": "\n", @@ -203,7 +270,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Motor_Fault_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" + "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Motor_Fault_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" }, "scope": "G", "type": "script" @@ -240,11 +307,47 @@ "props.image.icon.color": { "binding": { "config": { - "expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)" + "expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)" }, "type": "expr" } }, + "props.style.backgroundColor": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "0": "{view.params.value.tagProps[0]}", + "fc": "{session.custom.fc}" + }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Motor_Fault_Reset_PB_STATE" + }, + "transforms": [ + { + "expression": "coalesce({value},{view.params.forceFaultStatus},0)", + "type": "expression" + }, + { + "fallback": "#DCDC03", + "inputType": "scalar", + "mappings": [ + { + "input": 2, + "output": "#FCFF86" + }, + { + "input": 4, + "output": "#FCFF86" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "tag" + } + }, "props.style.borderStyle": { "binding": { "config": { @@ -264,7 +367,6 @@ "width": 32 }, "style": { - "backgroundColor": "#D4D4D4", "borderColor": "#4A4A4A", "borderWidth": 2, "classes": "\n", @@ -287,7 +389,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Power_Branch_Fault_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" + "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Power_Branch_Fault_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" }, "scope": "G", "type": "script" @@ -324,11 +426,47 @@ "props.image.icon.color": { "binding": { "config": { - "expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)" + "expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)" }, "type": "expr" } }, + "props.style.backgroundColor": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "0": "{view.params.value.tagProps[0]}", + "fc": "{session.custom.fc}" + }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Power_Branch_Fault_Reset_PB_STATE" + }, + "transforms": [ + { + "expression": "coalesce({value},{view.params.forceFaultStatus},0)", + "type": "expression" + }, + { + "fallback": "#DCDC03", + "inputType": "scalar", + "mappings": [ + { + "input": 2, + "output": "#FCFF86" + }, + { + "input": 4, + "output": "#FCFF86" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "tag" + } + }, "props.style.borderStyle": { "binding": { "config": { @@ -348,7 +486,6 @@ "width": 32 }, "style": { - "backgroundColor": "#D4D4D4", "borderColor": "#4A4A4A", "borderWidth": 2, "classes": "\n", @@ -371,7 +508,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Low_Air_Pressure_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" + "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Low_Air_Pressure_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" }, "scope": "G", "type": "script" @@ -408,11 +545,47 @@ "props.image.icon.color": { "binding": { "config": { - "expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)" + "expression": "if({this.props.enabled},\u0027#FFFFFF\u0027,\u0027#979797\u0027)" }, "type": "expr" } }, + "props.style.backgroundColor": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "0": "{view.params.value.tagProps[0]}", + "fc": "{session.custom.fc}" + }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Low_Air_Pressure_Reset_PB_STATE" + }, + "transforms": [ + { + "expression": "coalesce({value},{view.params.forceFaultStatus},0)", + "type": "expression" + }, + { + "fallback": "#0A0AA4", + "inputType": "scalar", + "mappings": [ + { + "input": 2, + "output": "#5D5DFF" + }, + { + "input": 4, + "output": "#5D5DFF" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "tag" + } + }, "props.style.borderStyle": { "binding": { "config": { @@ -432,7 +605,6 @@ "width": 32 }, "style": { - "backgroundColor": "#D4D4D4", "borderColor": "#4A4A4A", "borderWidth": 2, "classes": "\n", @@ -455,7 +627,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Jam_Restart_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" + "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Jam_Restart_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])" }, "scope": "G", "type": "script" @@ -492,11 +664,47 @@ "props.image.icon.color": { "binding": { "config": { - "expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)" + "expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)" }, "type": "expr" } }, + "props.style.backgroundColor": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "0": "{view.params.value.tagProps[0]}", + "fc": "{session.custom.fc}" + }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Jam_Restart_PB_STATE" + }, + "transforms": [ + { + "expression": "coalesce({value},{view.params.forceFaultStatus},0)", + "type": "expression" + }, + { + "fallback": "#D4D4D4", + "inputType": "scalar", + "mappings": [ + { + "input": 4, + "output": "#FFFFFF" + }, + { + "input": 2, + "output": "#FFFFFF" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "tag" + } + }, "props.style.borderStyle": { "binding": { "config": { @@ -516,7 +724,6 @@ "width": 32 }, "style": { - "backgroundColor": "#D4D4D4", "borderColor": "#4A4A4A", "borderWidth": 2, "classes": "\n", @@ -539,7 +746,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Setup_Motor_Speeds\"\n\tsystem.tag.writeBlocking([tag_path],[True])" + "script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Setup_Motor_Speeds\"\n\tsystem.tag.writeBlocking([tag_path],[True])" }, "scope": "G", "type": "script" @@ -576,11 +783,43 @@ "props.image.icon.color": { "binding": { "config": { - "expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)" + "expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)" }, "type": "expr" } }, + "props.style.backgroundColor": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "0": "{view.params.value.tagProps[0]}", + "fc": "{session.custom.fc}" + }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Setup_Motor_Speeds" + }, + "transforms": [ + { + "expression": "coalesce({value},{view.params.forceFaultStatus},0)", + "type": "expression" + }, + { + "fallback": "#D4D4D4", + "inputType": "scalar", + "mappings": [ + { + "input": 1, + "output": "#FFFFFF" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "tag" + } + }, "props.style.borderStyle": { "binding": { "config": { @@ -600,7 +839,6 @@ "width": 32 }, "style": { - "backgroundColor": "#D4D4D4", "borderColor": "#4A4A4A", "borderWidth": 2, "classes": "\n", diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlAlarms/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlAlarms/view.json index 1e09026..479275f 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlAlarms/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Controller-Views/CommandControlAlarms/view.json @@ -3,34 +3,32 @@ "counts": { "Critical": 0, "Diagnostic": 0, - "High": 0, - "Low": 0, + "High": 1, + "Low": 1, "Medium": 0, - "Total": 0 + "Total": 2 }, "totalAlarms": { "$": [ "ds", 192, - 1751448128142 + 1752066852881 ], "$columns": [ { "data": [ + null, "MCM01", - "MCM01", - "MCM01", - "MCM02" + "MCM01" ], "name": "Location", "type": "String" }, { "data": [ - "Diagnostic", + "Low", "High", - "Medium", - "Diagnostic" + "Low" ], "name": "Priority", "type": "String" @@ -38,7 +36,6 @@ { "data": [ 1, - 2, 1, 1 ], @@ -51,7 +48,7 @@ "params": { "value": { "tagProps": [ - "", + "MCM01", "value", "value", "value", @@ -66,35 +63,34 @@ }, "propConfig": { "custom.counts": { - "binding": { - "config": { - "struct": { - "PLC": "{view.params.value.tagProps[0]}" - }, - "waitOnAll": true - }, - "transforms": [ - { - "code": " MCM \u003d value.PLC\n queryData \u003d self.custom.totalAlarms\n\n # Initialize counts\n counts \u003d {\n \"Critical\": 0,\n \"High\": 0,\n \"Medium\": 0,\n \"Low\": 0,\n \"Diagnostic\": 0,\n \"Total\": 0\n }\n\n # Loop through dataset and aggregate\n for row in range(queryData.rowCount):\n mcm_val \u003d queryData.getValueAt(row, 0)\n severity \u003d queryData.getValueAt(row, 1)\n count \u003d queryData.getValueAt(row, 2)\n\n if mcm_val \u003d\u003d MCM:\n \n key \u003d severity.capitalize()\n if key in counts:\n counts[key] +\u003d count\n counts[\"Total\"] +\u003d count\n\n return counts", - "type": "script" - } - ], - "type": "expr-struct" - }, "persistent": true }, "custom.totalAlarms": { "binding": { "config": { + "polling": { + "enabled": true, + "rate": "3" + }, "queryPath": "GetActiveAlarmsByLocationAndPriority" }, "type": "query" }, + "onChange": { + "enabled": null, + "script": "\tMCM \u003d self.params.value.tagProps[0]\n\tqueryData \u003d currentValue.value\n\t\n\t# Initialize counts\n\tcounts \u003d {\n\t \"Critical\": 0,\n\t \"High\": 0,\n\t \"Medium\": 0,\n\t \"Low\": 0,\n\t \"Diagnostic\": 0,\n\t \"Total\": 0\n\t}\n\t\n\t# Loop through dataset and aggregate\n\tfor row in range(queryData.rowCount):\n\t mcm_val \u003d queryData.getValueAt(row, 0)\n\t severity \u003d queryData.getValueAt(row, 1)\n\t count \u003d queryData.getValueAt(row, 2)\n\t\n\t if mcm_val \u003d\u003d MCM:\n\t key \u003d severity.capitalize()\n\t if key in counts:\n\t counts[key] +\u003d count\n\t counts[\"Total\"] +\u003d count\n\t \n\tself.custom.counts \u003d counts" + }, "persistent": true }, "params.value": { "paramDirection": "input", "persistent": true + }, + "params.value.tagProps": { + "onChange": { + "enabled": null, + "script": "\tsystem.perspective.print(currentValue.value[0])" + } } }, "props": {