From da2dd466d43b36579ad98ee716ad44cb2f69804b Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Thu, 15 Aug 2024 10:47:40 +0300 Subject: [PATCH] UI: Remove unnecessary SCADA symbols. --- .../horizontal-tank-with-screen.svg | 20 - .../system/scada_symbols/level_and_fan.svg | 469 ------------------ .../scada_water_system_symbols.json | 4 +- 3 files changed, 1 insertion(+), 492 deletions(-) delete mode 100644 application/src/main/data/json/system/scada_symbols/horizontal-tank-with-screen.svg delete mode 100644 application/src/main/data/json/system/scada_symbols/level_and_fan.svg diff --git a/application/src/main/data/json/system/scada_symbols/horizontal-tank-with-screen.svg b/application/src/main/data/json/system/scada_symbols/horizontal-tank-with-screen.svg deleted file mode 100644 index bfc7c83976..0000000000 --- a/application/src/main/data/json/system/scada_symbols/horizontal-tank-with-screen.svg +++ /dev/null @@ -1,20 +0,0 @@ - -{ - "title": "Horizontal tank with screen", - "widgetSizeX": 5, - "widgetSizeY": 3, - "tags": [], - "behavior": [], - "properties": [] -} - - - - - - - - - - - \ No newline at end of file diff --git a/application/src/main/data/json/system/scada_symbols/level_and_fan.svg b/application/src/main/data/json/system/scada_symbols/level_and_fan.svg deleted file mode 100644 index f0ab885768..0000000000 --- a/application/src/main/data/json/system/scada_symbols/level_and_fan.svg +++ /dev/null @@ -1,469 +0,0 @@ - -{ - "title": "Level and Fan", - "description": "Level and Fan Symbol", - "searchTags": [ - "level", - "fan" - ], - "widgetSizeX": 3, - "widgetSizeY": 3, - "stateRenderFunction": "var showMinMaxLevel = ctx.properties.showMinMaxLevel;\nvar minLevelElement = ctx.tags.minLevel[0];\nvar maxLevelElement = ctx.tags.maxLevel[0];\nvar minLevel = ctx.properties.minLevel; \nvar maxLevel = ctx.properties.maxLevel;\n\nif (showMinMaxLevel) {\n \n var minMaxLevelFont = ctx.properties.minMaxLevelFont;\n var minMaxLevelColor = ctx.properties.minMaxLevelColor;\n \n ctx.api.text(minLevelElement, minLevel);\n ctx.api.text(maxLevelElement, maxLevel);\n \n ctx.api.font(minLevelElement, minMaxLevelFont, minMaxLevelColor);\n ctx.api.font(maxLevelElement, minMaxLevelFont, minMaxLevelColor);\n \n} else {\n minLevelElement.hide();\n maxLevelElement.hide();\n}\n\nvar disabled = ctx.values.disabled;\nvar on = ctx.values.on;\nvar level = ctx.values.level;\n\nvar onButton = ctx.tags.onButton;\nvar offButton = ctx.tags.offButton;\nvar levelUpButton = ctx.tags.levelUpButton;\nvar levelDownButton = ctx.tags.levelDownButton;\n\nvar onButtonEnabled = !disabled && !on;\nvar offButtonEnabled = !disabled && on;\nvar levelUpEnabled = !disabled && level < maxLevel;\nvar levelDownEnabled = !disabled && level > minLevel;\n\nif (onButtonEnabled) {\n ctx.api.enable(onButton);\n onButton[0].findOne('rect').attr({fill: '#12ed19'});\n} else {\n ctx.api.disable(onButton);\n onButton[0].findOne('rect').attr({fill: '#777'});\n}\n \nif (offButtonEnabled) {\n ctx.api.enable(offButton);\n offButton[0].findOne('rect').attr({fill: '#ed121f'});\n} else {\n ctx.api.disable(offButton);\n offButton[0].findOne('rect').attr({fill: '#777'});\n} \n\n\nif (levelUpEnabled) {\n ctx.api.enable(levelUpButton);\n levelUpButton[0].findOne('rect').attr({fill: '#fff'});\n} else {\n ctx.api.disable(levelUpButton);\n levelUpButton[0].findOne('rect').attr({fill: '#777'});\n}\n \nif (levelDownEnabled) {\n ctx.api.enable(levelDownButton);\n levelDownButton[0].findOne('rect').attr({fill: '#fff'});\n} else {\n ctx.api.disable(levelDownButton);\n levelDownButton[0].findOne('rect').attr({fill: '#777'});\n}", - "tags": [ - { - "tag": "fan", - "stateRenderFunction": "var on = ctx.values.on;\nvar hasAnimation = element.remember('hasAnimation');\nif (on) {\n\n var level = ctx.values.level; \n var minLevel = ctx.properties.minLevel; \n var maxLevel = ctx.properties.maxLevel;\n\n var speed = (level - minLevel) / (maxLevel - minLevel);\n speed = Math.max(0, Math.min(1, speed))*2; \n\n if (!hasAnimation) {\n element.remember('hasAnimation', true);\n element.animate(1000).ease('-').rotate(360).loop();\n } else {\n element.timeline().play();\n }\n element.timeline().speed(speed);\n} else {\n if (hasAnimation) {\n element.timeline().pause();\n }\n}\n", - "actions": null - }, - { - "tag": "level", - "stateRenderFunction": "var level = ctx.values.level; \nvar disabled = ctx.values.disabled;\nvar minLevel = ctx.properties.minLevel; \nvar maxLevel = ctx.properties.maxLevel;\n\nvar height = (level - minLevel) / (maxLevel - minLevel);\nheight = Math.max(0, Math.min(1, height))*80; \n\nctx.api.animate(element, 200).attr({height: height});\n\nvar fill;\nif (disabled) {\n fill = ctx.properties.disabledLevelBackground;\n} else {\n var colorProcessor = ctx.properties.levelBackground;\n colorProcessor.update(level);\n fill = colorProcessor.color;\n}\n\nelement.attr({fill: fill});", - "actions": null - }, - { - "tag": "levelDownButton", - "actions": { - "click": { - "actionFunction": "var level = ctx.values.level; \nvar minLevel = ctx.properties.minLevel;\n\nvar newLevel = Math.max(minLevel, level - 5);\nctx.api.setValue('level', newLevel);\nctx.api.callAction(event, 'levelUpdateState', newLevel, {\n error: () => {\n ctx.api.setValue('level', level);\n }\n});" - } - } - }, - { - "tag": "levelTitle", - "stateRenderFunction": "var showLevelTitle = ctx.properties.showLevelTitle;\n\nif (showLevelTitle) {\n var levelTitle = ctx.properties.levelTitle;\n var levelTitleFont = ctx.properties.levelTitleFont;\n var levelTitleColor = ctx.properties.levelTitleColor;\n \n ctx.api.text(element, levelTitle);\n ctx.api.font(element, levelTitleFont, levelTitleColor);\n \n} else {\n element.hide();\n}", - "actions": null - }, - { - "tag": "levelUpButton", - "actions": { - "click": { - "actionFunction": "var level = ctx.values.level; \nvar maxLevel = ctx.properties.maxLevel;\n\nvar newLevel = Math.min(maxLevel, level + 5);\nctx.api.setValue('level', newLevel);\nctx.api.callAction(event, 'levelUpdateState', newLevel, {\n error: () => {\n ctx.api.setValue('level', level);\n }\n});" - } - } - }, - { - "tag": "levelValue", - "stateRenderFunction": "var showValue = ctx.properties.showValue;\n\nif (showValue) {\n var valueFont = ctx.properties.valueFont;\n var valueColor = ctx.properties.valueColor;\n var level = ctx.values.level; \n \n var levelText = ctx.api.formatValue(level, ctx.properties.valueDecimals, ctx.properties.valueUnits, false);\n\n ctx.api.font(element, valueFont, valueColor);\n ctx.api.text(element, levelText);\n\n} else {\n element.hide();\n ctx.tags.levelValueBackground[0].hide();\n}", - "actions": { - "click": { - "actionFunction": "ctx.api.callAction(event, 'levelValueClick');" - } - } - }, - { - "tag": "offButton", - "actions": { - "click": { - "actionFunction": "ctx.api.callAction(event, 'offUpdateState', undefined, {\n next: () => {\n ctx.api.setValue('on', false);\n }\n});\n" - } - } - }, - { - "tag": "onButton", - "actions": { - "click": { - "actionFunction": "ctx.api.callAction(event, 'onUpdateState', undefined, {\n next: () => {\n ctx.api.setValue('on', true);\n }\n});\n\n" - } - } - }, - { - "tag": "ramka", - "stateRenderFunction": "var on = ctx.values.on;\nvar hasAnimation = element.remember('hasAnimation');\nif (on) {\n if (!hasAnimation) {\n element.remember('hasAnimation', true);\n ctx.api.animate(element, 1000).scale(1.1).loop(0, true);\n } else {\n element.timeline().play();\n }\n} else {\n if (hasAnimation) {\n element.timeline().pause();\n }\n}", - "actions": null - } - ], - "behavior": [ - { - "id": "level", - "name": "Level", - "hint": null, - "group": null, - "type": "value", - "valueType": "DOUBLE", - "trueLabel": null, - "falseLabel": null, - "stateLabel": null, - "defaultGetValueSettings": { - "action": "GET_TIME_SERIES", - "defaultValue": null, - "executeRpc": { - "method": "getState", - "requestTimeout": 5000, - "requestPersistent": false, - "persistentPollingInterval": 1000 - }, - "getAttribute": { - "scope": null, - "key": "level" - }, - "getTimeSeries": { - "key": "level" - }, - "dataToValue": { - "type": "NONE", - "dataToValueFunction": "/* Should return boolean value */\nreturn data;" - } - }, - "defaultSetValueSettings": null, - "defaultWidgetActionSettings": null - }, - { - "id": "disabled", - "name": "{i18n:widgets.rpc-state.disabled-state}", - "hint": "{i18n:widgets.rpc-state.disabled-state-hint}", - "group": null, - "type": "value", - "valueType": "BOOLEAN", - "trueLabel": "", - "falseLabel": "", - "stateLabel": "{i18n:widgets.rpc-state.disabled}", - "defaultGetValueSettings": { - "action": "DO_NOTHING", - "defaultValue": false, - "executeRpc": { - "method": "getState", - "requestTimeout": 5000, - "requestPersistent": false, - "persistentPollingInterval": 1000 - }, - "getAttribute": { - "scope": null, - "key": "state" - }, - "getTimeSeries": { - "key": "state" - }, - "dataToValue": { - "type": "NONE", - "dataToValueFunction": "/* Should return boolean value */\nreturn data;", - "compareToValue": true - } - }, - "defaultSetValueSettings": null, - "defaultWidgetActionSettings": null - }, - { - "id": "on", - "name": "On/Off state", - "hint": null, - "group": null, - "type": "value", - "valueType": "BOOLEAN", - "trueLabel": "{i18n:widgets.rpc-state.on}", - "falseLabel": "{i18n:widgets.rpc-state.off}", - "stateLabel": "{i18n:widgets.rpc-state.on}", - "defaultGetValueSettings": { - "action": "DO_NOTHING", - "defaultValue": false, - "executeRpc": { - "method": "getState", - "requestTimeout": 5000, - "requestPersistent": false, - "persistentPollingInterval": 1000 - }, - "getAttribute": { - "scope": null, - "key": "state" - }, - "getTimeSeries": { - "key": "state" - }, - "dataToValue": { - "type": "NONE", - "dataToValueFunction": "/* Should return boolean value */\nreturn data;", - "compareToValue": true - } - }, - "defaultSetValueSettings": null, - "defaultWidgetActionSettings": null - }, - { - "id": "onUpdateState", - "name": "{i18n:widgets.rpc-state.turn-on}", - "hint": "{i18n:widgets.rpc-state.turn-on-hint}", - "group": null, - "type": "action", - "valueType": "BOOLEAN", - "trueLabel": null, - "falseLabel": null, - "stateLabel": null, - "defaultGetValueSettings": null, - "defaultSetValueSettings": { - "action": "SET_ATTRIBUTE", - "executeRpc": { - "method": "setState", - "requestTimeout": 5000, - "requestPersistent": false, - "persistentPollingInterval": 1000 - }, - "setAttribute": { - "scope": "SERVER_SCOPE", - "key": "state" - }, - "putTimeSeries": { - "key": "state" - }, - "valueToData": { - "type": "CONSTANT", - "constantValue": true, - "valueToDataFunction": "/* Convert input boolean value to RPC parameters or attribute/time-series value */\nreturn value;" - } - }, - "defaultWidgetActionSettings": null - }, - { - "id": "offUpdateState", - "name": "{i18n:widgets.rpc-state.turn-off}", - "hint": "{i18n:widgets.rpc-state.turn-off-hint}", - "group": null, - "type": "action", - "valueType": "BOOLEAN", - "trueLabel": null, - "falseLabel": null, - "stateLabel": null, - "defaultGetValueSettings": null, - "defaultSetValueSettings": { - "action": "SET_ATTRIBUTE", - "executeRpc": { - "method": "setState", - "requestTimeout": 5000, - "requestPersistent": false, - "persistentPollingInterval": 1000 - }, - "setAttribute": { - "scope": "SERVER_SCOPE", - "key": "state" - }, - "putTimeSeries": { - "key": "state" - }, - "valueToData": { - "type": "CONSTANT", - "constantValue": false, - "valueToDataFunction": "/* Convert input boolean value to RPC parameters or attribute/time-series value */\nreturn value;" - } - }, - "defaultWidgetActionSettings": null - }, - { - "id": "levelUpdateState", - "name": "Update level", - "hint": null, - "group": null, - "type": "action", - "valueType": "DOUBLE", - "trueLabel": null, - "falseLabel": null, - "stateLabel": null, - "defaultGetValueSettings": null, - "defaultSetValueSettings": { - "action": "ADD_TIME_SERIES", - "executeRpc": { - "method": "setState", - "requestTimeout": 5000, - "requestPersistent": false, - "persistentPollingInterval": 1000 - }, - "setAttribute": { - "scope": "SERVER_SCOPE", - "key": "state" - }, - "putTimeSeries": { - "key": "level" - }, - "valueToData": { - "type": "VALUE", - "constantValue": false, - "valueToDataFunction": "/* Convert input boolean value to RPC parameters or attribute/time-series value */\nreturn value;" - } - }, - "defaultWidgetActionSettings": null - }, - { - "id": "levelValueClick", - "name": "On level value click", - "hint": null, - "group": null, - "type": "widgetAction", - "valueType": null, - "trueLabel": null, - "falseLabel": null, - "stateLabel": null, - "defaultGetValueSettings": null, - "defaultSetValueSettings": null, - "defaultWidgetActionSettings": { - "type": "doNothing", - "openInSeparateDialog": false, - "openInPopover": false - } - } - ], - "properties": [ - { - "id": "showLevelTitle", - "name": "Level title", - "type": "switch", - "default": true, - "rowClass": "column-xs" - }, - { - "id": "levelTitle", - "name": "Level title", - "type": "text", - "default": "{i18n:widgets.battery-level.value}", - "disableOnProperty": "showLevelTitle", - "fieldClass": "flex" - }, - { - "id": "levelTitleFont", - "name": "Level title", - "type": "font", - "default": { - "size": 6, - "sizeUnit": "px", - "family": "Roboto", - "weight": "normal", - "style": "normal" - }, - "disableOnProperty": "showLevelTitle" - }, - { - "id": "levelTitleColor", - "name": "Level title", - "type": "color", - "default": "#000000", - "disableOnProperty": "showLevelTitle" - }, - { - "id": "showValue", - "name": "Value", - "type": "switch", - "default": true, - "rowClass": "column-xs" - }, - { - "id": "valueUnits", - "name": "Value", - "type": "units", - "default": "", - "disableOnProperty": "showValue", - "fieldClass": "flex" - }, - { - "id": "valueDecimals", - "name": "Value", - "type": "number", - "default": 2, - "min": 0, - "max": 15, - "step": 1, - "fieldSuffix": "decimals", - "disableOnProperty": "showValue", - "fieldClass": "flex" - }, - { - "id": "valueFont", - "name": "Value", - "type": "font", - "default": { - "size": 6, - "sizeUnit": "px", - "family": "Roboto", - "weight": "normal", - "style": "normal" - }, - "disableOnProperty": "showValue" - }, - { - "id": "valueColor", - "name": "Value", - "type": "color", - "default": "#000000", - "disableOnProperty": "showValue" - }, - { - "id": "minLevel", - "name": "Level range", - "subLabel": "min", - "type": "number", - "required": true, - "default": 0, - "min": 0, - "rowClass": "column-xs", - "fieldClass": "flex-xs" - }, - { - "id": "maxLevel", - "name": "Level range", - "subLabel": "max", - "type": "number", - "required": true, - "default": 100, - "min": 0, - "fieldClass": "flex-xs" - }, - { - "id": "showMinMaxLevel", - "name": "Min/Max label", - "type": "switch", - "default": true - }, - { - "id": "minMaxLevelFont", - "name": "Min/Max label", - "type": "font", - "default": { - "size": 6, - "sizeUnit": "px", - "family": "Roboto", - "weight": "normal", - "style": "normal" - }, - "disableOnProperty": "showMinMaxLevel" - }, - { - "id": "minMaxLevelColor", - "name": "Min/Max label", - "type": "color", - "default": "#666", - "disableOnProperty": "showMinMaxLevel" - }, - { - "id": "levelBackground", - "name": "Level background", - "subLabel": "Enabled", - "type": "color_settings", - "default": { - "type": "constant", - "color": "#1abb48", - "colorFunction": "return value > 70 ? '#d5280d' : '#1abb48';" - }, - "divider": true, - "rowClass": "column-xs" - }, - { - "id": "disabledLevelBackground", - "name": "Level background", - "subLabel": "Disabled", - "type": "color", - "default": "#ccc" - } - ] -}min - N/A - Level - max - - - On - - - Off - - - - - - - - \ 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 86d6f8e2c4..224938c019 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 @@ -47,8 +47,6 @@ "vertical_wheel_valve", "horizontal_ball_valve", "vertical_ball_valve", - "vertical_tank", - "horizontal_tank_with_screen", - "level_and_fan" + "vertical_tank" ] } \ No newline at end of file