diff --git a/application/src/main/data/json/system/scada_symbols/horizontal-connector.svg b/application/src/main/data/json/system/scada_symbols/horizontal-connector.svg
deleted file mode 100644
index 267ab0d155..0000000000
--- a/application/src/main/data/json/system/scada_symbols/horizontal-connector.svg
+++ /dev/null
@@ -1,51 +0,0 @@
-
\ No newline at end of file
diff --git a/application/src/main/data/json/system/scada_symbols/horizontal-pipe.svg b/application/src/main/data/json/system/scada_symbols/horizontal-pipe.svg
new file mode 100644
index 0000000000..6dc82ca4ef
--- /dev/null
+++ b/application/src/main/data/json/system/scada_symbols/horizontal-pipe.svg
@@ -0,0 +1,287 @@
+
\ No newline at end of file
diff --git a/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json b/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json
index 153afd0335..49e42f3f03 100644
--- a/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json
+++ b/application/src/main/data/json/system/widget_bundles/scada_water_system_symbols.json
@@ -23,7 +23,7 @@
"top_black_counter",
"right_bottom_angle_connector",
"vertical_connector",
- "horizontal_connector",
+ "horizontal_pipe",
"pump_left",
"pump"
]
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts
index bfc1187f8f..47de450351 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts
@@ -28,6 +28,7 @@ import {
import {
createLabelFromSubscriptionEntityInfo,
formatValue,
+ guid,
isDefinedAndNotNull,
isUndefinedOrNull,
mergeDeep,
@@ -44,6 +45,7 @@ import { ResizeObserver } from '@juggle/resize-observer';
import { takeUntil } from 'rxjs/operators';
export interface ScadaSymbolApi {
+ generateElementId: () => string;
formatValue: (value: any, dec?: number, units?: string, showZeroDecimals?: boolean) => string | undefined;
text: (element: Element | Element[], text: string) => void;
font: (element: Element | Element[], font: Font, color: string) => void;
@@ -61,6 +63,7 @@ export interface ScadaSymbolContext {
tags: {[id: string]: Element[]};
values: {[id: string]: any};
properties: {[id: string]: any};
+ svg: Svg;
}
export type ScadaSymbolStateRenderFunction = (ctx: ScadaSymbolContext, svg: Svg) => void;
@@ -502,6 +505,15 @@ export class ScadaSymbolObject {
private init() {
this.context = {
api: {
+ generateElementId: () => {
+ const id = guid();
+ const firstChar = id.charAt(0);
+ if (firstChar >= '0' && firstChar <= '9') {
+ return 'a' + id;
+ } else {
+ return id;
+ }
+ },
formatValue,
text: this.setElementText.bind(this),
font: this.setElementFont.bind(this),
@@ -515,7 +527,8 @@ export class ScadaSymbolObject {
},
tags: {},
properties: {},
- values: {}
+ values: {},
+ svg: this.svgShape
};
const taggedElements = this.svgShape.find(`[tb\\:tag]`);
for (const element of taggedElements) {
diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.scss b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.scss
index c553338969..370984230b 100644
--- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.scss
+++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.scss
@@ -92,6 +92,9 @@
&-api, &-api-method {
color: #7214D0;
}
+ &-svg, &-svg-method {
+ color: #c24c1a;
+ }
&-properties, &-values, &-tags, &-api {
// font-style: italic;
// font-weight: bold;
diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.component.html b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.component.html
index 20cc6fb40e..4eaaf6d718 100644
--- a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.component.html
+++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.component.html
@@ -20,21 +20,31 @@