From c329e5a3b1061aae5ab0bfaef633ae075fb25e9e Mon Sep 17 00:00:00 2001 From: "b.makharadze" <81828475+bmidf@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:10:04 +0400 Subject: [PATCH] Added Filters for Buttons --- .../session-props/props.json | 5 +- .../PopUp-Views/Detail-View-Filter/view.json | 76 +++++++++++++++++++ .../Equipment-Views/Button/view.json | 4 +- .../Equipment-Views/Estop/view.json | 2 +- .../Equipment-Views/JR_Button/view.json | 2 +- .../Equipment-Views/SS_Button/view.json | 8 +- 6 files changed, 87 insertions(+), 10 deletions(-) diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/session-props/props.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/session-props/props.json index ef69e7a..cd20fdd 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/session-props/props.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/session-props/props.json @@ -3,6 +3,7 @@ "alarm_filter": { "magnificaiton": "x2", "orderby": false, + "show_buttons": true, "show_camera_jams": true, "show_diagnostic": true, "show_fio": true, @@ -213,13 +214,13 @@ } }, "props": { - "address": "192.168.5.149", + "address": "127.0.0.1", "appBar": { "togglePosition": "hidden" }, "device": {}, "geolocation": {}, "locale": "en-US", - "timeZoneId": "America/Los_Angeles" + "timeZoneId": "Asia/Tbilisi" } } \ No newline at end of file diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Detail-View-Filter/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Detail-View-Filter/view.json index 952e6e3..6520bf9 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Detail-View-Filter/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/PopUp-Views/Detail-View-Filter/view.json @@ -367,6 +367,82 @@ }, "type": "ia.input.checkbox" }, + { + "custom": { + "buttonid": "status_filters/low_alarms" + }, + "events": { + "component": { + "onActionPerformed": { + "config": { + "script": "\tif not self.props.selected:\n\t\tbuttonid \u003d self.custom.buttonid\n\t\tactivityLog.logger.callLogger(self.view, \u0027click\u0027, buttonid)\n\t\tactivityLog.productMetrics.callLogger(self.view, \u0027click\u0027, buttonid)" + }, + "scope": "G", + "type": "script" + } + } + }, + "meta": { + "name": "Show-Buttons", + "tooltip": { + "delay": 250 + } + }, + "position": { + "basis": "36px" + }, + "propConfig": { + "props.enabled": { + "binding": { + "config": { + "expression": "if ({session.custom.alarm_filter.show_map}\u003dTrue \u0026\u0026 {session.custom.view_in_focus}\u003d\u0027/MAP-Home\u0027, True, False)" + }, + "enabled": false, + "type": "expr" + } + }, + "props.selected": { + "binding": { + "config": { + "bidirectional": true, + "path": "session.custom.alarm_filter.show_buttons" + }, + "type": "property" + } + } + }, + "props": { + "checkedIcon": { + "color": { + "disabled": "#FFFFFF", + "enabled": "#FFFFFF" + } + }, + "style": { + "color": "#FFFFFF", + "fontFamily": "Arial", + "fontSize": 12, + "fontWeight": "bold", + "marginLeft": 10, + "marginRight": 10 + }, + "text": "Show Buttons" + }, + "scripts": { + "customMethods": [], + "extensionFunctions": null, + "messageHandlers": [ + { + "messageType": "select-all-filters", + "pageScope": false, + "script": "\tdata \u003d payload[\"data\"]\n\tself.props.selected \u003d data\n\tsystem.perspective.print(data)", + "sessionScope": false, + "viewScope": true + } + ] + }, + "type": "ia.input.checkbox" + }, { "custom": { "buttonid": "status_filters/estops_pullChords" diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Button/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Button/view.json index b5155c6..e3add94 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Button/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Button/view.json @@ -11,7 +11,7 @@ "priority_string": "No active alarms", "searchId": "PLC01", "state": 5, - "status": 1, + "status": 0, "visible_status": false }, "params": { @@ -476,7 +476,7 @@ "meta.visible": { "binding": { "config": { - "path": "view.custom.display_icon" + "path": "session.custom.alarm_filter.show_buttons" }, "type": "property" } diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Estop/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Estop/view.json index 9c7decd..4f278ad 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Estop/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Estop/view.json @@ -481,7 +481,7 @@ "meta.visible": { "binding": { "config": { - "path": "view.custom.display_icon" + "path": "session.custom.alarm_filter.show_safety" }, "type": "property" } diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/JR_Button/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/JR_Button/view.json index 5b36554..aa0b8e3 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/JR_Button/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/JR_Button/view.json @@ -430,7 +430,7 @@ "meta.visible": { "binding": { "config": { - "path": "session.custom.alarm_filter.show_running" + "path": "session.custom.alarm_filter.show_buttons" }, "type": "property" } diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/SS_Button/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/SS_Button/view.json index 7dfaeba..7bcd313 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/SS_Button/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/SS_Button/view.json @@ -1,6 +1,6 @@ { "custom": { - "activated": true, + "activated": false, "alarm_message": null, "covert_mode": true, "disconnected": false, @@ -14,8 +14,8 @@ "show_error": false, "show_status": true, "state": 5, - "status": 1, - "status_string": "Started", + "status": 0, + "status_string": "Unknown", "visible_status": false }, "params": { @@ -594,7 +594,7 @@ "meta.visible": { "binding": { "config": { - "path": "view.custom.display_icon" + "path": "session.custom.alarm_filter.show_buttons" }, "type": "property" }