diff --git a/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg
index 4e41fd77c6..37b3a199c6 100644
--- a/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Bottom right elbow connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimation,\n animationDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `-${dashWidth + (dashGap || dashWidth)}` : `${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "line",
@@ -10,23 +11,132 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "animationDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -37,12 +147,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -51,32 +160,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/bottom-tee-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/bottom-tee-connector-hp.svg
index 33942432cb..2feb95e9ff 100644
--- a/application/src/main/data/json/system/scada_symbols/bottom-tee-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/bottom-tee-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Bottom tee connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\n\nconst leftLine = \"M0 100H100\";\nconst rightLine = \"M100 100H200\";\nconst bottomLine = \"M 100,200 V 103\";\n\nprepareFlowAnimation('left', leftLine);\nprepareFlowAnimation('right', rightLine);\nprepareFlowAnimation('bottom', bottomLine);\n\nfunction prepareFlowAnimation(prefix, line) {\n const flowAnimation = ctx.values[prefix + 'Flow'];\n const flowDirection = ctx.values[prefix + 'FlowDirection'];\n const flowAnimationSpeed = ctx.values[prefix + 'FlowAnimationSpeed'];\n\n const animation = ctx.tags[prefix + 'Line'][0];\n const offset = Date.now() % 1000;\n const duration = 1 / flowAnimationSpeed;\n \n const prevFlowAnimation = animation.remember('flowAnimation');\n const prevFlowDirection = animation.remember('flowDirection');\n const prevFlowDuration = animation.remember('flowDuration');\n \n if (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n } else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n }\n}\n\nfunction animateFlow(group, offset, flowDirection, duration, line) {\n group.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n group.add(``);\n}",
"tags": [
{
"tag": "line",
@@ -15,23 +16,364 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "leftFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.fluid-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowDirection",
+ "name": "{i18n:scada.symbol.flow-direction}",
+ "hint": "{i18n:scada.symbol.flow-direction-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -42,12 +384,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -56,32 +397,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/cross-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/cross-connector-hp.svg
index df708d47d3..ab6798b48b 100644
--- a/application/src/main/data/json/system/scada_symbols/cross-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/cross-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Cross connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\n\nconst leftLine = \"M0 100H100\";\nconst topLine = \"M100 97L100 0\";\nconst rightLine = \"M100 100H200\";\nconst bottomLine = \"M 100,200 V 103\";\n\nprepareFlowAnimation('left', leftLine);\nprepareFlowAnimation('top', topLine);\nprepareFlowAnimation('right', rightLine);\nprepareFlowAnimation('bottom', bottomLine);\n\nfunction prepareFlowAnimation(prefix, line) {\n const flowAnimation = ctx.values[prefix + 'Flow'];\n const flowDirection = ctx.values[prefix + 'FlowDirection'];\n const flowAnimationSpeed = ctx.values[prefix + 'FlowAnimationSpeed'];\n\n const animation = ctx.tags[prefix + 'Line'][0];\n const offset = Date.now() % 1000;\n const duration = 1 / flowAnimationSpeed;\n \n const prevFlowAnimation = animation.remember('flowAnimation');\n const prevFlowDirection = animation.remember('flowDirection');\n const prevFlowDuration = animation.remember('flowDuration');\n \n if (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n } else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n }\n}\n\nfunction animateFlow(group, offset, flowDirection, duration, line) {\n group.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n group.add(``);\n}",
"tags": [
{
"tag": "line",
@@ -15,23 +16,480 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "leftFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.fluid-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowDirection",
+ "name": "{i18n:scada.symbol.flow-direction}",
+ "hint": "{i18n:scada.symbol.flow-direction-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -42,12 +500,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -56,32 +513,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/horizontal-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/horizontal-connector-hp.svg
index 33b6c0a222..74d048e884 100644
--- a/application/src/main/data/json/system/scada_symbols/horizontal-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/horizontal-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Horizontal connector with an optional directional arrow to visually indicate flow.",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimation,\n arrowDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "arrow",
@@ -85,6 +86,83 @@
},
"defaultSetValueSettings": null,
"defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
}
],
"properties": [
@@ -93,16 +171,8 @@
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -113,12 +183,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -127,48 +196,93 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
- "id": "arrowColor",
- "name": "{i18n:scada.symbol.arrow-color}",
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
"type": "color",
- "default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "default": "#C8DFF7"
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/left-bottom-elbow-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/left-bottom-elbow-connector-hp.svg
index bfc97fe928..fd14834d12 100644
--- a/application/src/main/data/json/system/scada_symbols/left-bottom-elbow-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/left-bottom-elbow-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Left bottom elbow connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimation,\n animationDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "line",
@@ -10,23 +11,132 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "animationDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -37,12 +147,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -51,32 +160,93 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7"
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/left-tee-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/left-tee-connector-hp.svg
index eac3869a1a..af83a4abb3 100644
--- a/application/src/main/data/json/system/scada_symbols/left-tee-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/left-tee-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Left tee connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\n\nconst leftLine = \"M0 100H97\";\nconst topLine = \"M100 100L100 0\";\nconst bottomLine = \"M 100,200 V 100\";\n\nprepareFlowAnimation('left', leftLine);\nprepareFlowAnimation('top', topLine);\nprepareFlowAnimation('bottom', bottomLine);\n\nfunction prepareFlowAnimation(prefix, line) {\n const flowAnimation = ctx.values[prefix + 'Flow'];\n const flowDirection = ctx.values[prefix + 'FlowDirection'];\n const flowAnimationSpeed = ctx.values[prefix + 'FlowAnimationSpeed'];\n\n const animation = ctx.tags[prefix + 'Line'][0];\n const offset = Date.now() % 1000;\n const duration = 1 / flowAnimationSpeed;\n \n const prevFlowAnimation = animation.remember('flowAnimation');\n const prevFlowDirection = animation.remember('flowDirection');\n const prevFlowDuration = animation.remember('flowDuration');\n \n if (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n } else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n }\n}\n\nfunction animateFlow(group, offset, flowDirection, duration, line) {\n group.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n group.add(``);\n}",
"tags": [
{
"tag": "line",
@@ -15,23 +16,364 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "leftFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.fluid-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowDirection",
+ "name": "{i18n:scada.symbol.flow-direction}",
+ "hint": "{i18n:scada.symbol.flow-direction-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -42,12 +384,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -56,32 +397,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/left-top-elbow-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/left-top-elbow-connector-hp.svg
index 6dfbc9e265..5b6d30ab65 100644
--- a/application/src/main/data/json/system/scada_symbols/left-top-elbow-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/left-top-elbow-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Left top elbow connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimation,\n animationDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "line",
@@ -10,23 +11,132 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "animationDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -37,12 +147,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -51,32 +160,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/long-horizontal-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/long-horizontal-connector-hp.svg
index 86bb07a520..3e65bd6b04 100644
--- a/application/src/main/data/json/system/scada_symbols/long-horizontal-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/long-horizontal-connector-hp.svg
@@ -4,6 +4,7 @@
"description": "Long horizontal connector with an optional directional arrow to visually indicate flow.",
"widgetSizeX": 2,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimation,\n arrowDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "arrow",
@@ -86,6 +87,83 @@
},
"defaultSetValueSettings": null,
"defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
}
],
"properties": [
@@ -94,16 +172,8 @@
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -114,12 +184,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -128,49 +197,93 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
- "id": "arrowColor",
- "name": "{i18n:scada.symbol.arrow-color}",
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
"type": "color",
- "default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "default": "#C8DFF7"
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
-
-
+
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/long-vertical-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/long-vertical-connector-hp.svg
index d7a0aa8aa7..b5c9730842 100644
--- a/application/src/main/data/json/system/scada_symbols/long-vertical-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/long-vertical-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Long vertical connector with an optional directional arrow to visually indicate flow.",
"widgetSizeX": 1,
"widgetSizeY": 2,
+ "stateRenderFunction": "const {\n flowAnimation,\n arrowDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "arrow",
@@ -85,6 +86,83 @@
},
"defaultSetValueSettings": null,
"defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
}
],
"properties": [
@@ -93,16 +171,8 @@
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -113,12 +183,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -127,48 +196,93 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
- "id": "arrowColor",
- "name": "{i18n:scada.symbol.arrow-color}",
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
"type": "color",
- "default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "default": "#C8DFF7"
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/right-tee-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/right-tee-connector-hp.svg
index 17d8bf4e0c..62aecb065d 100644
--- a/application/src/main/data/json/system/scada_symbols/right-tee-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/right-tee-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Right tee connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\n\nconst topLine = \"M100 100L100 0\";\nconst rightLine = \"M103 100H200\";\nconst bottomLine = \"M 100,200 V 100\";\n\nprepareFlowAnimation('top', topLine);\nprepareFlowAnimation('right', rightLine);\nprepareFlowAnimation('bottom', bottomLine);\n\nfunction prepareFlowAnimation(prefix, line) {\n const flowAnimation = ctx.values[prefix + 'Flow'];\n const flowDirection = ctx.values[prefix + 'FlowDirection'];\n const flowAnimationSpeed = ctx.values[prefix + 'FlowAnimationSpeed'];\n\n const animation = ctx.tags[prefix + 'Line'][0];\n const offset = Date.now() % 1000;\n const duration = 1 / flowAnimationSpeed;\n \n const prevFlowAnimation = animation.remember('flowAnimation');\n const prevFlowDirection = animation.remember('flowDirection');\n const prevFlowDuration = animation.remember('flowDuration');\n \n if (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n } else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n }\n}\n\nfunction animateFlow(group, offset, flowDirection, duration, line) {\n group.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n group.add(``);\n}",
"tags": [
{
"tag": "line",
@@ -15,23 +16,364 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "topFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.fluid-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowDirection",
+ "name": "{i18n:scada.symbol.flow-direction}",
+ "hint": "{i18n:scada.symbol.flow-direction-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "bottomFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.bottom-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -42,12 +384,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -56,32 +397,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/top-right-elbow-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/top-right-elbow-connector-hp.svg
index f2d579c551..8ec4e3cc65 100644
--- a/application/src/main/data/json/system/scada_symbols/top-right-elbow-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/top-right-elbow-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Top right elbow connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimation,\n animationDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `-${dashWidth + (dashGap || dashWidth)}` : `${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "line",
@@ -10,23 +11,132 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "animationDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -37,12 +147,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -51,32 +160,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/top-tee-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/top-tee-connector-hp.svg
index 004096aaa7..e4561a8347 100644
--- a/application/src/main/data/json/system/scada_symbols/top-tee-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/top-tee-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Top tee connector",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\n\nconst leftLine = \"M0 100H100\";\nconst topLine = \"M100 97L100 0\";\nconst rightLine = \"M100 100H200\";\n\nprepareFlowAnimation('left', leftLine);\nprepareFlowAnimation('top', topLine);\nprepareFlowAnimation('right', rightLine);\n\nfunction prepareFlowAnimation(prefix, line) {\n const flowAnimation = ctx.values[prefix + 'Flow'];\n const flowDirection = ctx.values[prefix + 'FlowDirection'];\n const flowAnimationSpeed = ctx.values[prefix + 'FlowAnimationSpeed'];\n\n const animation = ctx.tags[prefix + 'Line'][0];\n const offset = Date.now() % 1000;\n const duration = 1 / flowAnimationSpeed;\n \n const prevFlowAnimation = animation.remember('flowAnimation');\n const prevFlowDirection = animation.remember('flowDirection');\n const prevFlowDuration = animation.remember('flowDuration');\n \n if (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(animation, offset, flowDirection, duration, line);\n } else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n } else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n }\n}\n\nfunction animateFlow(group, offset, flowDirection, duration, line) {\n group.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n group.add(``);\n}",
"tags": [
{
"tag": "line",
@@ -15,23 +16,364 @@
"actions": null
}
],
- "behavior": [],
+ "behavior": [
+ {
+ "id": "leftFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "leftFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.left-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.fluid-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowDirection",
+ "name": "{i18n:scada.symbol.animation-direction}",
+ "hint": "{i18n:scada.symbol.animation-direction-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "topFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.top-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlow",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowDirection",
+ "name": "{i18n:scada.symbol.flow-direction}",
+ "hint": "{i18n:scada.symbol.flow-direction-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.forward}",
+ "falseLabel": "{i18n:scada.symbol.reverse}",
+ "stateLabel": "{i18n:scada.symbol.forward}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": true,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;",
+ "compareToValue": true
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "rightFlowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": "{i18n:scada.symbol.right-connector}",
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ }
+ ],
"properties": [
{
"id": "mainLine",
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -42,12 +384,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -56,32 +397,95 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "color",
+ "default": "#C8DFF7",
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/vertical-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/vertical-connector-hp.svg
index 6ce9336fee..cfaf6793ea 100644
--- a/application/src/main/data/json/system/scada_symbols/vertical-connector-hp.svg
+++ b/application/src/main/data/json/system/scada_symbols/vertical-connector-hp.svg
@@ -3,6 +3,7 @@
"description": "Vertical connector with an optional directional arrow to visually indicate flow.",
"widgetSizeX": 1,
"widgetSizeY": 1,
+ "stateRenderFunction": "const {\n flowAnimation,\n arrowDirection: flowDirection,\n flowAnimationSpeed\n} = ctx.values;\nconst {\n flowAnimationWidth: lineWidth,\n flowAnimationColor: lineColor,\n flowStyleDash: dashWidth,\n flowStyleGap: dashGap,\n flowDashCap: dashCap\n} = ctx.properties;\nconst line = ctx.tags.line[0].attr('d');\nconst animation = ctx.tags.animationGroup[0];\nconst offset = Date.now() % 1000;\nconst duration = 1 / flowAnimationSpeed;\n\nconst prevFlowAnimation = animation.remember('flowAnimation');\nconst prevFlowDirection = animation.remember('flowDirection');\nconst prevFlowDuration = animation.remember('flowDuration');\n\nif (flowAnimation && flowAnimation !== prevFlowAnimation) {\n animation.remember('flowAnimation', flowAnimation);\n animation.remember('flowDuration', duration);\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && flowDirection !== prevFlowDirection) {\n animation.remember('flowDirection', flowDirection);\n animateFlow(offset, flowDirection);\n} else if (flowAnimation && duration !== prevFlowDuration) {\n animation.remember('flowDuration', duration);\n animation.findOne('animate').attr('dur', `${duration}s`) ;\n} else if (!flowAnimation && prevFlowAnimation) {\n animation.remember('flowAnimation', null);\n animation.clear();\n}\n\nfunction animateFlow(offset, flowDirection) {\n animation.clear();\n const dashArray = `${dashWidth}${dashGap ? ` ${dashGap}` : ''}`;\n const value = flowDirection ? `${dashWidth + (dashGap || dashWidth)}` : `-${dashWidth + (dashGap || dashWidth)}`;\n\n animation.add(``);\n}\n",
"tags": [
{
"tag": "arrow",
@@ -85,6 +86,83 @@
},
"defaultSetValueSettings": null,
"defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimation",
+ "name": "{i18n:scada.symbol.flow-animation}",
+ "hint": "{i18n:scada.symbol.flow-animation-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "BOOLEAN",
+ "trueLabel": "{i18n:scada.symbol.present}",
+ "falseLabel": "{i18n:scada.symbol.absent}",
+ "stateLabel": "{i18n:scada.symbol.flow-present}",
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": false,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "key": "state",
+ "scope": null
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "compareToValue": true,
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
+ },
+ {
+ "id": "flowAnimationSpeed",
+ "name": "{i18n:scada.symbol.flow-animation-speed}",
+ "hint": "{i18n:scada.symbol.flow-animation-speed-hint}",
+ "group": null,
+ "type": "value",
+ "valueType": "DOUBLE",
+ "trueLabel": null,
+ "falseLabel": null,
+ "stateLabel": null,
+ "defaultGetValueSettings": {
+ "action": "DO_NOTHING",
+ "defaultValue": 1,
+ "executeRpc": {
+ "method": "getState",
+ "requestTimeout": 5000,
+ "requestPersistent": false,
+ "persistentPollingInterval": 1000
+ },
+ "getAttribute": {
+ "scope": null,
+ "key": "state"
+ },
+ "getTimeSeries": {
+ "key": "state"
+ },
+ "getAlarmStatus": {
+ "severityList": null,
+ "typeList": null
+ },
+ "dataToValue": {
+ "type": "NONE",
+ "dataToValueFunction": "/* Should return boolean value */\nreturn data;"
+ }
+ },
+ "defaultSetValueSettings": null,
+ "defaultWidgetActionSettings": null
}
],
"properties": [
@@ -93,16 +171,8 @@
"name": "{i18n:scada.symbol.main-line}",
"type": "switch",
"default": true,
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
"id": "mainLineSize",
@@ -113,12 +183,11 @@
"subLabel": "Main",
"divider": true,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "secondaryLineSize",
@@ -127,48 +196,93 @@
"default": 2,
"required": true,
"subLabel": "Secondary",
- "divider": null,
"fieldSuffix": "px",
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
"min": 0,
"max": 99,
- "step": 1
+ "step": 1,
+ "disabled": false,
+ "visible": true
},
{
"id": "lineColor",
"name": "{i18n:scada.symbol.line-color}",
"type": "color",
"default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "disabled": false,
+ "visible": true
},
{
- "id": "arrowColor",
- "name": "{i18n:scada.symbol.arrow-color}",
+ "id": "flowAnimationWidth",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 4,
+ "subLabel": "Width",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowAnimationColor",
+ "name": "{i18n:scada.symbol.flow}",
+ "group": "{i18n:scada.symbol.animation}",
"type": "color",
- "default": "#1A1A1A",
- "required": null,
- "subLabel": null,
- "divider": null,
- "fieldSuffix": null,
- "disableOnProperty": null,
- "rowClass": "",
- "fieldClass": "",
- "min": null,
- "max": null,
- "step": null
+ "default": "#C8DFF7"
+ },
+ {
+ "id": "flowStyleDash",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "required": true,
+ "subLabel": "{i18n:scada.symbol.dash}",
+ "divider": true,
+ "fieldSuffix": "px",
+ "min": 0,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowStyleGap",
+ "name": "{i18n:scada.symbol.flow-style}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "number",
+ "default": 10,
+ "subLabel": "{i18n:scada.symbol.gap}",
+ "fieldSuffix": "px",
+ "min": 1,
+ "step": 1,
+ "disabled": false,
+ "visible": true
+ },
+ {
+ "id": "flowDashCap",
+ "name": "{i18n:scada.symbol.flow-dash-cap}",
+ "group": "{i18n:scada.symbol.animation}",
+ "type": "select",
+ "default": "butt",
+ "items": [
+ {
+ "value": "butt",
+ "label": "{i18n:scada.symbol.dash-cap-butt}"
+ },
+ {
+ "value": "round",
+ "label": "{i18n:scada.symbol.dash-cap-round}"
+ },
+ {
+ "value": "square",
+ "label": "{i18n:scada.symbol.dash-cap-square}"
+ }
+ ],
+ "disabled": false,
+ "visible": true
}
]
}]]>
-
+
\ No newline at end of file
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 18801bda2c..72c2cf80ae 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -3260,6 +3260,8 @@
"left-bottom-connector": "Left bottom connector",
"top-left-connector": "Top left connector",
"top-right-connector": "Top right connector",
+ "top-connector": "Top connector",
+ "bottom-connector": "Bottom connector",
"running-color": "Running color",
"stopped-color": "Stopped color",
"stopped": "Stopped",
@@ -3332,8 +3334,20 @@
"arrow-presence": "Arrow presence",
"arrow-presence-hint": "Indicates whether arrow is present in connector.",
"arrow-present": "Arrow present",
- "arrow-direction": "Arrow direction",
+ "arrow-direction": "Arrow/Animation direction",
"arrow-direction-hint": "Indicates flow direction.",
+ "animation-direction": "Flow animation direction",
+ "animation-direction-hint": "Indicates animation flow direction.",
+ "flow-animation": "Flow animation",
+ "flow-animation-hint": "Indicates whether animation is present in connector.",
+ "flow": "Flow",
+ "flow-style": "Flow style",
+ "flow-dash-cap": "Flow dash cap",
+ "dash-cap-butt": "Butt",
+ "dash-cap-round": "Round",
+ "dash-cap-square": "Square",
+ "dash": "Dash",
+ "gap": "Gap",
"main-line": "Main line",
"line": "Line",
"line-color": "Line color",