From 089f01fcfbf85be1f1d90ecd096a56107481823a Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Wed, 24 Jul 2024 17:53:05 +0300 Subject: [PATCH] UI: Centrifugal pump SCADA symbol. --- .../system/scada_symbols/centrifugal-pump.svg | 509 ++++++++++++++++++ .../water-blower-right-connector.svg | 102 ---- .../scada_water_system_symbols.json | 2 +- .../assets/locale/locale.constant-en_US.json | 18 +- 4 files changed, 527 insertions(+), 104 deletions(-) create mode 100644 application/src/main/data/json/system/scada_symbols/centrifugal-pump.svg delete mode 100644 application/src/main/data/json/system/scada_symbols/water-blower-right-connector.svg diff --git a/application/src/main/data/json/system/scada_symbols/centrifugal-pump.svg b/application/src/main/data/json/system/scada_symbols/centrifugal-pump.svg new file mode 100644 index 0000000000..8b136687a0 --- /dev/null +++ b/application/src/main/data/json/system/scada_symbols/centrifugal-pump.svg @@ -0,0 +1,509 @@ + +{ + "title": "Centrifugal pump", + "description": "Centrifugal pump with configurable connectors, running animation and various states.", + "searchTags": [ + "pump", + "centrifugal" + ], + "widgetSizeX": 2, + "widgetSizeY": 2, + "tags": [ + { + "tag": "background", + "stateRenderFunction": "var color = ctx.properties.stoppedColor;\nif (ctx.values.critical) {\n color = ctx.properties.criticalColor;\n} else if (ctx.values.warning) {\n color = ctx.properties.warningColor;\n} else if (ctx.values.running) {\n color = ctx.properties.runningColor;\n}\nelement.attr({fill: color});\n\nvar elementCriticalAnimation = element.remember('criticalAnimation');\nvar criticalAnimation = ctx.values.critical && ctx.values.criticalAnimation;\n\nif (elementCriticalAnimation !== criticalAnimation) {\n element.remember('criticalAnimation', criticalAnimation);\n if (criticalAnimation) {\n ctx.api.animate(element, 500).attr({opacity: 0.15}).loop(0, true);\n } else {\n ctx.api.resetAnimation(element);\n }\n}", + "actions": null + }, + { + "tag": "center", + "stateRenderFunction": "var running = ctx.values.running;\nvar t = element.timeline();\nif (running) {\n if (!t.active()) {\n if (t.time()) {\n t.play();\n } else {\n ctx.api.animate(element, 2000).ease('-').rotate(360).loop();\n t = element.timeline();\n }\n }\n var speed = ctx.values.rotationAnimationSpeed;\n t.speed(speed);\n} else {\n t.pause();\n}\n", + "actions": null + }, + { + "tag": "clickArea", + "stateRenderFunction": null, + "actions": { + "click": { + "actionFunction": "ctx.api.callAction(event, 'click');" + } + } + }, + { + "tag": "leftBottomConnector", + "stateRenderFunction": "if (ctx.properties.leftBottomConnector) {\n element.show();\n} else {\n element.hide();\n}", + "actions": null + }, + { + "tag": "leftTopConnector", + "stateRenderFunction": "if (ctx.properties.leftTopConnector) {\n element.show();\n} else {\n element.hide();\n}", + "actions": null + }, + { + "tag": "rightBottomConnector", + "stateRenderFunction": "if (ctx.properties.rightBottomConnector) {\n element.show();\n} else {\n element.hide();\n}", + "actions": null + }, + { + "tag": "rightTopConnector", + "stateRenderFunction": "if (ctx.properties.rightTopConnector) {\n element.show();\n} else {\n element.hide();\n}", + "actions": null + }, + { + "tag": "topLeftConnector", + "stateRenderFunction": "if (ctx.properties.topLeftConnector) {\n element.show();\n} else {\n element.hide();\n}", + "actions": null + }, + { + "tag": "topRightConnector", + "stateRenderFunction": "if (ctx.properties.topRightConnector) {\n element.show();\n} else {\n element.hide();\n}", + "actions": null + } + ], + "behavior": [ + { + "id": "running", + "name": "{i18n:scada.symbol.running}", + "hint": "{i18n:scada.symbol.running-hint}", + "group": null, + "type": "value", + "valueType": "BOOLEAN", + "defaultValue": false, + "trueLabel": null, + "falseLabel": null, + "stateLabel": "{i18n:scada.symbol.running}", + "valueToDataType": "CONSTANT", + "constantValue": false, + "valueToDataFunction": "" + }, + { + "id": "warning", + "name": "{i18n:scada.symbol.warning-state}", + "hint": "{i18n:scada.symbol.warning-state-hint}", + "group": null, + "type": "value", + "valueType": "BOOLEAN", + "defaultValue": false, + "trueLabel": null, + "falseLabel": null, + "stateLabel": "{i18n:scada.symbol.warning}", + "valueToDataType": "CONSTANT", + "constantValue": false, + "valueToDataFunction": "" + }, + { + "id": "critical", + "name": "{i18n:scada.symbol.critical-state}", + "hint": "{i18n:scada.symbol.critical-state-hint}", + "group": null, + "type": "value", + "valueType": "BOOLEAN", + "defaultValue": false, + "trueLabel": null, + "falseLabel": null, + "stateLabel": "{i18n:scada.symbol.critical}", + "valueToDataType": "CONSTANT", + "constantValue": false, + "valueToDataFunction": "" + }, + { + "id": "criticalAnimation", + "name": "{i18n:scada.symbol.critical-state-animation}", + "hint": "{i18n:scada.symbol.critical-state-animation-hint}", + "group": null, + "type": "value", + "valueType": "BOOLEAN", + "defaultValue": false, + "trueLabel": null, + "falseLabel": null, + "stateLabel": "{i18n:scada.symbol.animation}", + "valueToDataType": "CONSTANT", + "constantValue": false, + "valueToDataFunction": "" + }, + { + "id": "rotationAnimationSpeed", + "name": "{i18n:scada.symbol.rotation-animation-speed}", + "hint": "{i18n:scada.symbol.rotation-animation-speed-hint}", + "group": null, + "type": "value", + "valueType": "DOUBLE", + "defaultValue": 1, + "trueLabel": null, + "falseLabel": null, + "stateLabel": null, + "valueToDataType": "CONSTANT", + "constantValue": false, + "valueToDataFunction": "" + }, + { + "id": "click", + "name": "{i18n:scada.symbol.on-click}", + "hint": "{i18n:scada.symbol.on-click-hint}", + "group": null, + "type": "widgetAction", + "valueType": "BOOLEAN", + "defaultValue": false, + "trueLabel": null, + "falseLabel": null, + "stateLabel": null, + "valueToDataType": "CONSTANT", + "constantValue": false, + "valueToDataFunction": "" + } + ], + "properties": [ + { + "id": "rightTopConnector", + "name": "{i18n:scada.symbol.right-top-connector}", + "type": "switch", + "default": true, + "required": null, + "subLabel": "", + "divider": true, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "rightBottomConnector", + "name": "{i18n:scada.symbol.right-bottom-connector}", + "type": "switch", + "default": false, + "required": null, + "subLabel": "", + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "leftTopConnector", + "name": "{i18n:scada.symbol.left-top-connector}", + "type": "switch", + "default": false, + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "leftBottomConnector", + "name": "{i18n:scada.symbol.left-bottom-connector}", + "type": "switch", + "default": true, + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "topLeftConnector", + "name": "{i18n:scada.symbol.top-left-connector}", + "type": "switch", + "default": false, + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "topRightConnector", + "name": "{i18n:scada.symbol.top-right-connector}", + "type": "switch", + "default": false, + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "runningColor", + "name": "{i18n:scada.symbol.running-color}", + "type": "color", + "default": "#1C943E", + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "stoppedColor", + "name": "{i18n:scada.symbol.stopped-color}", + "type": "color", + "default": "#696969", + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "warningColor", + "name": "{i18n:scada.symbol.warning-color}", + "type": "color", + "default": "#FAA405", + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + }, + { + "id": "criticalColor", + "name": "{i18n:scada.symbol.critical-color}", + "type": "color", + "default": "#D12730", + "required": null, + "subLabel": null, + "divider": null, + "fieldSuffix": null, + "disableOnProperty": null, + "rowClass": "", + "fieldClass": "", + "min": null, + "max": null, + "step": null + } + ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/src/main/data/json/system/scada_symbols/water-blower-right-connector.svg b/application/src/main/data/json/system/scada_symbols/water-blower-right-connector.svg deleted file mode 100644 index 88a561f2ea..0000000000 --- a/application/src/main/data/json/system/scada_symbols/water-blower-right-connector.svg +++ /dev/null @@ -1,102 +0,0 @@ - -{ - "title": "Water blower right connector", - "widgetSizeX": 2, - "widgetSizeY": 2, - "tags": [ - { - "tag": "motor", - "stateRenderFunction": "var on = ctx.values.on;\n//debugger;\nvar t = element.timeline();\nif (on) {\n if (!t.active()) {\n if (t.time()) {\n t.play();\n } else {\n ctx.api.animate(element, 2000).ease('-').rotate(360).loop();\n t = element.timeline();\n //var speed = 0.25;\n //speed = Math.max(0, Math.min(1, speed))*2; \n //t.speed(speed);\n }\n }\n} else {\n t.pause();//.stop();\n}", - "actions": null - } - ], - "behavior": [ - { - "id": "on", - "name": "On/Off state", - "hint": null, - "type": "value", - "valueType": "BOOLEAN", - "defaultValue": false, - "trueLabel": "{i18n:widgets.rpc-state.on}", - "falseLabel": "{i18n:widgets.rpc-state.off}", - "stateLabel": "{i18n:widgets.rpc-state.on}", - "valueToDataType": "CONSTANT", - "constantValue": false, - "valueToDataFunction": "" - } - ], - "properties": [] -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json b/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json index ad15c6ff34..7e4117d2a8 100644 --- a/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json +++ b/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json @@ -28,9 +28,9 @@ "left_flow_meter", "horizontal_inline_flow_meter", "vertical_inline_flow_meter", + "centrifugal_pump", "horizontal_tank_with_screen", "horizontal_faucet", - "water_blower_right_connector", "vertical_tank_with_level", "pump_left", "pump", diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 273c5f4c3d..4807fe09b8 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -3625,6 +3625,8 @@ "value": "Value", "units": "Units", "flow-meter-value-hint": "Double value showing on flow meter display", + "running": "Running", + "running-hint": "Indicates whether component is in running state.", "warning-state": "Warning state", "warning": "Warning", "warning-state-hint": "Indicates whether component is in warning state.", @@ -3643,7 +3645,21 @@ "active-border-color": "Active border color", "warning-border-color": "Warning border color", "critical-border-color": "Critical border color", - "background-color": "Background color" + "background-color": "Background color", + "rotation-animation-speed": "Rotation animation speed", + "rotation-animation-speed-hint": "Double value indicating rotation animation speed. 1 - normal speed, 0 - no animation, < 1 - slower animation, > 1 - faster animation.", + "on-click": "On click", + "on-click-hint": "Action invoked when user clicks on the component.", + "right-top-connector": "Right top connector", + "right-bottom-connector": "Right bottom connector", + "left-top-connector": "Left top connector", + "left-bottom-connector": "Left bottom connector", + "top-left-connector": "Top left connector", + "top-right-connector": "Top right connector", + "running-color": "Running color", + "stopped-color": "Stopped color", + "warning-color": "Warning color", + "critical-color": "Critical color" } }, "item": {