diff --git a/application/src/main/data/json/system/widget_bundles/liquid_level_tanks.json b/application/src/main/data/json/system/widget_bundles/liquid_level_tanks.json new file mode 100644 index 0000000000..c7be72810a --- /dev/null +++ b/application/src/main/data/json/system/widget_bundles/liquid_level_tanks.json @@ -0,0 +1,22 @@ +{ + "widgetsBundle": { + "alias": "liquid_level_tanks", + "title": "Liquid level tanks", + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAACGVBMVEUAAADt7e3u7u7f39/h4eH///96i//v7+/8+v/+/v/f4/+Rk7eQkLeHlv/i5v91eKXk5O7IyMjj4+OEhq52eKaQkJDIydutrsnh5P/y8vb9/f+srKybp/90dHS8xf9YWFiCgoLo6/+focBvfu1mZmZaZsmqqqv29//L0P/V1dWDha5bXZTx8fFZWVmCkv+0vv+Kmf/Gxdvx8v/k6P+tuP9oapy7w/+Dg665ubl1dqW8vdO6urr8/P2ensDV1uS6utLv7vbh4O2Sk7jJzeNKSkv6+vz4+PvU0uSrq8ktLS709PjW1+RPWbednZ0/QoKTof9NT4vBwtpOT1j4+P/a3v/FzP+rtf+lsP97jP/W2fFCS6Npa52jr/+Ypf+Glf91hfbU1NWbncmJirJJU648PDx/j/9kctumqMalpsKJi7d/gpC1vPeut/bCx+2xt+27veRqeOSlqdtUX8CYmbuChK2enp6Mj53V2v/N1P+eqf/Dyfvh3+3Kzu2YoOSys8u/wMiNkMOVlsB9gLd/gayYmqtwcqF8fIJzdYIxNHkkJ3BCQ0rK0f/P0/bd3/Tr6/LS0+24ve2pse3FyOStsNueo9tfbNJ9gsC6ubpKUq6lpqyYm6x9fqplZ5tYWpIyNXlnaXRaXWY9PT3v8f+Mm/++w/agqO3b3OPIy+O3utuFjdt1gNvT0tWgo9JfZ7dSWq6XmJ45QJRPUFk3ODybESj3AAAABXRSTlMA799gX1SLAhAAAAocSURBVHja7dyHV9tGHAfwJu2BzZno7LMlC2xMBCFFoh4thtjFAwNmhRVCCIWEQNNmNU0z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7gaO2GAOxVUc5ziau7Mh8yp8MZx9S6swVM4Mpf3rXP4LmZq81wU4bSvmHE6RtfmSTUAMLGVt5empDG1dOIirNmzg6QkYW9vzBFz8JlaPznzrjnv14KsiwVRi3WHAUO5m+4w8C/mihAn+JFeeAAAAABJRU5ErkJggg==", + "description": "By visually representing the liquid's volume, these widgets help in monitoring, optimizing storage, and ensuring efficient operations. Suitable for a variety of storage setups, they are essential for industries requiring precise liquid management.", + "externalId": null, + "name": "Liquid level tanks" + }, + "widgetTypeFqns": [ + "vertical_cylinder_tank", + "rectangle_tank", + "horizontal_cylinder_tank", + "horizontal_ellipse_tank", + "horizontal_oval_tank", + "vertical_oval_tank", + "horizontal_capsule_tank", + "vertical_capsule_tank", + "horizontal_2_1_elliptical_tank", + "horizontal_dish_ends_tank" + ] +} diff --git a/application/src/main/data/json/system/widget_types/horizontal_2_1_elliptical_tank.json b/application/src/main/data/json/system/widget_types/horizontal_2_1_elliptical_tank.json new file mode 100644 index 0000000000..ec27703f49 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/horizontal_2_1_elliptical_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "horizontal_2_1_elliptical_tank", + "name": "Horizontal 2:1 elliptical tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAYAAABJ/yOpAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABKZSURBVHgB7Z1tcFRX/cd/SysPhWxDKkzJbicgmWk2Bf/wnzbBcQTbJKVasEDqCzItEGYUqVDqTGmHSqoD2I7lhQUpjG8aqQ68kACOfdGStA5Rxzx0FKUSUBgSyaaOtXnYDUKgZD3fszlhC9mTfTh799zk9xnu7Gb33rOXe37f83s498FDgosXL872eDy14u0CseQSw4xvjkcike/NmTOn3TMkjj/nCnJycmjChAnEMOOVwcFB6u/vp56enl4hkoV3CnH8JC8vT4qDYcY7cBBerxdCye3r66uFu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2nCYmPiho4ATPdOZD0DcYyBBavfLacfr+SytcUbmKxXX3O4Z7Xrd2Ca1Z/wYNXouKJNnLcn0F8+jjDJUxxxI4Tl0pDiQQB/oGfYS+qhZ9Vl42n9yGK28IjiSvclWJPPB9IgxAR6D8m6g3QfiAkZFPXNSD45RsHqJmyp+pIrrUfl72EfrKTYl5LK59/AEOOJ6n97TogPJH5tGmjY/RqkcTdd95VPa7KbTyq0Eqecg9CaPThMI+Kmu8Qhu+2Z3UY7RxE4b9B07ScZEvPrv5MVq7ZjG5FU97e3ukoKCA3Aquad67711qaDgtL8Bhsg+eWrtKeI11Qhhuyzli6ejocL9AYrH1YfTjDb+LRRELBDKmnjA1VjqGsQd+ahfDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaGCBMIwGFgjDaIBAegcHB4lhmJsoTUAgp8LhMDEMc5P+/n68HJ8QiUSqewWhUIjYkzDjHWhAyIF6enp6hTa+58GHFy9enO3xeH4i3q4ghhnf9IrlFBzHnDlz2v8HkYK4iS2iP14AAAAASUVORK5CYII=", + "description": "Widget indicates the level of liquid in Horizontal 2:1 elliptical tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Horizontal 2:1 Elliptical\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"rgba(255, 255, 255, 0.76)\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} diff --git a/application/src/main/data/json/system/widget_types/horizontal_capsule_tank.json b/application/src/main/data/json/system/widget_types/horizontal_capsule_tank.json new file mode 100644 index 0000000000..3efff49a81 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/horizontal_capsule_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "horizontal_capsule_tank", + "name": "Horizontal capsule tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABg1BMVEXg4ODf39/g4ODg4OAAAAD////8+v96i//g4OD+/v/f4/8hISE/QYJbXZSxuv+rqsnGxdv8+/8kJ3CQkJD+/f+rtf+srKzh3+1aXZPj4+Px8fGRk7fi5v8xNHl0dHTIydvHx8g9PT3k5O2Ehq51dq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L62ZcHeuzpb0dG3uf1rT0pnXh8+azWx/f906rFDXHUUiUvNEGoaaRX6NgPFw0470LfZ6/fWbGd+/MQ/9a2ToaIhQ3jiSyNkWoafT4mQAF48NCT+QMClXrCaIQuE2qjRfyqxSMlQcYItYTROFFUiD2U1eFFsn8Cp7IyjxaiYAYsX8+sCEKwuJDM3aQRMzknJ5GEQlNAQ8pESEDza25G2ZUUB5JRzH+cuEDikg32SImErMZgG/MUTisG+KHohiZRUzEI7NVm/EXh3EOQbzGAA85kYIfUu4ISY8vruhAJChyPQp9JAsTFAJY4lUGEH0/UpBVBVrtyFjiCBUiEhXxyNIqrNpnkSUs8fHDKkQCpF+GFnlIn2JMcVgsHyIe4qMN4q+n/apCukgUNSUMYsGAXto/oI5jicwuH9ic6BkwkCUcd7rUXiYW8GaSA6fQ7p1iYiCLaor3a/v6RszcshpmOJ2paHkwy5wKgO/su8WYuWUvXuNBc1ALz5qA75b25NY8Zm7N2tRHbcryIC5imRRZXfmn3JqG55ZygY02B7s4M6OHdt/idbzcgubiS1UqfhnsctkESPI1BXKLUZlYhKTVTAo0Br6AuQUYPQC5xQhAc7FUVZmoUB/CknIRPOH1UOmfy72vwaZAbEi7FZogyeq1NchsjcCDPx7JWsfQKDbrQ9t2kWgCwPB67aVidoJ/N7sroY46I1kaBESQEf1cSmK96ovu1x+BEA7fpqud2gV1hpVSnL9cH/7WpISYBZyczUtcnsFB4hgpn5Q50BLrw9+a9It6rCC0/LhkW0KhXHfMZjFH4Io4DVfEabgiTsMVcRquiNNwRZyGK+I0XBGn4Yo4DVfEabgiTsMVcRquiNNwRZzGERI5djQ+EHz62Imj8cnmk0fnI9qnjp88/b9z7MTxUz8BmBKhEvioflsAAAAASUVORK5CYII=", + "description": "Widget indicates the level of liquid in Horizontal capsule tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Horizontal Capsule\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"#FFFFFFC2\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_types/horizontal_cylinder_tank.json b/application/src/main/data/json/system/widget_types/horizontal_cylinder_tank.json new file mode 100644 index 0000000000..1791d5b29c --- /dev/null +++ b/application/src/main/data/json/system/widget_types/horizontal_cylinder_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "horizontal_cylinder_tank", + "name": "Horizontal cylinder tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABa1BMVEXg4ODf39/g4ODg4OAAAAD///96i//g4ODf4/+Rk7d2eKb9/f8hISGQkJCyvP9bXZQ/QoIkJ3Dj5O2srKzIydvx8vbj4+OTof/x8fHIyMitrsni5f90dHQ9PT33+P/m6f9NUIueoMAyNHkxNHnk5O2Ehq/t7//W1+QfHyGenp5YWFjV1dXx8fY/QoE7Ozzr6/JZWVmsrslKSkrY3f/39/mfocC6urqCgoJmZmbGzf9vcaEvLy8uLi7u8f++xv9vfu27vNJZZcmSk7icnqwuM4IpLXmst/+bqP+Kmf+Ckv/7+/zt7fNoap3N1P/z8/e6u9JfbNJpa504P5J1d4KAgIHS2P91hfbv7/Td3/FpeOTT1eO9wNfExMhJU65oapxMT4yjr//4+PvQ1PaRkp5oa5w+RpxycnRSU1i1vv9lctvS09VTX8BOWbiZmZ5pa5xpanSmrNt/hsm0tsejprlwdrdzdaR/gZBDRUsrLC5yLDHaAAAABXRSTlPvIL+vAC9A4IoAAAcFSURBVHja7NZBioMwFMZxOzMfXTRZBR4JJAeIAZEsVNBjzP3PMi91ILR0mF15tvnTmkRB/KGC3dfpozsfvc/TV3fq7AUH72KZ8WnxAll+rA5/P0qXrjvjJTo3iLAaRFoNIq23hTiqw4PI4ck9hphxH3LCXd95H5Wuw4O0wvOrkPvrSJ5wl4lHhJCxgIsuTdepNQQ3AZgiVQjvjsSbxHCzr8RBjHI8DWELcDwlZeAD0Ku8VggNa68i+hHln7Y1rEkiZFiAfANxKoIqxK+EebVa2XJ8yMUjEEIqAv0NRCsLVEgOWi+KrDKmbHutcxAJMf9AQvCcRe+XEaRGXswCIXbzv5AJaYeYYqqQZWUX/+K6sXkbeUGCICOX9pfdLyrAbsM87BAbBp8rJG2D7jNglSoctcyDnDvidImSJsB43QeAvJ90whQBmr2Lbhe761JbsMGAm2Yfywnw9CrkzxhymN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XhsfMNRSSnXzTAL0iskNBdzhe1vuyPNQvZZeT2OULt3dbBFET2ZOMOUw+fPEMFnM27y0O9cNB7ndhkLvShZyDaZ6YPaenzPkwJERxi9IOYdI99Qzayg2mbirKoV74pfcUh4E5OPnq9o2Qj40nGjURFRq4IlzF+5kWb9j9uWu3vStz8S/feoJzfRfyEd4r0tvGp0qYHjt135cbxuGWiIwEaiJ8GrTwRDpdUpEW4LI0f+ru44mMRqQi+wIL6InA4gZmrne8ozKWiP+tN6g+fFARXpJUuG3vcN7AEWmEvChIoiiST4tNHJHNrn/cnA+m5X9FnstSFAFIKuOIHG2GCPm0igBNERXJWJFVIRUpIYmqSD4jNjAi64jUo8FzWcp/9DwJhwKpdUhFwhACuiJCOnhKNmukHk2ezVIWASh4SmrEqR7WIKAtkk3zAav7OfGEbFkZQl0EaKjUmnjLqu2QBlYJaoC+SJ4tGhPXkFGIkLZKv4TDzXd+wqp4Udsm9Cjz9ItqXKqsuDV2/16vECcIW51e4dk4k516h9RDTGmAXATfpHy/xwXpHktMwWlWmUKWbzfvroR1whWkZfAsnG65bDW9WroVXtuj2imZRllWM9XpFzCnhFK78U/jvN4lyvNGWRYQKzxCbXyVtavZlbDN5+91tBt+MMbBwYHh9BRZVFG6Kj7OaQUJcSyCEKYyHMfC/+K1xQ/r+vE5h1Rxdo9dYCMtizN9EGYcM3cQ5k97d0IDAAwDILBfUv+OZ4M1nAMUgGEIjSE0htAYQmMIjSE0htAYQmMIjSE0htAYQmMIjSE0htAYQmMIzaGQuDEI3qgby+a+M9Ge7P1dVM4DayA5WtbTgEwAAAAASUVORK5CYII=", + "description": "Widget indicates the level of liquid in Horizontal cylinder tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Horizontal Cylinder\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"#FFFFFFC2\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_types/horizontal_dish_ends_tank.json b/application/src/main/data/json/system/widget_types/horizontal_dish_ends_tank.json new file mode 100644 index 0000000000..35ebb08750 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/horizontal_dish_ends_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "horizontal_dish_ends_tank", + "name": "Horizontal dish ends tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANS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VeiyQLyBJ/8t4GWBdBtpEEi22GSAsMUE6QBdMs3kk3wh9OwLApE0oc0VImh1EAjSShWekIr5Fuqrt0aXJ6RbSANBctUOT0gnlQOC6FqNJ6SG60AQpM1U+EEqMxhBQbKJU36QZjECBtFxjR8khnUgiH1s8YHYRxYcJFs85QVpViOAEF3bafOBbO9gCRCC0o1NPpBWIY0gITqu8YHEcAYUgtYLLR6QVgEjWIiOP7fhIdYOAYagdGITHrKZwAgaomu7N9CQm5ImgUPQfh5DQ3BqH8FD3mEf9K+DfHiFAwRJmg84TUI8IGhFAm7FaTdU/quhujO0fy7EhQxLLsRpuRCn5UKclgtxWi7EabkQp+VCnJYLcVouxGm5EKflQpzWCEE8o/EHwVOecQONQAsTnjHPwtDvE8WgjMmxialhzzM+NvkHPLFdf1u4AJwAAAAASUVORK5CYII=", + "description": "Widget indicates the level of liquid in Horizontal dish ends tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Horizontal Dish Ends\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"rgba(255, 255, 255, 0.76)\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} diff --git a/application/src/main/data/json/system/widget_types/horizontal_ellipse_tank.json b/application/src/main/data/json/system/widget_types/horizontal_ellipse_tank.json new file mode 100644 index 0000000000..01fdb879b0 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/horizontal_ellipse_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "horizontal_ellipse_tank", + "name": "Horizontal ellipse tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABaFBMVEXg4ODf39/g4ODg4OAAAAD///96i//g4ODf4/8gICHj5O3IyduyvP/9/f8kJ3A/QoJ2eKaRk7fy8vaQkJAxNHmsrKzIyMitrsnj4+O5wv9bXZTk5O0/QoF0dHTx8fHm6v89PT3i5f/W1+T29/9aXZOdnZ5NT4vt8P/8/P27vNOEhq6eoMBYWFguLi7V1dWfoMDv8f+bqP+Dha5ZWVlvfu1mZmY7OzzFzf89P4BnapyCgoL19fg6QJUuM4JKSkqCkv/s7PK6urpOWbeEhq/e4v/M0/+st//6+vzu7vNoap2Pj4/T2f+9xf/w8PVmdN4pLXl1hfZUX8CnqKx0doKhrv91hPbw8PBKUq9ETKVpa52HiJDp6vHV2fHMz+PFx9VZZs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b4IsB4OnuqDH4A+j7Ba8hW1XRsnvU4oMnrNDKJqk/qHAGfVs0m1TCZSh8aObRdHoBisn4Ixau56tuS1GJgpgsJ4OkulQEtCyu5Ott2tuCtuvzioyP/J5rZBqkjksLlq6SuSHnuBEkd3ZHrahEkIpShSgwSn2EGpZ1LzmvGUgvZQRWg6e5FH75zDFdUvIbNqIU+dNOsT2T2caraKmKGTE0uK5v/7KGeqCbCqKVuT9iLa+srW6urG1sr4+Jzq/bBymTA3L916T6NToNE3xDpq+0+tBH/u/kxdImuxTx2LK9E4cx8MzOM4/bnO/Y9AzZNx6hoxbv9u7oyIAQhiIoS1wgwu+TxH+pYCM0EkcvFkBK4SWEFpCaAmhJYSWEFpCaAmhJYSWEFpCaAmhJYSWEFpCaAmhJYRWIUjUOAie0fZXoNUjYz2/yb8vY2SfrxctxwH1s0SZo8iyaQAAAABJRU5ErkJggg==", + "description": "Widget indicates the level of liquid in Horizontal ellipse tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"Static\",\"selectedShape\":\"Horizontal Ellipse\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"#FFFFFFC2\",\"rangeList\":[{\"from\":0,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_types/horizontal_oval_tank.json b/application/src/main/data/json/system/widget_types/horizontal_oval_tank.json new file mode 100644 index 0000000000..d094cac0d4 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/horizontal_oval_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "horizontal_oval_tank", + "name": "Horizontal oval tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABcVBMVEXg4ODf39/g4ODg4OAAAAD///96i//g4ODf4/+trsl2eKZaXZMhISGyvP+8xf/9/f4kJ3A/QoKQkJCRk7fj5O3j4+Px8fF0dHTx8vbi5f/IyMg9PT3IydueoMCsrKzm6f/t8P/k5O1YWFj8/P/19/+Ehq8yNHlNT4sxNHk7OzwuLi7V1dWdnZ6focBvfu27vNKCgoKsrsllZWZZWVkfHyH3+P+JmP/V1uTr6/JKSkrv8f+hrv/W1+STof/29vmkpcC6urqPj48uM4LFzP+Ckv9PWbirq6toapzN1P+bqP9mdd9pa51oap1oa5y3wP75+fzMz+OrrMioqcaNjZB7fIIpLXm9xf+tt/+zu/nz8/d1hfbv7/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uWh47Yv6gSlIGGcDKwUcp6O7OQ7NXlUnBubz1ws5/dFuNY+OjpoD31u7MhEn0SotBlqcmbAsKp1m+1ZnSiylqI+KM/ft4szVl/v7/d+/q8q0JPyHut9ilqUIhh0vjlIB8+OM9H+snDxDniGjkmfI7/buhAYAGAZAYL+k/h3PBms4ByiAxhAaQ2gMoTGExhAaQ2gMoTGExhAaQ2gMoTGExhAaQ2gMoTGExhCajbgxCN6oG8vmvjPRnuz9XVTOA1xUNhuTb2OxAAAAAElFTkSuQmCC", + "description": "Widget indicates the level of liquid in Horizontal oval tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Horizontal Oval\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"rgba(255, 255, 255, 0.76)\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_types/rectangle_tank.json b/application/src/main/data/json/system/widget_types/rectangle_tank.json new file mode 100644 index 0000000000..d96165cc89 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/rectangle_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "rectangle_tank", + "name": "Rectangle tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABO1BMVEXg4ODf39/g4ODg4OAAAAD///96i//g4ODg5P8kJ3Dj5O2Rk7cgICGbqP+trslbXZR2eKXS1/+QkJBPWbf9/f25wv/j4+Pr6/KsrKx0dHQ9PT3k5//x8fFYWFj8/f/3+P/p7P/N1P/w8v/IydvIyMjHx8fV1dU7OzwxNHlKSkry8vadnZ1aXZOCgoLW1+Th4eO6urpNT4tmZmaEhq5AQoIvLy+7vdMuLi6tuP+rq6uenp6Fh5A/QoJrbHRWVlgdHiGUov/U2PHk5O2eoMDp6//w8PCEhq9oa52Pj4+zvP+dn6yRlJ5XWZHb4P+NnP+Glv+Bkv+Wo/n19fjX2vHd3ebQ0uPP0NWztcifocCxs7p6gLeZm6x/f4J6fIJPUFgqKy+jr//FyvdfbNKfoMBKU66ho6s5QJRgYWZHR0qLIwwHAAAABXRSTlPvIL+vAC9A4IoAAASMSURBVHja7d1pV9pAFIBhqF4wYYwYaZqkiVgCCQHZQSoVaLVqW+2+7/vy/39BJ0uNWq34IXZG73swcycel+eMHv3CITGdvJRI895UcjqRTGzmgPNyBmVMG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evRt0Yv6XXt854/HEnvPX05dXh8MPTYHOdachM1C3rlr9IK3SN2ttxAzk2hCDk9JAH5wXyaH5ix/2HLENSD+9enqy7D1JMQ04RQhCCEIQgBCFhCEEIQhDCMORR6q/4hMymYm/hWzTPdDpxQKBszaRi78uPvXEWWlIskEyrcvvTbNDj2Zh63F0Ip8v5jS7EAoHsmlQXvZ7V6RpTK+Ws5Q9Wp1yPCQJSSzi7ulvrjDxZbIL4eNbbv0IIQngJIayFENZCCGshhLUQwloIYS2EsBZCWAshrIUQ1kIIayGEtRDCWulE4ny8QHA6cWkTzkHGVCKZMLg/k9wmZUwnp9K8l7iUnP4Nc4MWLx4Y3iIAAAAASUVORK5CYII=", + "description": "Widget indicates the level of liquid in Rectangle tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Rectangle\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"#FFFFFFC2\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_types/vertical_capsule_tank.json b/application/src/main/data/json/system/widget_types/vertical_capsule_tank.json new file mode 100644 index 0000000000..33c49ba0e7 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/vertical_capsule_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "vertical_capsule_tank", + "name": "Vertical capsule tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABNVBMVEXg4ODf39/g4ODg4OAAAAD////8+v96i//g4OD+/v/g5P8kJ3Dh4O0hISH9/P+QkJBaZsk5QJPj4+NaXJOsrKwxNHk9PT3s7v9zc3Tx8fE/QoLIyMhYWFjl6P+Rk7fj5O37+v+rq8nGxdt2eKWKmf+AkP8uLi6trslAQoI7Ozz08/+7w//V1dWEhq6Dg66KmP+enp7JyttNT4s/QYKfoMB2d6ZZWVn09f/v7fZbXZSqtP+Tof9oap2Ckv+dncC5ubqSk7iCgoLx8vbU1OS5uNJmZmZJSUqbp/+7vNKsrskfHyHDyf/y8vbv7/BLS0vU1//L0P/k5O3b3v/k6P+ytch7fIJSU1nk5f+zu/+Qnf/Z2uO+wtV6gsmYmqVCR5OFh4+BgYHk5/+Nm//Y3PGxsbqrrbpiYmb7q/JyAAAABXRSTlPvIL+vAC9A4IoAAAYGSURBVHja7d17W5pQHMBx23aoh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yEMUcLxMu4xBNSsLSkCRp32QZohSklqdZU6qSzDLE0HUYkZEEo6HrDEM0yfUgSWcRFtJ4l6kp7EHMgrE4hugBxOhvLGqsQT7pyqLeOgsZKcmEzAxEiHkp3ixkR5f3kjpsJSV/p6ElY8fhh9wd1y9AO05hwdjZu3t3Y+Oun6wZ8vEqfsjKykqxWPSWhRfFlW87z4vvdwzYAbveGM9rP96seBtYIa/vnbQZ/1XhBSye7+zsbAz8Hd8HHz++iI5XN399wWtUkPvzJz248/QOvHk9e+st375/difo2dfPd7yPP5g/aQkr5OZEcQiHTAv5MhnkPnrI/OoEjKPVefyQyeIQDuEQDrlISHQGyANEfwyl6ofboftQx/Pnaavy7lbo3lXqaCBduzQfulKvgwZSrhyGhxwguqkmp8bDQ+LqFhpImrbvz3D1fYIGQqzMq7CQ1Uwez62AcJIchYUcNZuIIDUqPAz7zFrGdLssqWdK4SC7dh7TDcwkpRYfhrxm5VBB1mmmFPJUx3WTf8ghWYqrj3BNu/CGZDfUGYJtIgzJLbc3px6Q9nIO29QkQjqV+JRProfxShPfZDHyhA4PpoMc2PknCCGkRqOlaRwlpBMqCXm0DJIpHMuPcE5x9SXTOLBOOiakCZKJHYingY/H5GBpguvVEYwH5on5IKG9+Or/HJtxmzZwv1QCIbV8M3q49M/hOGxX8jXsL15ByJPmsi2Uls5llIo27T7G/3IiUC4PlMMHf31S7RYz6ng4WID4lGh8d/PsWGzuxtu9ej5HvNiAAKUjqvZAeHlQerXqVTp8KUR7qtg5GQ1WIHCu5DqUqpXeMAPZvUqX0k4jODfYgXjVGuVup57P5zvNcm5ATscW5Nw4hENYiUOwxSHY4hBscQi2OARbC5HI5fgHwQuRa3vkEmRej8xFTObHJLYHjBtz1xdYL3Jt7sZP1pNF7W75VtsAAAAASUVORK5CYII=", + "description": "Widget indicates the level of liquid in Vertical capsule tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Vertical Capsule\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"#FFFFFFC2\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_types/vertical_cylinder_tank.json b/application/src/main/data/json/system/widget_types/vertical_cylinder_tank.json new file mode 100644 index 0000000000..ba6666afbf --- /dev/null +++ b/application/src/main/data/json/system/widget_types/vertical_cylinder_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "vertical_cylinder_tank", + "name": "Vertical cylinder tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABU1BMVEXg4ODf39/g4ODg4OAAAAD///96i//g4OCHlv/i5v/e4v/j5O0kJ3AhISGRk7fg5P+trsmQkJA/QoLIydtaXZN2eKby8veqtP+Lmv+foMA8PDzx8fHj4+NbXZSKmf/IyMieqv+srKz6+v0dHSF0dHRYWFjw8PXV1uRNT4sxNHloap2st/+Ehq6Tof+Wo//39/oyNHmCkv81Nz1/j/8uLi7j5v/M0v/t7fPV1dXq6vJOT1hISEq0vv+YmqylsP+Ehq+7vNKCgoLo6v/KzeOdnZ1/gY/w8v/v8f+bqP/09PjV2fFmaHTS1//Dyv+8xf+Onf/Hy+O8wNW6u9Kenp5mZmZPUFnEzP+6uro+QYGjr/+wssdydIJaXGa8w//d3unFxtmjpbqrq6tiZJhWWJCPj48pKy7V2//T1vHX2OWkpcS5ubmLjZ4yNXkxNHhaWmaXmLtJTIgyHu8DAAAABXRSTlPvIL+vAC9A4IoAAAa4SURBVHja7NbNaoUwEIZhT9uPrmaR7WQgBJI7yCKQleAdKLgudNX7v4COtSD9o8sznpMXNYlufFDB4enyMDyfvcfL03AZPE6fV8bjDThUoq8VbqLhViDPHWKsDrFWh1jrbiFBjuGXJOAK/YS85H1oFd8a2z6SO4ZfcoQrpZCf91GT4FtxPiNEogfCFOr6MfVREFYAb5McED09iR6qwuO+MgeJFPBKzIURdCoUkRjI1MoBES6ZJuSMba+lcKkWIbwA7Qsk0Aw5IKkIxuJfyW/XuW0egxChGchfII48cEAaO7eQeIov2zE719gkJP4DYU6aR05LhlDWxWgQ4kv6hKyoOyRupgOyFHXpNpWi5pJ1IYYgWav7x54WYvjCI+8Qz5zaAamFXW6AJ1LOTMvIdp5IcFtSnQAxucyApLS6ircZkDGFKezi8LF0SsAUoa1jmoHgcJV2yJ8p5DTdB6RWnKa7/Y03W4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ENnxYIZcKJeQ9B3LRRHUtJgghyNCViHKMmA0CKvxCGESQtUd8RPmc4hCSIULkEkzcggAyBlnuQa5VWmupgWAjITJ4BJk4kQg6+iN83fGq5QBQEpB1t8+0gpU0SRwFILQHmScqrqaVgCnE6iKouYwtkfOQ8IhkA+wVIqucKE1jHXXa//ZQTi0EoiKpcPySSllnTp464qP9E+4OsilH1f+pr5dWfpwfRBzHuIh/wfZfBcI2i1x7JD7EHQMnnZEa4AsyUM8xEM8xEM8xENcg7x8PeTFAuRve+eu2jAMhlHnIgJSCEKWjT04QxZfA+2iydDgRZ40ZDD4BfL+j1BZFTRZ2tKY+LfReQDBQet3pJzg0T0iOcE2PqmQjEa+D4mq4OUiZIhWRDSiBkaoYuSlItaEUYRwOYrLe601fJaQSWIxykyq1nR99JRE22FTlr7Fk+V7NLGVqryp/vwPh3PZNbaPTS6TBpVEu2SBDbsb3NV9e/yDwLEta3GTXyeYVDlE0yeuvq7Uc159r6pPEmMhlFLlA7VSnRC4kSdkIH5c8aF890MAiaslvR6KbJ9nfFiUp+THS0wvVHfuLN+z4oMSUPW0xTyNECQZ08txlnFeBBr75oOm4Nysyu2m3CjA69kfCYlZk8eHO2JKr356Nyqfg8hvOBEnMhecCDScCDScCDScCDScCDScCDScCDScCDScCDScCDQWJOKhRbDz1sv4snmznE+0t6vNbu5469X2E/jIZcQWRBJVAAAAAElFTkSuQmCC", + "description": "Widget indicates the level of liquid in Vertical cylinder tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n}\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Vertical Cylinder\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(255, 255, 255, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"rgba(255, 255, 255, 0.76)\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/data/json/system/widget_types/vertical_oval_tank.json b/application/src/main/data/json/system/widget_types/vertical_oval_tank.json new file mode 100644 index 0000000000..a58dc67dd2 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/vertical_oval_tank.json @@ -0,0 +1,24 @@ +{ + "fqn": "vertical_oval_tank", + "name": "Vertical oval tank", + "deprecated": false, + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAABfVBMVEXg4ODf39/g4ODg4OAAAAD///96i//g4ODf4/8/QoIgICFbXZTIydutrsl2eKWRk7eyvP+st//j5O2QkJAkJ3AxNHn9/f7j4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OPiFDShkRH8TL6xbvrDlUhz8g9+KDJGRrP8Dp5+gDkSSADwJHoi1aGMjmLQykM4kTAkdSZRo2hDyQbEkaAzghQGV7U0yDDuaRB1IQ2SReCOBzWrbRjXWM6ngaYO8DzJAk671ekq+Ub8ExCjBDoES+VpI/qyA7EpkxgB8CxuFMFq6eRyWPxlisBlgJ2AEBSVYKFP4+lP1N1B+sVEmA95UtECiRWFHzXabk0/PHiAxPYkIWbVy7EFle0AupPxnncyiKrM+T8Mp8EtgHMSmsOgA8S7Wa32y/PM+/89+s3eXl5V2/Wa26VEoIOZkX7F9NEqdl9rFXFUVRzfGysSN9845U9eWR+U6VMjI7OvCflsUEFW4d3UrTklcMkL2+d0Wkre+REoWQFoWQFoWQFoWQFoWQFoWQFoWQFoWQFoWQFoWQFoWQFoWQFoWQFoWQltvlao4HBLtdrc3xyOa25nmIdntLm9vpuVpb2n8A2Fg5nh78ZrIAAAAASUVORK5CYII=", + "description": "Widget indicates the level of liquid in Vertical oval tank.", + "descriptor": { + "type": "latest", + "sizeX": 4, + "sizeY": 4, + "resources": [], + "templateHtml": "\n", + "templateCss": "", + "controllerScript": "self.onInit = function() {\n self.ctx.$scope.liquidLevelWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.liquidLevelWidget.update();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '250px',\n previewHeight: '250px',\n embedTitlePanel: true\n };\n};\n\nself.onDestroy = function() {\n}\n\nself.actionSources = function() { \n return { \n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false \n } \n };\n}", + "settingsSchema": "{}", + "dataKeySettingsSchema": "{}\n", + "settingsDirective": "tb-liquid-level-card-widget-settings", + "hasBasicMode": true, + "basicModeDirective": "tb-liquid-level-card-basic-config", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Vertical Oval\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"rgba(255, 255, 255, 0.76)\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}" + }, + "externalId": null, + "tags": null +} \ No newline at end of file diff --git a/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java b/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java index ee045976e7..9ad2ab6b3c 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java @@ -536,6 +536,7 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { this.deleteSystemWidgetBundle("outdoor_environment"); this.deleteSystemWidgetBundle("indoor_environment"); this.deleteSystemWidgetBundle("air_quality"); + this.deleteSystemWidgetBundle("liquid_level_tanks"); installScripts.loadSystemWidgets(); } diff --git a/ui-ngx/src/app/core/http/attribute.service.ts b/ui-ngx/src/app/core/http/attribute.service.ts index 9022a47eef..3ca29e425e 100644 --- a/ui-ngx/src/app/core/http/attribute.service.ts +++ b/ui-ngx/src/app/core/http/attribute.service.ts @@ -32,12 +32,18 @@ export class AttributeService { private http: HttpClient ) { } - public getEntityAttributes(entityId: EntityId, attributeScope: AttributeScope, + public getEntityAttributes(entityId: EntityId, attributeScope?: AttributeScope, keys?: Array, config?: RequestConfig): Observable> { - let url = `/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/values/attributes/${attributeScope}`; + let url = `/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/values/attributes`; + + if (attributeScope) { + url += `/${attributeScope}`; + } + if (keys && keys.length) { url += `?keys=${keys.join(',')}`; } + return this.http.get>(url, defaultHttpOptionsFromConfig(config)); } diff --git a/ui-ngx/src/app/core/services/resources.service.ts b/ui-ngx/src/app/core/services/resources.service.ts index 29d86fc2fb..f7a34c9ef5 100644 --- a/ui-ngx/src/app/core/services/resources.service.ts +++ b/ui-ngx/src/app/core/services/resources.service.ts @@ -68,7 +68,9 @@ export class ResourcesService { } const subject = new ReplaySubject(); this.loadedJsonResources[url] = subject; - this.http.get(url).subscribe( + const req$ = (url.endsWith('.raw') || url.endsWith('.svg') ? + this.http.get(url, {responseType: 'text'}) : this.http.get(url)) as Observable; + req$.subscribe( { next: (o) => { if (postProcess) { diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/basic-widget-config.module.ts b/ui-ngx/src/app/modules/home/components/widget/config/basic/basic-widget-config.module.ts index c26cf43542..3c42ec7c15 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/basic-widget-config.module.ts +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/basic-widget-config.module.ts @@ -70,6 +70,9 @@ import { import { ProgressBarBasicConfigComponent } from '@home/components/widget/config/basic/cards/progress-bar-basic-config.component'; +import { + LiquidLevelCardBasicConfigComponent +} from '@home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component'; @NgModule({ declarations: [ @@ -91,7 +94,8 @@ import { WindSpeedDirectionBasicConfigComponent, SignalStrengthBasicConfigComponent, ValueChartCardBasicConfigComponent, - ProgressBarBasicConfigComponent + ProgressBarBasicConfigComponent, + LiquidLevelCardBasicConfigComponent ], imports: [ CommonModule, @@ -117,7 +121,8 @@ import { WindSpeedDirectionBasicConfigComponent, SignalStrengthBasicConfigComponent, ValueChartCardBasicConfigComponent, - ProgressBarBasicConfigComponent + ProgressBarBasicConfigComponent, + LiquidLevelCardBasicConfigComponent ] }) export class BasicWidgetConfigModule { @@ -137,5 +142,6 @@ export const basicWidgetConfigComponentsMap: {[key: string]: Type + + + + + +
+
widget-config.appearance
+
+ + {{ 'widgets.liquid-level-card.title' | translate }} + +
+ + + + + + + +
+
+
+ + {{ 'widgets.liquid-level-card.icon' | translate }} + +
+ + + + + + + + +
+
+
+
+
widgets.liquid-level-card.shape
+ + + {{ DataSourceTypeTranslations.get(type) | translate }} + + +
+ + + {{ ShapesTranslationMap.get(shape) | translate }} + + + +
+
widgets.liquid-level-card.shape-attribute-name
+ + +
+
+
widgets.liquid-level-card.shape-by-attribute
+
+
+
+
+
+ + + {{ LevelCardLayoutTranslationMap.get(layout) | translate }} + + +
+
+
widgets.liquid-level-card.units
+
+
widgets.liquid-level-card.datasource-units
+
+ + +
+
+
+
widgets.liquid-level-card.widget-units
+
+ + + + {{ DataSourceTypeTranslations.get(type) | translate }} + + + + + + + + + +
+
+
+
widgets.liquid-level-card.total-volume
+
+ + + + {{ DataSourceTypeTranslations.get(type) | translate }} + + + + + + + warning + + + + + + + + +
+
+
+
+
widgets.liquid-level-card.color-and-font
+
+
widgets.liquid-level-card.tank-color
+ + +
+
+
widgets.liquid-level-card.liquid-color
+ + +
+
+
widgets.liquid-level-card.value
+
+ + +
widget-config.decimals-suffix
+
+ + + + +
+
+
+
widgets.liquid-level-card.total-volume
+
+ + + + +
+
+
+
+ + + + + {{ 'widget-config.tooltip' | translate }} + + + + +
+ + {{ 'widgets.liquid-level-card.level' | translate }} + +
+ + + + +
widget-config.decimals-suffix
+
+ + + + +
+
+
+ + {{ 'widgets.value-card.date' | translate }} + +
+ + + + + +
+
+
+
widgets.liquid-level-card.tooltip-background
+ + +
+
+
widgets.liquid-level-card.background-blur
+ + +
px
+
+
+
+
+
+
+
widget-config.card-appearance
+
+
{{ 'widgets.background.background' | translate }}
+ + +
+
+
widget-config.show-card-buttons
+ + {{ 'fullscreen.fullscreen' | translate }} + +
+
+
{{ 'widget-config.card-border-radius' | translate }}
+ + + +
+
+ + +
diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component.ts b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component.ts new file mode 100644 index 0000000000..4144d7db0b --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component.ts @@ -0,0 +1,444 @@ +/// +/// Copyright © 2016-2023 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { ChangeDetectorRef, Component, Injector, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Store } from '@ngrx/store'; +import { AppState } from '@core/core.state'; +import { BasicWidgetConfigComponent } from '@home/components/widget/config/widget-config.component.models'; +import { WidgetConfigComponentData } from '@home/models/widget-component.models'; +import { + DataKey, + Datasource, + datasourcesHasAggregation, + datasourcesHasOnlyComparisonAggregation, + DatasourceType, + WidgetConfig, +} from '@shared/models/widget.models'; +import { WidgetConfigComponent } from '@home/components/widget/widget-config.component'; +import { DataKeyType } from '@shared/models/telemetry/telemetry.models'; +import { + getTimewindowConfig, + setTimewindowConfig +} from '@home/components/widget/config/timewindow-config-panel.component'; +import { formatValue, isDefined, isUndefined } from '@core/utils'; +import { + cssSizeToStrSize, + DateFormatProcessor, + DateFormatSettings, + resolveCssSize +} from '@shared/models/widget-settings.models'; +import { + CapacityUnits, + createShapeLayout, + levelCardDefaultSettings, + LevelCardLayout, + levelCardLayoutTranslations, + LevelCardWidgetSettings, + LiquidWidgetDataSourceType, + LiquidWidgetDataSourceTypeTranslations, + loadSvgShapesMapping, + optionsFilter, + Shapes, + ShapesTranslations, + updatedFormSettingsValidators +} from '@home/components/widget/lib/indicator/liquid-level-widget.models'; +import { UnitsType } from '@shared/models/unit.models'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { ImageCardsSelectComponent } from '@home/components/widget/lib/settings/common/image-cards-select.component'; +import { map, share, tap } from 'rxjs/operators'; +import { Observable, of, ReplaySubject } from 'rxjs'; +import { ResourcesService } from '@core/services/resources.service'; +import { UtilsService } from '@core/services/utils.service'; + +@Component({ + selector: 'liquid-level-card-basic-config', + templateUrl: './liquid-level-card-basic-config.component.html', + styleUrls: ['../basic-config.scss'] +}) +export class LiquidLevelCardBasicConfigComponent extends BasicWidgetConfigComponent { + + @ViewChild('layoutsImageCardsSelect', { static: false }) layoutsImageCardsSelect: ImageCardsSelectComponent; + + @ViewChild('shapesImageCardsSelect', { static: false }) shapesImageCardsSelect: ImageCardsSelectComponent; + + private get datasource(): Datasource { + if (this.widgetConfig.config.datasources && this.widgetConfig.config.datasources) { + return this.widgetConfig.config.datasources[0]; + } else { + return null; + } + } + + public get volumeInput(): boolean { + const datasourceUnits = this.levelCardWidgetConfigForm.get('datasourceUnits').value; + const layout: LevelCardLayout = this.levelCardWidgetConfigForm.get('layout').value; + + if (layout === LevelCardLayout.absolute) { + return true; + } + return datasourceUnits !== CapacityUnits.percent; + } + + public get displayTimewindowConfig(): boolean { + const datasources = this.levelCardWidgetConfigForm.get('datasources').value; + return datasourcesHasAggregation(datasources); + } + + public onlyHistoryTimewindow(): boolean { + const datasources = this.levelCardWidgetConfigForm.get('datasources').value; + return datasourcesHasOnlyComparisonAggregation(datasources); + } + + LevelCardLayout = LevelCardLayout; + LevelCardLayouts = Object.values(LevelCardLayout) as LevelCardLayout[]; + LevelCardLayoutTranslationMap = levelCardLayoutTranslations; + + DataSourceType = LiquidWidgetDataSourceType; + DataSourceTypes = Object.values(LiquidWidgetDataSourceType) as LiquidWidgetDataSourceType[]; + DataSourceTypeTranslations = LiquidWidgetDataSourceTypeTranslations; + + shapes = Object.values(Shapes) as Shapes[]; + shapesImageMap: Map = new Map(); + ShapesTranslationMap = ShapesTranslations; + + unitsType = UnitsType; + + levelCardWidgetConfigForm: FormGroup; + + valuePreviewFn = this._valuePreviewFn.bind(this); + + tooltipValuePreviewFn = this._tooltipValuePreviewFn.bind(this); + + totalVolumeValuePreviewFn = this._totalVolumeValuePreviewFn.bind(this); + + datePreviewFn = this._datePreviewFn.bind(this); + + private keySearchText: string; + private latestKeySearchTextResult: Array; + + private functionTypeKeys: Array = []; + + private lastKeysId: string; + private lastFetchedKeys: Array; + + constructor(protected store: Store, + protected widgetConfigComponent: WidgetConfigComponent, + private cd: ChangeDetectorRef, + private $injector: Injector, + private fb: FormBuilder, + private resourcesService: ResourcesService, + private sanitizer: DomSanitizer, + private utils: UtilsService) { + super(store, widgetConfigComponent); + } + + protected configForm(): FormGroup { + return this.levelCardWidgetConfigForm; + } + + protected setupConfig(widgetConfig: WidgetConfigComponentData) { + this.createSvgShapesMapping(); + + for (const type of this.utils.getPredefinedFunctionsList()) { + this.functionTypeKeys.push({ + name: type, + type: DataKeyType.function + }); + } + super.setupConfig(widgetConfig); + } + + protected setupDefaults(configData: WidgetConfigComponentData) { + this.setupDefaultDatasource(configData, [{ name: 'fuelLevel', label: 'Fuel Level', type: DataKeyType.timeseries }]); + } + + protected onConfigSet(configData: WidgetConfigComponentData) { + const settings: LevelCardWidgetSettings = {...levelCardDefaultSettings, ...(configData.config.settings || {})}; + const iconSize = resolveCssSize(configData.config.iconSize); + + this.levelCardWidgetConfigForm = this.fb.group({ + timewindowConfig: [getTimewindowConfig(configData.config), []], + datasources: [configData.config.datasources, []], + + layout: [settings.layout, []], + tankSelectionType: [settings.tankSelectionType, []], + selectedShape: [settings.selectedShape, [Validators.required]], + shapeAttributeName: [settings.shapeAttributeName, [Validators.required]], + tankColor: [settings.tankColor, []], + datasourceUnits: [settings.datasourceUnits, [Validators.required]], + + showTitle: [configData.config.showTitle, []], + title: [configData.config.title, []], + titleFont: [configData.config.titleFont, []], + titleColor: [configData.config.titleColor, []], + showTitleIcon: [configData.config.showTitleIcon, []], + iconSize: [iconSize[0], [Validators.min(0)]], + iconSizeUnit: [iconSize[1], []], + titleIcon: [configData.config.titleIcon, []], + iconColor: [configData.config.iconColor, []], + + volumeSource: [settings.volumeSource, []], + volumeConstant: [settings.volumeConstant, [Validators.required, Validators.min(0.1)]], + volumeAttributeName: [settings.volumeAttributeName, [Validators.required]], + volumeUnits: [settings.volumeUnits, [Validators.required]], + volumeFont: [settings.volumeFont, []], + volumeColor: [settings.volumeColor, []], + units: [settings.units, [Validators.required]], + widgetUnitsSource: [settings.widgetUnitsSource, [Validators.required]], + widgetUnitsAttributeName: [settings.widgetUnitsAttributeName, [Validators.required]], + decimals: [configData.config.decimals, []], + liquidColor: [settings.liquidColor, []], + valueFont: [settings.valueFont, []], + valueColor: [settings.valueColor, []], + + showTooltip: [settings.showTooltip, []], + showTooltipLevel: [settings.showTooltipLevel, []], + tooltipUnits: [settings.tooltipUnits, []], + tooltipLevelDecimals: [settings.tooltipLevelDecimals, []], + tooltipLevelFont: [settings.tooltipLevelFont, []], + tooltipLevelColor: [settings.tooltipLevelColor, []], + showTooltipDate: [settings.showTooltipDate, []], + tooltipDateFormat: [settings.tooltipDateFormat, []], + tooltipDateFont: [settings.tooltipDateFont, []], + tooltipDateColor: [settings.tooltipDateColor, []], + tooltipBackgroundColor: [settings.tooltipBackgroundColor, []], + tooltipBackgroundBlur: [settings.tooltipBackgroundBlur, []], + + background: [settings.background], + cardButtons: [this.getCardButtons(configData.config), []], + borderRadius: [configData.config.borderRadius, []], + + actions: [configData.config.actions || {}, []] + }); + + this.levelCardWidgetConfigForm.get('selectedShape').valueChanges.subscribe(() => { + this.cd.detectChanges(); + this.layoutsImageCardsSelect?.imageCardsSelectOptions.notifyOnChanges(); + }); + } + + protected prepareOutputConfig(config: any): WidgetConfigComponentData { + setTimewindowConfig(this.widgetConfig.config, config.timewindowConfig); + this.widgetConfig.config.datasources = config.datasources; + + this.widgetConfig.config.showTitle = config.showTitle; + this.widgetConfig.config.title = config.title; + this.widgetConfig.config.titleFont = config.titleFont; + this.widgetConfig.config.titleColor = config.titleColor; + + this.widgetConfig.config.showTitleIcon = config.showTitleIcon; + this.widgetConfig.config.iconSize = cssSizeToStrSize(config.iconSize, config.iconSizeUnit); + this.widgetConfig.config.titleIcon = config.titleIcon; + this.widgetConfig.config.iconColor = config.iconColor; + + this.widgetConfig.config.decimals = config.decimals; + + this.widgetConfig.config.settings = this.widgetConfig.config.settings || {}; + + this.widgetConfig.config.settings.layout = config.layout; + + this.widgetConfig.config.settings.tankSelectionType = config.tankSelectionType; + this.widgetConfig.config.settings.selectedShape = config.selectedShape; + this.widgetConfig.config.settings.shapeAttributeName = config.shapeAttributeName; + this.widgetConfig.config.settings.tankColor = config.tankColor; + this.widgetConfig.config.settings.datasourceUnits = config.datasourceUnits; + + this.widgetConfig.config.settings.volumeSource = config.volumeSource; + this.widgetConfig.config.settings.volumeConstant = config.volumeConstant; + this.widgetConfig.config.settings.volumeAttributeName = config.volumeAttributeName; + this.widgetConfig.config.settings.volumeUnits = config.volumeUnits; + this.widgetConfig.config.settings.volumeFont = config.volumeFont; + this.widgetConfig.config.settings.volumeColor = config.volumeColor; + this.widgetConfig.config.settings.units = config.units; + this.widgetConfig.config.settings.widgetUnitsSource = config.widgetUnitsSource; + this.widgetConfig.config.settings.widgetUnitsAttributeName = config.widgetUnitsAttributeName; + this.widgetConfig.config.settings.liquidColor = config.liquidColor; + this.widgetConfig.config.settings.valueFont = config.valueFont; + this.widgetConfig.config.settings.valueColor = config.valueColor; + + this.widgetConfig.config.settings.showTooltip = config.showTooltip; + this.widgetConfig.config.settings.showTooltipLevel = config.showTooltipLevel; + this.widgetConfig.config.settings.tooltipUnits = config.tooltipUnits; + this.widgetConfig.config.settings.tooltipLevelDecimals = config.tooltipLevelDecimals; + this.widgetConfig.config.settings.tooltipLevelFont = config.tooltipLevelFont; + this.widgetConfig.config.settings.tooltipLevelColor = config.tooltipLevelColor; + this.widgetConfig.config.settings.showTooltipDate = config.showTooltipDate; + this.widgetConfig.config.settings.tooltipDateFormat = config.tooltipDateFormat; + this.widgetConfig.config.settings.tooltipDateFont = config.tooltipDateFont; + this.widgetConfig.config.settings.tooltipDateColor = config.tooltipDateColor; + this.widgetConfig.config.settings.tooltipBackgroundColor = config.tooltipBackgroundColor; + this.widgetConfig.config.settings.tooltipBackgroundBlur = config.tooltipBackgroundBlur; + + this.widgetConfig.config.settings.background = config.background; + this.setCardButtons(config.cardButtons, this.widgetConfig.config); + this.widgetConfig.config.borderRadius = config.borderRadius; + + this.widgetConfig.config.actions = config.actions; + return this.widgetConfig; + } + + protected validatorTriggers(): string[] { + return [ + 'showTooltip', 'showTooltipLevel', 'tankSelectionType', 'datasourceUnits', 'showTitleIcon', 'volumeSource', + 'showTooltipDate', 'layout', 'showTitle', 'widgetUnitsSource' + ]; + } + + protected updateValidators(emitEvent: boolean, trigger?: string) { + updatedFormSettingsValidators(this.levelCardWidgetConfigForm); + + const showTitleIcon: boolean = this.levelCardWidgetConfigForm.get('showTitleIcon').value; + const showTitle: boolean = this.levelCardWidgetConfigForm.get('showTitle').value; + if (showTitle) { + this.levelCardWidgetConfigForm.get('title').enable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('titleFont').enable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('titleColor').enable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('showTitleIcon').enable({emitEvent: false}); + if (showTitleIcon) { + this.levelCardWidgetConfigForm.get('titleIcon').enable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconColor').enable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconSize').enable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconSizeUnit').enable({emitEvent: false}); + } else { + this.levelCardWidgetConfigForm.get('titleIcon').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconColor').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconSize').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconSizeUnit').disable({emitEvent: false}); + } + } else { + this.levelCardWidgetConfigForm.get('title').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('titleFont').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('titleColor').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('showTitleIcon').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('titleIcon').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconColor').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconSize').disable({emitEvent: false}); + this.levelCardWidgetConfigForm.get('iconSizeUnit').disable({emitEvent: false}); + } + } + + private getCardButtons(config: WidgetConfig): string[] { + const buttons: string[] = []; + if (isUndefined(config.enableDataExport) || config.enableDataExport) { + buttons.push('dataExport'); + } + if (isUndefined(config.enableFullscreen) || config.enableFullscreen) { + buttons.push('fullscreen'); + } + return buttons; + } + + private setCardButtons(buttons: string[], config: WidgetConfig) { + config.enableDataExport = buttons.includes('dataExport'); + config.enableFullscreen = buttons.includes('fullscreen'); + } + + private _valuePreviewFn(): string { + const units: string = this.levelCardWidgetConfigForm.get('units').value; + const decimals: number = this.levelCardWidgetConfigForm.get('decimals').value; + return formatValue(22, decimals, units, true); + } + + private _tooltipValuePreviewFn() { + const units: string = this.levelCardWidgetConfigForm.get('tooltipUnits').value; + const decimals: number = this.levelCardWidgetConfigForm.get('tooltipLevelDecimals').value; + return formatValue(32, decimals, units, true); + } + + private _totalVolumeValuePreviewFn() { + const value = this.levelCardWidgetConfigForm.get('volumeConstant').value; + const datasourceUnits = this.levelCardWidgetConfigForm.get('datasourceUnits').value; + const decimals: number = this.widgetConfig.config.decimals; + let units: string = this.widgetConfig.config.units; + + if (datasourceUnits !== CapacityUnits.percent) { + units = datasourceUnits; + } + + return formatValue((isDefined(value) ? value : 500), decimals, units, true); + } + + private _datePreviewFn(): string { + const dateFormat: DateFormatSettings = this.levelCardWidgetConfigForm.get('tooltipDateFormat').value; + const processor = DateFormatProcessor.fromSettings(this.$injector, dateFormat); + processor.update(Date.now()); + return processor.formatted; + } + + private createSvgShapesMapping(): void { + loadSvgShapesMapping(this.resourcesService).subscribe(shapeMap => { + this.shapesImageMap = shapeMap; + + this.cd.detectChanges(); + this.layoutsImageCardsSelect?.imageCardsSelectOptions.notifyOnChanges(); + this.shapesImageCardsSelect?.imageCardsSelectOptions.notifyOnChanges(); + }); + } + + createShape(svg: string, layout: LevelCardLayout): SafeUrl { + return createShapeLayout(svg, layout, this.sanitizer); + } + + public fetchOptions(searchText: string): Observable> { + if (this.keySearchText !== searchText || !this.lastFetchedKeys) { + this.keySearchText = searchText; + const dataKeyFilter = optionsFilter(this.keySearchText); + return this.getKeys().pipe( + tap(res => this.lastFetchedKeys !== res ? this.lastFetchedKeys = res : []), + map(name => name?.filter(dataKeyFilter).map(key => key.name)), + tap(res => this.latestKeySearchTextResult = res) + ); + } + return of(this.latestKeySearchTextResult); + } + + private getKeys(): Observable> { + let fetchObservable: Observable>; + const callbacks = this.widgetConfigComponent.widgetConfigCallbacks; + if (this.datasource?.type === DatasourceType.function) { + fetchObservable = of(this.functionTypeKeys); + } else if (this.datasource?.type === DatasourceType.entity && this.datasource?.entityAliasId || + this.datasource?.type === DatasourceType.device && this.datasource?.deviceId) { + if (this.datasource?.type === DatasourceType.device) { + if (this.lastKeysId !== this.datasource?.deviceId || !this.lastFetchedKeys) { + this.lastKeysId = this.datasource.deviceId; + fetchObservable = callbacks.fetchEntityKeysForDevice(this.datasource?.deviceId, [DataKeyType.attribute]); + } else { + fetchObservable = of(this.lastFetchedKeys); + } + } else { + if (this.lastKeysId !== this.datasource?.entityAliasId || !this.lastFetchedKeys) { + this.lastKeysId = this.datasource.entityAliasId; + fetchObservable = callbacks.fetchEntityKeys(this.datasource?.entityAliasId, [DataKeyType.attribute]); + } else { + fetchObservable = of(this.lastFetchedKeys); + } + } + } else { + this.lastKeysId = null; + fetchObservable = of([]); + } + return fetchObservable.pipe( + share({ + connector: () => new ReplaySubject(1), + resetOnError: false, + resetOnComplete: false, + resetOnRefCountZero: false + }) + ); + } +} diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.html new file mode 100644 index 0000000000..4c14686b9c --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.html @@ -0,0 +1,29 @@ + +
+
+ +
+
+
+
+ {{ error }} +
+
+
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.scss new file mode 100644 index 0000000000..046d1a7d3e --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.scss @@ -0,0 +1,72 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.tb-liquid-level-panel { + width: 100%; + height: 100%; + position: relative; + display: flex; + flex-direction: column; + gap: 16px; + padding: 20px 24px 24px 24px; + &.tb-liquid-level-pointer { + cursor: pointer; + } + > div:not(.tb-liquid-level-overlay) { + z-index: 1; + } + .tb-liquid-level-overlay { + position: absolute; + top: 12px; + left: 12px; + bottom: 12px; + right: 12px; + } + div.tb-widget-title { + padding: 0; + } + .tb-liquid-level-content { + min-height: 0; + flex: 1; + display: flex; + justify-content: center; + } + .tb-liquid-level-error { + position: absolute; + display: flex; + inset: 0; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; + + &-container { + border-radius: 4px; + margin: 16px; + padding: 8px 12px; + background: #848484; + display: flex; + flex-direction: column; + gap: 8px; + + & > * { + font-weight: 500; + letter-spacing: .25px; + text-align: center; + color: #fff; + } + } + } +} diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.ts new file mode 100644 index 0000000000..9bb7053c3e --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.ts @@ -0,0 +1,575 @@ +/// +/// Copyright © 2016-2023 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { + ChangeDetectorRef, + Component, + ElementRef, + Input, + OnInit, + TemplateRef, + ViewChild, + ViewEncapsulation +} from '@angular/core'; +import { WidgetContext } from '@home/models/widget-component.models'; +import { isDefined, isDefinedAndNotNull, isEmptyStr, isNotEmptyStr, isNumeric, isUndefinedOrNull } from '@core/utils'; +import { + CapacityUnits, + ConversionType, + convertLiters, + createAbsoluteLayout, + createPercentLayout, + extractValue, + levelCardDefaultSettings, + LevelCardLayout, + LevelCardWidgetSettings, + LiquidWidgetDataSourceType, + Shapes, + SvgInfo, + SvgLimits, + svgMapping +} from '@home/components/widget/lib/indicator/liquid-level-widget.models'; +import { forkJoin, Observable, of } from 'rxjs'; +import { map, switchMap } from 'rxjs/operators'; +import { EntityId } from '@shared/models/id/entity-id'; +import { + backgroundStyle, + ColorProcessor, + ComponentStyle, + cssTextFromInlineStyle, + DateFormatProcessor, + inlineTextStyle, + overlayStyle +} from '@shared/models/widget-settings.models'; +import { ResourcesService } from '@core/services/resources.service'; +import { NULL_UUID } from '@shared/models/id/has-uuid'; +import { TranslateService } from '@ngx-translate/core'; +import ITooltipsterInstance = JQueryTooltipster.ITooltipsterInstance; + +@Component({ + selector: 'tb-liquid-level-widget', + templateUrl: './liquid-level-widget.component.html', + styleUrls: ['./liquid-level-widget.component.scss'], + encapsulation: ViewEncapsulation.None +}) +export class LiquidLevelWidgetComponent implements OnInit { + + @ViewChild('liquidLevelContent', {static: true}) + liquidLevelContent: ElementRef; + + @Input() + ctx: WidgetContext; + + @Input() + widgetTitlePanel: TemplateRef; + + backgroundStyle: ComponentStyle = {}; + overlayStyle: ComponentStyle = {}; + + hasCardClickAction = false; + + errorsMsg: string[] = []; + + private svgParams: SvgInfo; + + private svg: JQuery; + private tooltip: ITooltipsterInstance; + private overlayContainer: JQuery; + private shape: Shapes; + + private settings: LevelCardWidgetSettings; + + private tankColor: ColorProcessor; + private valueColor: ColorProcessor; + private liquidColor: ColorProcessor; + private backgroundOverlayColor: ColorProcessor; + private tooltipLevelColor: ColorProcessor; + + private tooltipDateFormat: DateFormatProcessor; + + private volume: number; + private tooltipContent: string; + private widgetUnits: string; + + private capacityUnits = Object.values(CapacityUnits); + + constructor(private cd: ChangeDetectorRef, + private resourcesService: ResourcesService, + private translate: TranslateService) { + } + + ngOnInit(): void { + this.ctx.$scope.liquidLevelWidget = this; + this.settings = {...levelCardDefaultSettings, ...this.ctx.settings}; + this.declareStyles(); + + this.backgroundStyle = backgroundStyle(this.settings.background); + this.overlayStyle = overlayStyle(this.settings.background.overlay); + + this.hasCardClickAction = this.ctx.actionsApi.getActionDescriptors('cardClick').length > 0; + + this.getData().subscribe(data => { + if (data) { + const { svg, volume, units } = data; + if (svg && isNotEmptyStr(svg) && this.liquidLevelContent.nativeElement) { + const jQueryContainerElement = $(this.liquidLevelContent.nativeElement); + jQueryContainerElement.html(svg); + this.svg = jQueryContainerElement.find('svg'); + this.createSVG(); + this.createValueElement(); + + if (this.settings.showTooltip && (this.settings.showTooltipLevel || this.settings.showTooltipDate)) { + this.createTooltip(); + } + } + + if (isDefined(volume) && !isNaN(Number(volume))) { + this.volume = Number(volume); + } + + if (units) { + this.widgetUnits = units; + } + + this.update(true); + } + }); + } + + private declareStyles(): void { + this.tankColor = ColorProcessor.fromSettings(this.settings.tankColor); + this.valueColor = ColorProcessor.fromSettings(this.settings.valueColor); + this.liquidColor = ColorProcessor.fromSettings(this.settings.liquidColor); + this.backgroundOverlayColor = ColorProcessor.fromSettings(this.settings.backgroundOverlayColor); + this.tooltipLevelColor = ColorProcessor.fromSettings(this.settings.tooltipLevelColor); + + this.tooltipDateFormat = DateFormatProcessor.fromSettings(this.ctx.$injector, this.settings.tooltipDateFormat); + } + + private getData(): Observable<{ svg: string; volume: number; units: string }> { + const entityId: EntityId = { + entityType: this.ctx.datasources[0].entityType, + id: this.ctx.datasources[0].entityId + }; + + return this.getShape(entityId).pipe( + switchMap(shape => { + this.shape = shape; + this.svgParams = svgMapping.get(shape); + if (this.svgParams) { + return forkJoin([ + this.resourcesService.loadJsonResource(this.svgParams.svg), + this.getTankersParams(entityId) + ]).pipe( + map(params => ({svg: params[0], ...params[1]})) + ); + } + return of(null); + }) + ); + } + + public onInit() { + const borderRadius = this.ctx.$widgetElement.css('borderRadius'); + this.overlayStyle = {...this.overlayStyle, ...{borderRadius}}; + this.cd.detectChanges(); + } + + public update(ignoreAnimation?: boolean) { + if (this.svg) { + this.updateData(ignoreAnimation); + } + } + + public destroy() { + + } + + private createSVG() { + if (this.svg) { + this.svg.css('display', 'block') + .css('overflow', 'hidden') + .css('width', '100%') + .css('height', '100%'); + } + } + + private updateData(ignoreAnimation?: boolean) { + const data = this.ctx.data[0]?.data[0]; + if (data && isDefinedAndNotNull(data[1])) { + const percentage = isNumeric(data[1]) ? this.convertInputData(data[1]) : 0; + this.updateSvg(percentage, ignoreAnimation); + this.updateValueElement(data[1], percentage); + + if (this.settings.showTooltip && (this.settings.showTooltipLevel || this.settings.showTooltipDate)) { + this.updateTooltip(data); + } + } + } + + private createTooltip(): void { + this.tooltipContent = this.getTooltipContent(); + + import('tooltipster').then(() => { + if ($.tooltipster && this.tooltip) { + this.tooltip.destroy(); + this.tooltip = null; + } + this.tooltip = this.svg.tooltipster({ + contentAsHTML: true, + theme: 'tooltipster-shadow', + side: 'top', + delay: 10, + distance: this.settings.showTitle ? -33 : -63, + triggerClose: { + click: true, + tap: true, + scroll: true, + mouseleave: true + }, + animation: 'grow', + updateAnimation: null, + trackOrigin: true, + functionBefore: (instance, helper) => { + instance.content(this.tooltipContent); + }, + functionReady: (instance, helper) => { + const tooltipsterBoxStyles: JQuery.PlainObject = { + backgroundColor: this.settings.tooltipBackgroundColor, + backdropFilter: `blur(${this.settings.tooltipBackgroundBlur}px)`, + width: '100%', + height: '100%' + }; + + $(helper.tooltip).css('max-width', this.svg.width() + 'px'); + $(helper.tooltip).css('max-height', this.svg.height() + 'px'); + $(helper.tooltip).find('.tooltipster-box').css(tooltipsterBoxStyles); + $(helper.tooltip).find('.tooltipster-arrow').empty(); + + instance.reposition(); + } + }).tooltipster('instance'); + }); + } + + private createValueElement(): void { + const jQueryContainerElement = $(this.liquidLevelContent.nativeElement); + const containerOverlay = jQueryContainerElement.find('.container-overlay'); + const percentageOverlay = jQueryContainerElement.find('.percentage-overlay'); + const absoluteOverlay = jQueryContainerElement.find('.absolute-overlay'); + + if (this.settings.layout === LevelCardLayout.absolute && !this.errorsMsg.length) { + this.overlayContainer = absoluteOverlay; + percentageOverlay.css('visibility', 'hidden'); + if (!this.settings.showBackgroundOverlay) { + absoluteOverlay.css('visibility', 'hidden'); + } + } else if (this.settings.layout === LevelCardLayout.percentage && !this.errorsMsg.length) { + this.overlayContainer = percentageOverlay; + absoluteOverlay.css('visibility', 'hidden'); + if (!this.settings.showBackgroundOverlay) { + percentageOverlay.css('visibility', 'hidden'); + } + } else { + containerOverlay.css('visibility', 'hidden'); + } + + if (this.overlayContainer) { + this.overlayContainer.attr('fill', this.backgroundOverlayColor.color); + this.overlayContainer.removeAttr('fill-opacity'); + } + } + + private getShape(entityId: EntityId): Observable { + if (this.settings.tankSelectionType === LiquidWidgetDataSourceType.attribute && entityId.id !== NULL_UUID) { + return this.ctx.attributeService.getEntityAttributes(entityId, null, [this.settings.shapeAttributeName]) + .pipe(map(attributes => { + const shape = extractValue(attributes, this.settings.shapeAttributeName); + if (!shape || !svgMapping.has(shape)) { + this.createdErrorMgs(this.settings.shapeAttributeName, isUndefinedOrNull(shape) || isEmptyStr(shape)); + return this.settings.selectedShape; + } + return shape; + } + )); + } + return of(this.settings.selectedShape); + } + + private getTankersParams(entityId: EntityId): Observable<{ volume: number; units: string }> { + const isVolumeStatic = this.settings.layout !== LevelCardLayout.absolute + && this.settings.datasourceUnits === CapacityUnits.percent + || this.settings.volumeSource === LiquidWidgetDataSourceType.static; + const isUnitStatic = this.settings.layout !== LevelCardLayout.absolute || + this.settings.widgetUnitsSource === LiquidWidgetDataSourceType.static; + + const attributeKeys: string[] = []; + + if (!isVolumeStatic) { + attributeKeys.push(this.settings.volumeAttributeName); + } + + if (!isUnitStatic) { + attributeKeys.push(this.settings.widgetUnitsAttributeName); + } + + if (!attributeKeys.length || entityId.id === NULL_UUID) { + return of({ + volume: this.settings.volumeConstant, + units: this.settings.units + }); + } + + return this.ctx.attributeService.getEntityAttributes(entityId, null, attributeKeys).pipe( + map(attributes => { + let volume = isVolumeStatic ? this.settings.volumeConstant : extractValue(attributes, this.settings.volumeAttributeName); + let units = isUnitStatic ? this.settings.units : extractValue(attributes, this.settings.widgetUnitsAttributeName); + + if (!isVolumeStatic && (!volume || !isNumeric(volume) || volume < 0.1)) { + this.createdErrorMgs(this.settings.volumeAttributeName, isUndefinedOrNull(volume) || isEmptyStr(volume)); + volume = this.settings.volumeConstant; + } + + if (!isUnitStatic) { + if (isNotEmptyStr(units)) { + const normalizeUnits = units.normalize().trim(); + units = this.capacityUnits.find(unit => unit.normalize() === normalizeUnits); + } + if (isUndefinedOrNull(units) || !isNotEmptyStr(units)) { + this.createdErrorMgs(this.settings.widgetUnitsAttributeName, isUndefinedOrNull(units) || isEmptyStr(units)); + units = this.settings.units; + } + } + + return { + volume, + units + }; + }) + ); + } + + private createdErrorMgs(attributeName: string, isEmpty = false) { + if (isEmpty) { + this.errorsMsg.push(this.translate.instant('widgets.liquid-level-card.attribute-key-not-set', {attributeName})); + } else { + this.errorsMsg.push(this.translate.instant('widgets.liquid-level-card.attribute-key-invalid', {attributeName})); + } + this.cd.markForCheck(); + } + + private updateSvg(percentage: number, ignoreAnimation?: boolean) { + const yLimits: SvgLimits = { + min: this.svgParams.limits.min, + max: this.svgParams.limits.max + }; + + const newYPos = this.calculatePosition(percentage, yLimits); + this.updateShapeColor(percentage); + this.updateLevel(newYPos, percentage, ignoreAnimation); + } + + private calculatePosition(percentage: number, limits: SvgLimits): number { + if (percentage >= 100) { + return limits.max; + } if (percentage <= 0) { + return limits.min; + } + return limits.min + (percentage / 100) * (limits.max - limits.min); + } + + private updateTooltip(value: [number, any]): void { + this.tooltipContent = this.getTooltipContent(value); + + if (this.tooltip) { + this.tooltip.content(this.tooltipContent); + } + } + + private updateLevel(newY: number, percentage: number, ignoreAnimation = false): void { + this.liquidColor.update(percentage); + const jQueryContainerElement = $(this.liquidLevelContent.nativeElement); + const fill = jQueryContainerElement.find('.tb-liquid-fill'); + const surfaces = jQueryContainerElement.find('.tb-liquid-surface'); + const surfacePositionAttr = this.shape !== Shapes.vCylinder ? 'y' : 'cy'; + const animationSpeed = 500; + + const levelColor = this.errorsMsg.length ? 'transparent' : this.liquidColor.color; + + if (ignoreAnimation) { + fill.css({y : newY}); + } else { + fill.animate({y : newY}, animationSpeed); + } + fill.attr('fill', levelColor); + + surfaces.each((index, element) => { + const $element = $(element); + if (ignoreAnimation) { + $element.css({[surfacePositionAttr]: newY}); + } else { + $element.animate({[surfacePositionAttr]: newY}, animationSpeed); + } + if ($element.hasClass('tb-liquid')) { + $element.attr('fill', levelColor); + } + }); + } + + private updateShapeColor(value: number): void { + const jQueryContainerElement = $(this.liquidLevelContent.nativeElement); + const shapeStrokes = jQueryContainerElement.find('.tb-shape-stroke'); + const shapeFill = jQueryContainerElement.find('.tb-shape-fill'); + this.tankColor.update(value); + + const shapeColor = this.errorsMsg.length ? '#CACACA' : this.tankColor.color; + + shapeStrokes.each((index, element) => { + $(element).attr('stroke', shapeColor); + }); + + shapeFill.each((index, element) => { + $(element).attr('fill', shapeColor); + }); + } + + private updateValueElement(data: any, percentage: number): void { + let content: string; + let container: JQuery; + const jQueryContainerElement = $(this.liquidLevelContent.nativeElement); + let value = 'N/A'; + + if (isNumeric(data)) { + value = convertLiters(this.convertOutputData(percentage), this.widgetUnits as CapacityUnits, ConversionType.from) + .toFixed(this.settings.decimals || 0); + } + this.valueColor.update(value); + const valueTextStyle = cssTextFromInlineStyle({...inlineTextStyle(this.settings.valueFont), + color: this.valueColor.color}); + this.backgroundOverlayColor.update(percentage); + if (this.overlayContainer) { + this.overlayContainer.attr('fill', this.backgroundOverlayColor.color); + } + + if (this.settings.layout === LevelCardLayout.absolute) { + const volumeInLiters: number = convertLiters(this.volume, this.settings.volumeUnits as CapacityUnits, ConversionType.to); + const volume = convertLiters(volumeInLiters, this.widgetUnits as CapacityUnits, ConversionType.from) + .toFixed(this.settings.decimals || 0); + + const volumeTextStyle = cssTextFromInlineStyle({...inlineTextStyle(this.settings.volumeFont), + color: this.settings.volumeColor}); + + container = jQueryContainerElement.find('.absolute-value-container'); + content = createAbsoluteLayout({inputValue: value, volume}, + {valueStyle: valueTextStyle, volumeStyle: volumeTextStyle}, this.widgetUnits); + + } else if (this.settings.layout === LevelCardLayout.percentage) { + container = jQueryContainerElement.find('.percentage-value-container'); + content = createPercentLayout(value, valueTextStyle); + } + + if (content && container) { + container.html(content); + } + } + + private getTooltipContent(value?: [number, any]): string { + const contentValue = value || [0, '']; + let tooltipValue: string | number = 'N/A'; + + if (isNumeric(contentValue[1])) { + tooltipValue = this.convertTooltipData(contentValue[1]); + } + + this.tooltipLevelColor.update(tooltipValue); + this.tooltipDateFormat.update(contentValue[0]); + + const levelTextStyle = cssTextFromInlineStyle({...inlineTextStyle(this.settings.tooltipLevelFont), + color: this.tooltipLevelColor.color}); + + const dateTextStyle = cssTextFromInlineStyle({...inlineTextStyle(this.settings.tooltipDateFont), + color: this.settings.tooltipDateColor, overflow: 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap'}); + + let content = `
`; + + if (this.settings.showTooltipLevel) { + const levelValue = typeof tooltipValue == 'number' + ? `${tooltipValue.toFixed(this.settings.tooltipLevelDecimals)} ${this.settings.tooltipUnits}` + : 'N/A'; + content += this.createTooltipContent( + this.ctx.translate.instant('widgets.liquid-level-card.level'), + levelValue, + levelTextStyle + ); + } + + if (this.settings.showTooltipDate) { + content += this.createTooltipContent( + this.ctx.translate.instant('widgets.liquid-level-card.last-update'), + this.tooltipDateFormat.formatted, + dateTextStyle + ); + } + + content += '
'; + + return content; + } + + private createTooltipContent(labelText: string, contentValue: string, textStyle: string): string { + return `
+ + +
`; + } + + private convertInputData(value: number): number { + if (this.settings.datasourceUnits !== CapacityUnits.percent) { + return (convertLiters(value, this.settings.datasourceUnits, ConversionType.to) / + convertLiters(this.volume, this.settings.volumeUnits, ConversionType.to)) * 100; + } + + return value; + } + + private convertOutputData(value: number): number { + if (this.widgetUnits !== CapacityUnits.percent) { + return convertLiters(this.volume * (value / 100), this.settings.volumeUnits, ConversionType.to); + } + + return value; + } + + private convertTooltipData(value: number): number { + const percentage = this.convertInputData(value); + if (this.settings.tooltipUnits !== CapacityUnits.percent) { + const liters = this.convertOutputData(percentage); + + return convertLiters(liters, this.settings.tooltipUnits, ConversionType.from); + } else { + return percentage; + } + } + + public cardClick($event: Event) { + this.ctx.actionsApi.cardClick($event); + } +} diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.models.ts new file mode 100644 index 0000000000..cf526d6c97 --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.models.ts @@ -0,0 +1,623 @@ +/// +/// Copyright © 2016-2023 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { + BackgroundSettings, + BackgroundType, + ColorSettings, + constantColor, + cssTextFromInlineStyle, + DateFormatSettings, + Font, + lastUpdateAgoDateFormat +} from '@shared/models/widget-settings.models'; +import { DataKey, WidgetConfig } from '@shared/models/widget.models'; +import { AttributeData, DataKeyType } from '@shared/models/telemetry/telemetry.models'; +import { forkJoin, Observable, of } from 'rxjs'; +import { singleEntityFilterFromDeviceId } from '@shared/models/query/query.models'; +import { EntityType } from '@shared/models/entity-type.models'; +import { catchError, map, mergeMap } from 'rxjs/operators'; +import { EntityService } from '@core/http/entity.service'; +import { IAliasController } from '@core/api/widget-api.models'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { ResourcesService } from '@core/services/resources.service'; +import { FormGroup } from '@angular/forms'; + +export interface SvgInfo { + svg: string; + limits: SvgLimits; +} + +export interface SvgLimits { + min: number; + max: number; +} + +export interface LevelCardWidgetSettings extends WidgetConfig { + tankSelectionType: LiquidWidgetDataSourceType; + selectedShape: Shapes; + shapeAttributeName: string; + tankColor: ColorSettings; + datasourceUnits: CapacityUnits; + layout: LevelCardLayout; + volumeSource: LiquidWidgetDataSourceType; + volumeConstant: number; + volumeAttributeName: string; + volumeUnits: CapacityUnits; + volumeFont: Font; + volumeColor: string; + liquidColor: ColorSettings; + valueFont: Font; + widgetUnitsSource: LiquidWidgetDataSourceType; + widgetUnitsAttributeName: string; + valueColor: ColorSettings; + showBackgroundOverlay: boolean; + backgroundOverlayColor: ColorSettings; + showTooltip: boolean; + showTooltipLevel: boolean; + tooltipUnits: CapacityUnits; + tooltipLevelDecimals: number; + tooltipLevelFont: Font; + tooltipLevelColor: ColorSettings; + showTooltipDate: boolean; + tooltipDateFormat: DateFormatSettings; + tooltipDateFont: Font; + tooltipDateColor: string; + tooltipBackgroundColor: string; + tooltipBackgroundBlur: number; + background: BackgroundSettings; +} + +export enum Shapes { + vOval = 'Vertical Oval', + vCylinder = 'Vertical Cylinder', + vCapsule = 'Vertical Capsule', + rectangle = 'Rectangle', + hOval = 'Horizontal Oval', + hEllipse = 'Horizontal Ellipse', + hDishEnds = 'Horizontal Dish Ends', + hCylinder = 'Horizontal Cylinder', + hCapsule = 'Horizontal Capsule', + hElliptical_2_1 = 'Horizontal 2:1 Elliptical' +} + +export enum CapacityUnits { + percent = '%', + liters = 'L', + cubicMillimeter = 'mm³', + cubicCentimeter = 'cm³', + cubicMeter = 'm³', + cubicKilometer = 'km³', + milliliter = 'mL', + hectoliter = 'hl', + cubicInch = 'in³', + cubicFoot = 'ft³', + cubicYard = 'yd³', + fluidOunce = 'fl-oz', + pint = 'pt', + quart = 'qt', + gallon = 'gal', + oilBarrels = 'bbl' +} + +export enum LevelCardLayout { + simple = 'simple', + percentage = 'percentage', + absolute = 'absolute' +} + +export enum LiquidWidgetDataSourceType { + static = 'static', + attribute = 'attribute' +} + +export enum ConversionType { + to = 'to', + from = 'from', +} + +export const svgMapping = new Map( + [ + [ + Shapes.vOval, + { + svg: 'assets/widget/liquid-level/shapes/vertical-oval.svg', + limits: { min: 171, max: 51 } + } + ], + [ + Shapes.vCylinder, + { + svg: 'assets/widget/liquid-level/shapes/vertical-cylinder.svg', + limits: { min: 161, max: 55 } + } + ], + [ + Shapes.vCapsule, + { + svg: 'assets/widget/liquid-level/shapes/vertical-capsule.svg', + limits: { min: 197, max: 25 } + } + ], + [ + Shapes.rectangle, + { + svg: 'assets/widget/liquid-level/shapes/rectangle.svg', + limits: { min: 169, max: 52 } + } + ], + [ + Shapes.hOval, + { + svg: 'assets/widget/liquid-level/shapes/horizontal-oval.svg', + limits: { min: 160, max: 63 } + } + ], + [ + Shapes.hEllipse, + { + svg: 'assets/widget/liquid-level/shapes/horizontal-ellipse.svg', + limits: { min: 160, max: 64 } + } + ], + [ + Shapes.hDishEnds, + { + svg: 'assets/widget/liquid-level/shapes/horizontal-dish-ends.svg', + limits: { min: 173, max: 50 } + } + ], + [ + Shapes.hCylinder, + { + svg: 'assets/widget/liquid-level/shapes/horizontal-cylinder.svg', + limits: { min: 165, max: 56 } + } + ], + [ + Shapes.hCapsule, + { + svg: 'assets/widget/liquid-level/shapes/horizontal-capsule.svg', + limits: { min: 171, max: 52 } + } + ], + [ + Shapes.hElliptical_2_1, + { + svg: 'assets/widget/liquid-level/shapes/horizontal-2_1-elliptical.svg', + limits: { min: 173, max: 50 } + } + ] + ] +); + +export const levelCardLayoutTranslations = new Map( + [ + [LevelCardLayout.simple, 'widgets.liquid-level-card.layout-simple'], + [LevelCardLayout.percentage, 'widgets.liquid-level-card.layout-percentage'], + [LevelCardLayout.absolute, 'widgets.liquid-level-card.layout-absolute'] + ] +); + +export const LiquidWidgetDataSourceTypeTranslations = new Map( + [ + [LiquidWidgetDataSourceType.static, 'widgets.liquid-level-card.static'], + [LiquidWidgetDataSourceType.attribute, 'widgets.liquid-level-card.attribute'] + ] +); + +export const ShapesTranslations = new Map( + [ + [Shapes.vOval, 'widgets.liquid-level-card.v-oval'], + [Shapes.vCylinder, 'widgets.liquid-level-card.v-cylinder'], + [Shapes.vCapsule, 'widgets.liquid-level-card.v-capsule'], + [Shapes.rectangle, 'widgets.liquid-level-card.rectangle'], + [Shapes.hOval, 'widgets.liquid-level-card.h-oval'], + [Shapes.hEllipse, 'widgets.liquid-level-card.h-ellipse'], + [Shapes.hDishEnds, 'widgets.liquid-level-card.h-dish-ends'], + [Shapes.hCylinder, 'widgets.liquid-level-card.h-cylinder'], + [Shapes.hCapsule, 'widgets.liquid-level-card.h-capsule'], + [Shapes.hElliptical_2_1, 'widgets.liquid-level-card.h-elliptical_2_1'] + ] +); + +export const levelCardDefaultSettings: LevelCardWidgetSettings = { + tankSelectionType: LiquidWidgetDataSourceType.static, + selectedShape: Shapes.vCylinder, + shapeAttributeName: 'tankShape', + tankColor: constantColor('#242770'), + datasourceUnits: CapacityUnits.percent, + layout: LevelCardLayout.percentage, + showTitle: false, + title: 'Liquid level', + titleFont: { + family: 'Roboto', + size: 16, + sizeUnit: 'px', + style: 'normal', + weight: '500', + lineHeight: '1.5' + }, + titleColor: 'rgba(0, 0, 0, 0.87)', + showTitleIcon: false, + titleIcon: 'water_drop', + iconColor: '#5469FF', + volumeSource: LiquidWidgetDataSourceType.static, + volumeConstant: 500, + volumeUnits: CapacityUnits.liters, + volumeAttributeName: 'volume', + volumeFont: { + family: 'Roboto', + size: 14, + sizeUnit: 'px', + style: 'normal', + weight: '500', + lineHeight: '100%' + }, + volumeColor: 'rgba(0, 0, 0, 0.18)', + units: CapacityUnits.percent as string, + widgetUnitsSource: LiquidWidgetDataSourceType.static, + widgetUnitsAttributeName: 'units', + decimals: 0, + liquidColor: constantColor('#7A8BFF'), + valueFont: { + family: 'Roboto', + size: 24, + sizeUnit: 'px', + style: 'normal', + weight: '500', + lineHeight: '100%' + }, + valueColor: constantColor('rgba(0, 0, 0, 0.87)'), + showBackgroundOverlay: true, + backgroundOverlayColor: constantColor('rgba(255, 255, 255, 0.76)'), + showTooltip: true, + showTooltipLevel: true, + tooltipUnits: CapacityUnits.percent, + tooltipLevelDecimals: 0, + tooltipLevelFont: { + family: 'Roboto', + size: 13, + sizeUnit: 'px', + style: 'normal', + weight: '500', + lineHeight: '100%' + }, + tooltipLevelColor: constantColor('rgba(0, 0, 0, 0.76)'), + showTooltipDate: true, + tooltipDateFormat: lastUpdateAgoDateFormat(), + tooltipDateFont: { + family: 'Roboto', + size: 13, + sizeUnit: 'px', + style: 'normal', + weight: '500', + lineHeight: '100%' + }, + tooltipDateColor: 'rgba(0, 0, 0, 0.76)', + tooltipBackgroundColor: 'rgba(255, 255, 255, 0.76)', + tooltipBackgroundBlur: 3, + background: { + type: BackgroundType.color, + color: '#fff', + overlay: { + enabled: false, + color: 'rgba(255,255,255,0.72)', + blur: 3 + } + } +}; + +export const convertLiters = (value: number, units: CapacityUnits, conversionType: ConversionType): number => { + let factor: number; + + switch (units) { + case CapacityUnits.liters: + return value; + case CapacityUnits.cubicMillimeter: + factor = 1e6; + break; + case CapacityUnits.cubicCentimeter: + case CapacityUnits.milliliter: + factor = 1e3; + break; + case CapacityUnits.cubicMeter: + factor = 1e-3; + break; + case CapacityUnits.cubicKilometer: + factor = 1e-15; + break; + case CapacityUnits.hectoliter: + factor = 0.01; + break; + case CapacityUnits.cubicInch: + factor = 61.0237; + break; + case CapacityUnits.cubicFoot: + factor = 1 / 28.3168; + break; + case CapacityUnits.cubicYard: + factor = 1 / 764.555; + break; + case CapacityUnits.fluidOunce: + factor = 33.814; + break; + case CapacityUnits.pint: + factor = 1 / 0.473176; + break; + case CapacityUnits.quart: + factor = 1 / 0.946353; + break; + case CapacityUnits.gallon: + factor = 1 / 3.78541; + break; + case CapacityUnits.oilBarrels: + factor = 1 / 158.987; + break; + default: + return value; + // throw new Error(`Unknown unit: ${units}`); + } + + return conversionType === ConversionType.to ? value / factor : value * factor; +}; + +export const extractValue = (attributes: Array, attributeName: string): T | undefined => { + return attributes.find(attr => attr.key === attributeName)?.value; +}; + +export const valueContainerStyleDefaults = cssTextFromInlineStyle({ + width: '100%', + height: '100%', + display: 'flex', + gap: '8px', + 'text-align': 'center', + 'align-items': 'center', + 'align-content': 'center', + 'justify-content': 'center', + 'font-family': 'Roboto, Helvetica Neue, sans-serif' +}); + +export const valueTextStyleDefaults = 'letter-spacing: normal; font-style: normal; font-weight: 500; line-height: 100%;' + + ' font-size: 24px; font-family: Roboto, Helvetica Neue, sans-serif; color: #000000DE'; + +export const volumeTextStyleDefaults = 'letter-spacing: normal; font-style: normal; font-weight: 500;' + + ' line-height: 100%; font-size: 14px; font-family: Roboto, Helvetica Neue, sans-serif; color: rgba(0, 0, 0, 0.18)'; + +export const createAbsoluteLayout = (values?: {inputValue: number | string; volume: number | string}, + styles?: {valueStyle: string; volumeStyle: string}, + units?: string): string => { + const inputValue = values?.inputValue ? values?.inputValue : 500; + const valueTextStyle = styles?.valueStyle ? styles?.valueStyle : valueTextStyleDefaults; + const volume = values?.volume ? values?.volume : 1000; + const volumeTextStyle = styles?.volumeStyle ? styles?.volumeStyle : volumeTextStyleDefaults; + const displayUnits = units ? units : CapacityUnits.liters; + + return `
+
+ +
+ +
+ +
`; +}; + +export const createPercentLayout = (value: number | string = 50, valueTextStyle: string = valueTextStyleDefaults): string => + `
+ +
`; + +export const optionsFilter = (searchText: string): ((key: DataKey) => boolean) => + key => key?.name.toUpperCase().includes(searchText?.toUpperCase()); + +export const fetchEntityKeysForDevice = (deviceId: string, dataKeyTypes: Array, + entityService: EntityService): Observable> => { + const entityFilter = singleEntityFilterFromDeviceId(deviceId); + return entityService.getEntityKeysByEntityFilter( + entityFilter, + dataKeyTypes, [EntityType.DEVICE], + {ignoreLoading: true, ignoreErrors: true} + ).pipe( + catchError(() => of([])) + ); +}; + +export const fetchEntityKeys = (entityAliasId: string, dataKeyTypes: Array, + entityService: EntityService, aliasController: IAliasController): Observable> => + aliasController.getAliasInfo(entityAliasId).pipe( + mergeMap((aliasInfo) => entityService.getEntityKeysByEntityFilter( + aliasInfo.entityFilter, + dataKeyTypes, [], + {ignoreLoading: true, ignoreErrors: true} + )), + catchError(() => of([] as Array)) + ); + + +export const createShapeLayout = (svg: string, layout: LevelCardLayout, sanitizer: DomSanitizer): SafeUrl => { + if (svg && layout) { + const parser = new DOMParser(); + const svgImage = parser.parseFromString(svg, 'image/svg+xml'); + + if (layout === LevelCardLayout.simple) { + svgImage.querySelector('.container-overlay').remove(); + } else if (layout === LevelCardLayout.percentage) { + svgImage.querySelector('.absolute-overlay').remove(); + svgImage.querySelector('.percentage-value-container').innerHTML = createPercentLayout(); + } else { + svgImage.querySelector('.absolute-value-container').innerHTML = createAbsoluteLayout(); + svgImage.querySelector('.percentage-overlay').remove(); + } + + const encodedSvg = encodeURIComponent(svgImage.documentElement.outerHTML); + + return sanitizer.bypassSecurityTrustResourceUrl(`data:image/svg+xml,${encodedSvg}`); + } +}; + +export const loadSvgShapesMapping = (resourcesService: ResourcesService): Observable> => { + const obsArray: Array> = []; + const shapesImageMap: Map = new Map(); + svgMapping.forEach((value, shape) => { + const obs = resourcesService.loadJsonResource(value.svg).pipe( + map((svg) => ({svg, shape})) + ); + + obsArray.push(obs); + }); + + return forkJoin(obsArray).pipe( + map(svgData => { + for (const data of svgData) { + shapesImageMap.set(data.shape, data.svg); + } + return shapesImageMap; + }) + ); +}; + +export const updatedFormSettingsValidators = (formGroup: FormGroup) => { + const datasourceUnits: string = formGroup.get('datasourceUnits').value; + const layout: LevelCardLayout = formGroup.get('layout').value; + const volumeSource: LiquidWidgetDataSourceType = formGroup.get('volumeSource').value; + const widgetUnitsSource: LiquidWidgetDataSourceType = formGroup.get('widgetUnitsSource').value; + const showTooltipLevel: boolean = formGroup.get('showTooltipLevel').value; + const showTooltipDate: boolean = formGroup.get('showTooltipDate').value; + const showTooltip: boolean = formGroup.get('showTooltip').value; + const tankSelectionType: LiquidWidgetDataSourceType = formGroup.get('tankSelectionType').value; + + if (tankSelectionType === LiquidWidgetDataSourceType.static) { + formGroup.get('selectedShape').enable({emitEvent: false}); + formGroup.get('shapeAttributeName').disable({emitEvent: false}); + } else { + formGroup.get('selectedShape').disable({emitEvent: false}); + formGroup.get('shapeAttributeName').enable({emitEvent: false}); + } + + switch (layout) { + case LevelCardLayout.simple: + case LevelCardLayout.percentage: + formGroup.get('widgetUnitsSource').disable({emitEvent: false}); + formGroup.get('units').disable({emitEvent: false}); + formGroup.get('widgetUnitsAttributeName').disable({emitEvent: false}); + + if (datasourceUnits !== CapacityUnits.percent) { + formGroup.get('volumeSource').enable({emitEvent: false}); + formGroup.get('volumeUnits').enable({emitEvent: false}); + if (volumeSource === LiquidWidgetDataSourceType.static) { + formGroup.get('volumeConstant').enable({emitEvent: false}); + formGroup.get('volumeAttributeName').disable({emitEvent: false}); + } else { + formGroup.get('volumeConstant').disable({emitEvent: false}); + formGroup.get('volumeAttributeName').enable({emitEvent: false}); + } + } else { + formGroup.get('volumeSource').disable({emitEvent: false}); + formGroup.get('volumeConstant').disable({emitEvent: false}); + formGroup.get('volumeAttributeName').disable({emitEvent: false}); + formGroup.get('volumeUnits').disable({emitEvent: false}); + } + + if (layout === LevelCardLayout.simple) { + formGroup.get('decimals')?.disable({emitEvent: false}); + formGroup.get('valueFont').disable({emitEvent: false}); + formGroup.get('valueColor').disable({emitEvent: false}); + } else { + formGroup.get('decimals')?.enable({emitEvent: false}); + formGroup.get('valueFont').enable({emitEvent: false}); + formGroup.get('valueColor').enable({emitEvent: false}); + } + + formGroup.get('volumeFont').disable({emitEvent: false}); + formGroup.get('volumeColor').disable({emitEvent: false}); + + break; + case LevelCardLayout.absolute: + formGroup.get('widgetUnitsSource').enable({emitEvent: false}); + if (widgetUnitsSource === LiquidWidgetDataSourceType.static) { + formGroup.get('units').enable({emitEvent: false}); + formGroup.get('widgetUnitsAttributeName').disable({emitEvent: false}); + } else { + formGroup.get('units').disable({emitEvent: false}); + formGroup.get('widgetUnitsAttributeName').enable({emitEvent: false}); + } + + formGroup.get('volumeSource').enable({emitEvent: false}); + formGroup.get('volumeUnits').enable({emitEvent: false}); + if (volumeSource === LiquidWidgetDataSourceType.static) { + formGroup.get('volumeConstant').enable({emitEvent: false}); + formGroup.get('volumeAttributeName').disable({emitEvent: false}); + } else { + formGroup.get('volumeConstant').disable({emitEvent: false}); + formGroup.get('volumeAttributeName').enable({emitEvent: false}); + } + + if (formGroup.get('decimals')) { + formGroup.get('decimals').enable({emitEvent: false}); + } + formGroup.get('valueFont').enable({emitEvent: false}); + formGroup.get('valueColor').enable({emitEvent: false}); + + formGroup.get('volumeFont').enable({emitEvent: false}); + formGroup.get('volumeColor').enable({emitEvent: false}); + + break; + } + + if (showTooltip) { + formGroup.get('showTooltipLevel').enable({emitEvent: false}); + formGroup.get('showTooltipDate').enable({emitEvent: false}); + formGroup.get('tooltipBackgroundColor').enable({emitEvent: false}); + formGroup.get('tooltipBackgroundBlur').enable({emitEvent: false}); + + if (showTooltipLevel) { + formGroup.get('tooltipLevelDecimals').enable({emitEvent: false}); + formGroup.get('tooltipLevelFont').enable({emitEvent: false}); + formGroup.get('tooltipLevelColor').enable({emitEvent: false}); + formGroup.get('tooltipUnits').enable({emitEvent: false}); + } else { + formGroup.get('tooltipUnits').disable({emitEvent: false}); + formGroup.get('tooltipLevelDecimals').disable({emitEvent: false}); + formGroup.get('tooltipLevelFont').disable({emitEvent: false}); + formGroup.get('tooltipLevelColor').disable({emitEvent: false}); + } + + if (showTooltipDate) { + formGroup.get('tooltipDateFormat').enable({emitEvent: false}); + formGroup.get('tooltipDateFont').enable({emitEvent: false}); + formGroup.get('tooltipDateColor').enable({emitEvent: false}); + } else { + formGroup.get('tooltipDateFormat').disable({emitEvent: false}); + formGroup.get('tooltipDateFont').disable({emitEvent: false}); + formGroup.get('tooltipDateColor').disable({emitEvent: false}); + } + } else { + formGroup.get('showTooltipLevel').disable({emitEvent: false}); + formGroup.get('showTooltipDate').disable({emitEvent: false}); + formGroup.get('tooltipBackgroundColor').disable({emitEvent: false}); + formGroup.get('tooltipBackgroundBlur').disable({emitEvent: false}); + + formGroup.get('tooltipUnits').disable({emitEvent: false}); + formGroup.get('tooltipLevelDecimals').disable({emitEvent: false}); + formGroup.get('tooltipLevelFont').disable({emitEvent: false}); + formGroup.get('tooltipLevelColor').disable({emitEvent: false}); + + formGroup.get('tooltipDateFormat').disable({emitEvent: false}); + formGroup.get('tooltipDateFont').disable({emitEvent: false}); + formGroup.get('tooltipDateColor').disable({emitEvent: false}); + } +}; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.html index 52bd5907bd..35d7157fb4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.html @@ -33,7 +33,7 @@
{{ option.name }}
- +
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.scss index 37c06ed239..0cda7679e5 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.scss @@ -95,6 +95,11 @@ min-height: 0; display: flex; justify-content: center; + + .tb-image-cards-option-image { + max-width: 100%; + max-height: 100%; + } } &.selected { .tb-image-cards-option-background { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.ts index d75c4a5fc9..4f11a51223 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.ts @@ -32,11 +32,12 @@ import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs'; import { map, share, startWith, takeUntil } from 'rxjs/operators'; import { BreakpointObserver } from '@angular/cdk/layout'; import { MediaBreakpoints } from '@shared/models/constants'; +import { SafeUrl } from '@angular/platform-browser'; export interface ImageCardsSelectOption { name: string; value: any; - image: string; + image: string | SafeUrl; } @Directive( @@ -49,7 +50,7 @@ export class ImageCardsSelectOptionDirective { @Input() value: any; - @Input() image: string; + @Input() image: string | SafeUrl; get viewValue(): string { return (this._element?.nativeElement.textContent || '').trim(); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/liquid-level-card-widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/liquid-level-card-widget-settings.component.html new file mode 100644 index 0000000000..59119c1fb8 --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/liquid-level-card-widget-settings.component.html @@ -0,0 +1,260 @@ + + +
+
+
+
+
widgets.liquid-level-card.shape
+ + + {{ DataSourceTypeTranslations.get(type) | translate }} + + +
+ + + {{ ShapesTranslationMap.get(shape) | translate }} + + + +
+
widgets.liquid-level-card.shape-attribute-name
+ + +
+
+
widgets.liquid-level-card.shape-by-attribute
+
+
+
+
+
+
+
+
widgets.liquid-level-card.layout
+ + + {{ LevelCardLayoutTranslationMap.get(layout) | translate }} + + +
+
+
widgets.liquid-level-card.units
+
+
widgets.liquid-level-card.datasource-units
+ + +
+
+
widgets.liquid-level-card.widget-units
+
+ + + + {{ DataSourceTypeTranslations.get(type) | translate }} + + + + + + + + + +
+
+
+
widgets.liquid-level-card.total-volume
+
+ + + + {{ DataSourceTypeTranslations.get(type) | translate }} + + + + + + + warning + + + + + + + + +
+
+
+
+
widgets.liquid-level-card.color-and-font
+
+
widgets.liquid-level-card.tank-color
+ + +
+
+
widgets.liquid-level-card.liquid-color
+ + +
+
+
{{ 'widgets.background.background' | translate }}
+ + +
+
+
widgets.liquid-level-card.value
+
+ + + + +
+
+
+
widgets.liquid-level-card.total-volume
+
+ + + + +
+
+
+ + {{ 'widgets.liquid-level-card.background-overlay' | translate }} + + + +
+
+
+ + + + + {{ 'widget-config.tooltip' | translate }} + + + + +
+ + {{ 'widgets.liquid-level-card.level' | translate }} + +
+ + + + +
widget-config.decimals-suffix
+
+ + + + +
+
+
+ + {{ 'widgets.value-card.date' | translate }} + +
+ + + + + +
+
+
+
widgets.liquid-level-card.tooltip-background
+ + +
+
+
widgets.liquid-level-card.background-blur
+ + +
px
+
+
+
+
+
+
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/liquid-level-card-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/liquid-level-card-widget-settings.component.ts new file mode 100644 index 0000000000..14f906d453 --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/liquid-level-card-widget-settings.component.ts @@ -0,0 +1,306 @@ +/// +/// Copyright © 2016-2023 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { ChangeDetectorRef, Component, Injector, ViewChild } from '@angular/core'; +import { + DataKey, + Datasource, + DatasourceType, + WidgetSettings, + WidgetSettingsComponent +} from '@shared/models/widget.models'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Store } from '@ngrx/store'; +import { AppState } from '@core/core.state'; +import { formatValue, isDefined } from '@core/utils'; +import { WidgetConfigComponentData } from '@home/models/widget-component.models'; +import { DateFormatProcessor, DateFormatSettings } from '@shared/models/widget-settings.models'; +import { + CapacityUnits, + createShapeLayout, + fetchEntityKeys, + fetchEntityKeysForDevice, + levelCardDefaultSettings, + LevelCardLayout, + levelCardLayoutTranslations, + LiquidWidgetDataSourceType, + LiquidWidgetDataSourceTypeTranslations, + loadSvgShapesMapping, + optionsFilter, + Shapes, + ShapesTranslations, + updatedFormSettingsValidators +} from '@home/components/widget/lib/indicator/liquid-level-widget.models'; +import { UnitsType } from '@shared/models/unit.models'; +import { ImageCardsSelectComponent } from '@home/components/widget/lib/settings/common/image-cards-select.component'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { Observable, of, ReplaySubject } from 'rxjs'; +import { map, share, tap } from 'rxjs/operators'; +import { ResourcesService } from '@core/services/resources.service'; +import { DataKeyType } from '@shared/models/telemetry/telemetry.models'; +import { UtilsService } from '@core/services/utils.service'; +import { EntityService } from '@core/http/entity.service'; + +@Component({ + selector: 'liquid-level-card-widget-settings', + templateUrl: './liquid-level-card-widget-settings.component.html', + styleUrls: [] +}) +export class LiquidLevelCardWidgetSettingsComponent extends WidgetSettingsComponent { + + @ViewChild('layoutsImageCardsSelect', { static: false }) layoutsImageCardsSelect: ImageCardsSelectComponent; + + @ViewChild('shapesImageCardsSelect', { static: false }) shapesImageCardsSelect: ImageCardsSelectComponent; + + public get volumeInput(): boolean { + const datasourceUnits = this.levelCardWidgetSettingsForm.get('datasourceUnits').value; + const layout: LevelCardLayout = this.levelCardWidgetSettingsForm.get('layout').value; + + if (layout === LevelCardLayout.absolute) { + return true; + } + return datasourceUnits !== CapacityUnits.percent; + } + + private get datasource(): Datasource { + if (this.widgetConfig.config.datasources && this.widgetConfig.config.datasources) { + return this.widgetConfig.config.datasources[0]; + } else { + return null; + } + } + + LevelCardLayout = LevelCardLayout; + LevelCardLayouts = Object.values(LevelCardLayout) as LevelCardLayout[]; + LevelCardLayoutTranslationMap = levelCardLayoutTranslations; + + DataSourceType = LiquidWidgetDataSourceType; + DataSourceTypes = Object.values(LiquidWidgetDataSourceType) as LiquidWidgetDataSourceType[]; + DataSourceTypeTranslations = LiquidWidgetDataSourceTypeTranslations; + + shapes = Object.values(Shapes) as Shapes[]; + shapesImageMap: Map = new Map(); + ShapesTranslationMap = ShapesTranslations; + + unitsType = UnitsType; + + levelCardWidgetSettingsForm: FormGroup; + + valuePreviewFn = this._valuePreviewFn.bind(this); + + tooltipValuePreviewFn = this._tooltipValuePreviewFn.bind(this); + + totalVolumeValuePreviewFn = this._totalVolumeValuePreviewFn.bind(this); + + datePreviewFn = this._datePreviewFn.bind(this); + + private keySearchText: string; + private latestKeySearchTextResult: Array; + + private functionTypeKeys: Array = []; + + private lastKeysId: string; + private lastFetchedKeys: Array; + + constructor(protected store: Store, + private $injector: Injector, + private fb: FormBuilder, + private resourcesService: ResourcesService, + private sanitizer: DomSanitizer, + private cd: ChangeDetectorRef, + private utils: UtilsService, + private entityService: EntityService) { + super(store); + } + + protected settingsForm(): FormGroup { + return this.levelCardWidgetSettingsForm; + } + + protected onWidgetConfigSet(widgetConfig: WidgetConfigComponentData) { + this.createSvgShapesMapping(); + + for (const type of this.utils.getPredefinedFunctionsList()) { + this.functionTypeKeys.push({ + name: type, + type: DataKeyType.function + }); + } + } + + protected defaultSettings(): WidgetSettings { + return levelCardDefaultSettings; + } + + protected onSettingsSet(settings: WidgetSettings) { + this.levelCardWidgetSettingsForm = this.fb.group({ + tankSelectionType: [settings.tankSelectionType, []], + selectedShape: [settings.selectedShape, [Validators.required]], + shapeAttributeName: [settings.shapeAttributeName, [Validators.required]], + tankColor: [settings.tankColor, []], + datasourceUnits: [settings.datasourceUnits, [Validators.required]], + + layout: [settings.layout, []], + + volumeSource: [settings.volumeSource, []], + volumeConstant: [settings.volumeConstant, [Validators.required, Validators.min(0.1)]], + volumeAttributeName: [settings.volumeAttributeName, [Validators.required]], + volumeUnits: [settings.volumeUnits, [Validators.required]], + volumeFont: [settings.volumeFont, []], + volumeColor: [settings.volumeColor, []], + valueFont: [settings.valueFont, []], + valueColor: [settings.valueColor, []], + units: [settings.units, [Validators.required]], + widgetUnitsSource: [settings.widgetUnitsSource, [Validators.required]], + widgetUnitsAttributeName: [settings.widgetUnitsAttributeName, [Validators.required]], + showBackgroundOverlay: [settings.showBackgroundOverlay, []], + backgroundOverlayColor: [settings.backgroundOverlayColor, []], + + liquidColor: [settings.liquidColor, []], + background: [settings.background], + + showTooltip: [settings.showTooltip, []], + showTooltipLevel: [settings.showTooltipLevel, []], + tooltipUnits: [settings.tooltipUnits, []], + tooltipLevelDecimals: [settings.tooltipLevelDecimals, []], + tooltipLevelFont: [settings.tooltipLevelFont, []], + tooltipLevelColor: [settings.tooltipLevelColor, []], + showTooltipDate: [settings.showTooltipDate, []], + tooltipDateFormat: [settings.tooltipDateFormat, []], + tooltipDateFont: [settings.tooltipDateFont, []], + tooltipDateColor: [settings.tooltipDateColor, []], + tooltipBackgroundColor: [settings.tooltipBackgroundColor, []], + tooltipBackgroundBlur: [settings.tooltipBackgroundBlur, []], + }); + + this.levelCardWidgetSettingsForm.get('selectedShape').valueChanges.subscribe(() => { + this.cd.detectChanges(); + this.layoutsImageCardsSelect?.imageCardsSelectOptions.notifyOnChanges(); + }); + } + + protected validatorTriggers(): string[] { + return [ + 'showBackgroundOverlay', 'showTooltip', 'showTooltipLevel', 'tankSelectionType', 'datasourceUnits', + 'showTooltipDate', 'layout', 'volumeSource', 'widgetUnitsSource' + ]; + } + + protected updateValidators(emitEvent: boolean, trigger?: string) { + updatedFormSettingsValidators(this.levelCardWidgetSettingsForm); + + if (this.levelCardWidgetSettingsForm.get('showBackgroundOverlay').value) { + this.levelCardWidgetSettingsForm.get('backgroundOverlayColor').enable({emitEvent: false}); + } else { + this.levelCardWidgetSettingsForm.get('backgroundOverlayColor').disable({emitEvent: false}); + } + } + + private createSvgShapesMapping(): void { + loadSvgShapesMapping(this.resourcesService).subscribe(shapeMap => { + this.shapesImageMap = shapeMap; + + this.cd.detectChanges(); + this.layoutsImageCardsSelect?.imageCardsSelectOptions.notifyOnChanges(); + this.shapesImageCardsSelect?.imageCardsSelectOptions.notifyOnChanges(); + }); + } + + createShape(svg: string, layout: LevelCardLayout): SafeUrl { + return createShapeLayout(svg, layout, this.sanitizer); + } + + private _valuePreviewFn(): string { + const units: string = this.widgetConfig.config.units; + const decimals: number = this.widgetConfig.config.decimals; + return formatValue(32, decimals, units, true); + } + + private _tooltipValuePreviewFn() { + const units: string = this.levelCardWidgetSettingsForm.get('tooltipUnits').value; + const decimals: number = this.levelCardWidgetSettingsForm.get('tooltipLevelDecimals').value; + return formatValue(32, decimals, units, true); + } + + private _totalVolumeValuePreviewFn() { + const value = this.levelCardWidgetSettingsForm.get('volumeConstant').value; + const datasourceUnits = this.levelCardWidgetSettingsForm.get('datasourceUnits').value; + const decimals: number = this.widgetConfig.config.decimals; + let units: string = this.widgetConfig.config.units; + + if (datasourceUnits !== CapacityUnits.percent) { + units = datasourceUnits; + } + + return formatValue((isDefined(value) ? value : 500), decimals, units, true); + } + + private _datePreviewFn(): string { + const dateFormat: DateFormatSettings = this.levelCardWidgetSettingsForm.get('tooltipDateFormat').value; + const processor = DateFormatProcessor.fromSettings(this.$injector, dateFormat); + processor.update(Date.now()); + return processor.formatted; + } + + public fetchOptions(searchText: string): Observable> { + if (this.keySearchText !== searchText) { + this.keySearchText = searchText; + const dataKeyFilter = optionsFilter(this.keySearchText); + return this.getKeys().pipe( + tap(res => this.lastFetchedKeys !== res ? this.lastFetchedKeys = res : []), + map(name => name?.filter(dataKeyFilter).map(key => key.name)), + tap(res => this.latestKeySearchTextResult = res) + ); + } + return of(this.latestKeySearchTextResult); + } + + private getKeys(): Observable> { + let fetchObservable: Observable>; + if (this.datasource?.type === DatasourceType.function) { + fetchObservable = of(this.functionTypeKeys); + } else if (this.datasource?.type === DatasourceType.entity && this.datasource?.entityAliasId || + this.datasource?.type === DatasourceType.device && this.datasource?.deviceId) { + if (this.datasource?.type === DatasourceType.device) { + if (this.lastKeysId !== this.datasource?.deviceId || !this.lastFetchedKeys) { + this.lastKeysId = this.datasource.deviceId; + fetchObservable = fetchEntityKeysForDevice(this.datasource?.deviceId, [DataKeyType.attribute], + this.entityService); + } else { + fetchObservable = of(this.lastFetchedKeys); + } + } else { + if (this.lastKeysId !== this.datasource?.entityAliasId || !this.lastFetchedKeys) { + this.lastKeysId = this.datasource.entityAliasId; + fetchObservable = fetchEntityKeys(this.datasource?.entityAliasId, [DataKeyType.attribute], + this.entityService, this.aliasController); + } else { + fetchObservable = of(this.lastFetchedKeys); + } + } + } else { + fetchObservable = of([]); + } + return fetchObservable.pipe( + share({ + connector: () => new ReplaySubject(1), + resetOnError: false, + resetOnComplete: false, + resetOnRefCountZero: false + }) + ); + } +} diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts index 33b4323fdf..93749fadb5 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts @@ -300,6 +300,9 @@ import { import { ProgressBarWidgetSettingsComponent } from '@home/components/widget/lib/settings/cards/progress-bar-widget-settings.component'; +import { + LiquidLevelCardWidgetSettingsComponent +} from '@home/components/widget/lib/settings/indicator/liquid-level-card-widget-settings.component'; @NgModule({ declarations: [ @@ -410,7 +413,8 @@ import { WindSpeedDirectionWidgetSettingsComponent, SignalStrengthWidgetSettingsComponent, ValueChartCardWidgetSettingsComponent, - ProgressBarWidgetSettingsComponent + ProgressBarWidgetSettingsComponent, + LiquidLevelCardWidgetSettingsComponent ], imports: [ CommonModule, @@ -526,7 +530,8 @@ import { WindSpeedDirectionWidgetSettingsComponent, SignalStrengthWidgetSettingsComponent, ValueChartCardWidgetSettingsComponent, - ProgressBarWidgetSettingsComponent + ProgressBarWidgetSettingsComponent, + LiquidLevelCardWidgetSettingsComponent, ] }) export class WidgetSettingsModule { @@ -607,5 +612,6 @@ export const widgetSettingsComponentsMap: {[key: string]: Type + + {{label}} + + + + warning + + + {{errorText}} + + + + + + + diff --git a/ui-ngx/src/app/shared/components/string-autocomplete.component.scss b/ui-ngx/src/app/shared/components/string-autocomplete.component.scss new file mode 100644 index 0000000000..2d96ee0d5e --- /dev/null +++ b/ui-ngx/src/app/shared/components/string-autocomplete.component.scss @@ -0,0 +1,43 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +:host { + mat-form-field { + display: flex; + flex: 1; + max-width: 100%; + box-sizing: border-box; + + .tb-autocomplete.tb-option-input-autocomplete { + .mat-mdc-option { + border-bottom: none; + + .mdc-list-item__primary-text { + flex: 1; + display: flex; + flex-direction: row; + gap: 8px; + + .tb-option { + font-size: 14px; + font-weight: 400; + line-height: 20px; + letter-spacing: 0.2px; + } + } + } + } + } +} diff --git a/ui-ngx/src/app/shared/components/string-autocomplete.component.ts b/ui-ngx/src/app/shared/components/string-autocomplete.component.ts new file mode 100644 index 0000000000..df17ace6c7 --- /dev/null +++ b/ui-ngx/src/app/shared/components/string-autocomplete.component.ts @@ -0,0 +1,180 @@ +/// +/// Copyright © 2016-2023 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { + Component, + Input, + forwardRef, + OnInit, + ViewChild, + ElementRef +} from '@angular/core'; +import { + ControlValueAccessor, + NG_VALUE_ACCESSOR, + FormControl, + Validators, + FormBuilder +} from '@angular/forms'; +import { Observable, of } from 'rxjs'; +import { tap, map, switchMap, take } from 'rxjs/operators'; +import { TranslateService } from '@ngx-translate/core'; +import { coerceBoolean } from '@shared/decorators/coercion'; +import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field'; + +@Component({ + selector: 'tb-string-autocomplete', + templateUrl: './string-autocomplete.component.html', + styleUrls: ['./string-autocomplete.component.scss'], + providers: [ + { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(() => StringAutocompleteComponent), + multi: true + } + ] +}) +export class StringAutocompleteComponent implements ControlValueAccessor, OnInit { + + @ViewChild('nameInput', {static: true}) nameInput: ElementRef; + + @Input() + disabled: boolean; + + @Input() + @coerceBoolean() + required = false; + + @Input() + fetchOptionsFn: (searchText?: string) => Observable>; + + @Input() + placeholderText: string = this.translate.instant('widget-config.set'); + + @Input() + subscriptSizing: SubscriptSizing = 'dynamic'; + + @Input() + additionalClass: string | string[] | Record = 'tb-inline-field tb-suffix-show-on-hover'; + + @Input() + appearance: MatFormFieldAppearance = 'outline'; + + @Input() + label: string; + + @Input() + tooltipClass = 'tb-error-tooltip'; + + @Input() + errorText: string; + + @Input() + @coerceBoolean() + showInlineError = false; + + selectionFormControl: FormControl; + + modelValue: string | null; + + filteredOptions$: Observable>; + + searchText = ''; + + private dirty = false; + + private propagateChange = (_val: any) => {}; + + constructor(private fb: FormBuilder, + private translate: TranslateService) { + } + + ngOnInit() { + this.selectionFormControl = this.fb.control('', this.required ? [Validators.required] : []); + this.filteredOptions$ = this.selectionFormControl.valueChanges + .pipe( + tap(value => this.updateView(value)), + map(value => value ? value : ''), + switchMap(value => this.fetchOptionsFn ? this.fetchOptionsFn(value) : of([])) + ); + } + + writeValue(option?: string): void { + this.searchText = ''; + this.modelValue = option ? option : null; + + if (this.fetchOptionsFn) { + this.fetchOptionsFn(option) + .pipe( + map(options => { + if (options) { + const foundOption = options.find(opt => opt === option); + return foundOption ? foundOption : option; + } + + return option; + }), + take(1) + ) + .subscribe(result => { + this.selectionFormControl.patchValue(result, { emitEvent: false }); + this.dirty = true; + }); + } else { + this.selectionFormControl.patchValue(null, { emitEvent: false }); + this.dirty = true; + } + } + + onFocus() { + if (this.dirty) { + this.selectionFormControl.updateValueAndValidity({onlySelf: true, emitEvent: true}); + this.dirty = false; + } + } + + updateView(value: string) { + this.searchText = value ? value : ''; + if (this.modelValue !== value) { + this.modelValue = value; + this.propagateChange(this.modelValue); + } + } + + registerOnChange(fn: any): void { + this.propagateChange = fn; + } + + registerOnTouched(fn: any): void { + } + + setDisabledState(isDisabled: boolean): void { + this.disabled = isDisabled; + if (this.disabled) { + this.selectionFormControl.disable({emitEvent: false}); + } else { + this.selectionFormControl.enable({emitEvent: false}); + } + } + + clear() { + this.selectionFormControl.patchValue(null, {emitEvent: true}); + setTimeout(() => { + this.nameInput.nativeElement.blur(); + this.nameInput.nativeElement.focus(); + }, 0); + } +} diff --git a/ui-ngx/src/app/shared/components/unit-input.component.html b/ui-ngx/src/app/shared/components/unit-input.component.html index c15b232444..b0f3625eb0 100644 --- a/ui-ngx/src/app/shared/components/unit-input.component.html +++ b/ui-ngx/src/app/shared/components/unit-input.component.html @@ -20,13 +20,20 @@ placeholder="{{ 'widget-config.set' | translate }}" (focusin)="onFocus()" [matAutocomplete]="unitsAutocomplete"> - + + warning + >; @@ -73,7 +87,7 @@ export class UnitInputComponent implements ControlValueAccessor, OnInit { } ngOnInit() { - this.unitsFormControl = this.fb.control('', []); + this.unitsFormControl = this.fb.control('', this.required ? [Validators.required] : []); this.filteredUnits = this.unitsFormControl.valueChanges .pipe( tap(value => { @@ -157,11 +171,16 @@ export class UnitInputComponent implements ControlValueAccessor, OnInit { private unitsConstant(): Observable> { if (this.fetchUnits$ === null) { this.fetchUnits$ = getUnits(this.resourcesService).pipe( - map(units => units.map(u => ({ - symbol: u.symbol, - name: this.translate.instant(u.name), - tags: u.tags - }))), + map((units) => { + if (this.tagFilter) { + units = units.filter(u => u.tags.includes(this.tagFilter)); + } + return units.map(u => ({ + symbol: u.symbol, + name: this.translate.instant(u.name), + tags: u.tags + })); + }), shareReplay(1) ); } diff --git a/ui-ngx/src/app/shared/models/unit.models.ts b/ui-ngx/src/app/shared/models/unit.models.ts index 7d9f88a068..408c0b23b9 100644 --- a/ui-ngx/src/app/shared/models/unit.models.ts +++ b/ui-ngx/src/app/shared/models/unit.models.ts @@ -23,6 +23,15 @@ export interface Unit { tags: string[]; } +export enum UnitsType { + capacity = 'capacity' +} + +export enum Units { + percent = '%', + liters = 'L' +} + export const unitBySymbol = (_units: Array, symbol: string): Unit => _units.find(u => u.symbol === symbol); const searchUnitTags = (unit: Unit, searchText: string): boolean => diff --git a/ui-ngx/src/app/shared/models/widget-settings.models.ts b/ui-ngx/src/app/shared/models/widget-settings.models.ts index bd10859e55..165a4369bc 100644 --- a/ui-ngx/src/app/shared/models/widget-settings.models.ts +++ b/ui-ngx/src/app/shared/models/widget-settings.models.ts @@ -401,6 +401,33 @@ export const textStyle = (font?: Font, letterSpacing = 'normal'): ComponentStyle return style; }; +export const inlineTextStyle = (font?: Font, letterSpacing = 'normal'): ComponentStyle => { + const style: ComponentStyle = { + letterSpacing + }; + if (font?.style) { + style['font-style'] = font.style; + } + if (font?.weight) { + style['font-weight'] = font.weight; + } + if (font?.lineHeight) { + style['line-height'] = font.lineHeight; + } + if (font?.size) { + style['font-size'] = (font.size + (font.sizeUnit || 'px')); + } + if (font?.family) { + style['font-family'] = font.family + + (font.family !== 'Roboto' ? ', Roboto' : ''); + } + return style; +}; + +export const cssTextFromInlineStyle = (styleObj: { [key: string]: string | number }): string => Object.entries(styleObj) + .map(([key, value]) => `${key}: ${value}`) + .join('; '); + export const isFontSet = (font: Font): boolean => (!!font && !!font.style && !!font.weight && !!font.size && !!font.family); export const isFontPartiallySet = (font: Font): boolean => (!!font && (!!font.style || !!font.weight || !!font.size || !!font.family)); diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index 2211f2e0e1..042e453fe1 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -199,6 +199,7 @@ import { MaterialIconsComponent } from '@shared/components/material-icons.compon import { ColorPickerPanelComponent } from '@shared/components/color-picker/color-picker-panel.component'; import { TbIconComponent } from '@shared/components/icon.component'; import { HintTooltipIconComponent } from '@shared/components/hint-tooltip-icon.component'; +import { StringAutocompleteComponent } from '@shared/components/string-autocomplete.component'; export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) { return markedOptionsService; @@ -374,6 +375,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) ToggleOption, ToggleSelectComponent, UnitInputComponent, + StringAutocompleteComponent, MaterialIconsComponent, RuleChainSelectComponent, TbIconComponent, @@ -609,6 +611,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) ToggleOption, ToggleSelectComponent, UnitInputComponent, + StringAutocompleteComponent, MaterialIconsComponent, RuleChainSelectComponent, TbIconComponent, diff --git a/ui-ngx/src/assets/help/en_US/widget/lib/indicator/shape_attribute_fn.md b/ui-ngx/src/assets/help/en_US/widget/lib/indicator/shape_attribute_fn.md new file mode 100644 index 0000000000..f2e69877d2 --- /dev/null +++ b/ui-ngx/src/assets/help/en_US/widget/lib/indicator/shape_attribute_fn.md @@ -0,0 +1,69 @@ +#### Shape attribute name + +A string expression value that allows you dynamically select shape image depending on attribute name (ex. tankShape). + +**Attribute values that could be used to add the image:** + +Alt text + +``` +Vertical Oval +{:copy-code} +``` +Alt text + +``` +Vertical Cylinder +{:copy-code} +``` +Alt text + +``` +Vertical Capsule +{:copy-code} +``` +Alt text + +``` +Rectangle +{:copy-code} +``` +Alt text + +``` +Horizontal Oval +{:copy-code} +``` +Alt text + +``` +Horizontal Ellipse +{:copy-code} +``` +Alt text + +``` +Horizontal Dish Ends +{:copy-code} +``` +Alt text + +``` +Horizontal Cylinder +{:copy-code} +``` +Alt text + +``` +Horizontal Capsule +{:copy-code} +``` +Alt text + +``` +Horizontal 2:1 Elliptical +{:copy-code} +``` + +
+
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 f5c09ce75f..001db8a505 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -4229,20 +4229,20 @@ "carat": "Carat", "cubic-millimeter": "Cubic Millimeter", "cubic-centimeter": "Cubic Centimeter", - "cubic-meter": "Cubic Meter/s", - "cubic-kilometer": "Cubic Kilometers", + "cubic-meter": "Cubic Meter", + "cubic-kilometer": "Cubic Kilometer", "microliter": "Microliter", "milliliter": "Milliliter", "liter": "Liter", "hectoliter": "Hectolitre", "cubic-inch": "Cubic Inch", "cubic-foot": "Cubic Foot", - "cubic-yard": "Cubic Yards", + "cubic-yard": "Cubic Yard", "fluid-ounce": "Fluid Ounce", "pint": "Pint", "quart": "Quart", "gallon": "Gallon", - "oil-barrels": "Oil Barrels", + "oil-barrels": "Oil Barrel", "cubic-meter-per-kilogram": "Cubic Meter per Kilogram", "gill": "Gill", "hogshead": "Hogshead", @@ -4286,7 +4286,6 @@ "ton-force-per-square-inch": "Ton-force per Square Inch", "kilonewton-per-square-meter": "Kilonewton per Square Meter", "newton-per-square-millimeter": "Newton per Square Millimeter", - "microjoule": "Microjoule", "millijoule": "Millijoule", "joule": "Joule", @@ -5029,7 +5028,9 @@ "show-card-buttons": "Show card buttons", "card-border-radius": "Card border radius", "card-appearance": "Card appearance", - "color": "Color" + "color": "Color", + "tooltip": "Tooltip", + "units-required": "Unit is required." }, "widget-type": { "import": "Import widget type", @@ -6065,6 +6066,52 @@ "value-card-style": "Value card style", "auto-scale": "Auto scale" }, + "liquid-level-card": { + "layout-simple": "Simple", + "layout-percentage": "Percentage", + "layout-absolute": "Absolute", + "layout": "Layout", + "background-overlay": "Value background overlay", + "total-volume": "Total volume", + "tank": "Tank", + "shape": "Shape", + "datasource-units": "Source units", + "widget-units": "Widget units", + "decimals": "Decimals", + "liquid": "Liquid", + "liquid-color": "Liquid color", + "value": "Value", + "value-font": "Value font", + "level": "Level", + "last-update": "Last update", + "shape-by-attribute": "Set tank shape by attribute name", + "tooltip-background": "Background color", + "background-blur": "Background blur", + "tank-color": "Tank color", + "static": "Static", + "see-examples": "See examples", + "attribute": "Attribute", + "shape-type": "Type", + "v-oval": "Vertical Oval", + "v-cylinder": "Vertical Cylinder", + "v-capsule": "Vertical Capsule", + "rectangle": "Rectangle", + "h-oval": "Horizontal Oval", + "h-ellipse": "Horizontal Ellipse", + "h-dish-ends": "Horizontal Dish Ends", + "h-cylinder": "Horizontal Cylinder", + "h-capsule": "Horizontal Capsule", + "h-elliptical_2_1": "Horizontal 2:1 Elliptical", + "icon": "Card icon", + "title": "Card title", + "units": "Units", + "color-and-font": "Color and font", + "shape-attribute-name": "Attribute name", + "total-volume-required": "Total volume is required.", + "attribute-name-required": "Attribute name is required.", + "attribute-key-not-set": "Attribute '{{attributeName}}' key not set", + "attribute-key-invalid": "Attribute '{{attributeName}}' key is invalid" + }, "aggregated-value-card": { "subtitle": "Subtitle", "chart": "Chart", diff --git a/ui-ngx/src/assets/metadata/units.json b/ui-ngx/src/assets/metadata/units.json index 5d680c6e2c..3237d6620b 100644 --- a/ui-ngx/src/assets/metadata/units.json +++ b/ui-ngx/src/assets/metadata/units.json @@ -249,7 +249,7 @@ }, { "name": "unit.liter", - "symbol": "l", + "symbol": "L", "tags": ["volume","capacity","extent","liter","liters","l"] }, { @@ -1113,7 +1113,7 @@ "symbol": "%", "tags": ["power source","state of charge (SoC)","battery","battery level","level","humidity","moisture","percentage", "relative humidity","water content","soil moisture","irrigation","water in soil","soil water content","VWC", - "Volumetric Water Content","Total Harmonic Distortion","THD","power quality","UV Transmittance","%"] + "Volumetric Water Content","Total Harmonic Distortion","THD","power quality","UV Transmittance","%", "capacity"] }, { "name": "unit.rssi", diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-2_1-elliptical.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-2_1-elliptical.svg new file mode 100644 index 0000000000..d6196e5f71 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-2_1-elliptical.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-capsule.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-capsule.svg new file mode 100644 index 0000000000..20319f34e7 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-capsule.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-cylinder.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-cylinder.svg new file mode 100644 index 0000000000..e05fb41e99 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-cylinder.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-dish-ends.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-dish-ends.svg new file mode 100644 index 0000000000..af0195c782 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-dish-ends.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-ellipse.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-ellipse.svg new file mode 100644 index 0000000000..5d0c0b2307 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-ellipse.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-oval.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-oval.svg new file mode 100644 index 0000000000..86af838fb2 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/horizontal-oval.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/rectangle.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/rectangle.svg new file mode 100644 index 0000000000..800093c1d4 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/rectangle.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-capsule.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-capsule.svg new file mode 100644 index 0000000000..dde2f5b903 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-capsule.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-cylinder.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-cylinder.svg new file mode 100644 index 0000000000..7c15c4af9f --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-cylinder.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-oval.svg b/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-oval.svg new file mode 100644 index 0000000000..89dd578803 --- /dev/null +++ b/ui-ngx/src/assets/widget/liquid-level/shapes/vertical-oval.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui-ngx/src/form.scss b/ui-ngx/src/form.scss index 93272af3ca..3b29fe986c 100644 --- a/ui-ngx/src/form.scss +++ b/ui-ngx/src/form.scss @@ -368,14 +368,20 @@ .mat-mdc-text-field-wrapper { .mat-mdc-form-field-icon-suffix { padding: 0; - display: none; + display: flex; + align-items: center; + + > *:not(.tb-suffix-show-always) { + display: none; + } } } &:hover { .mat-mdc-text-field-wrapper { .mat-mdc-form-field-icon-suffix { - display: flex; - align-items: center; + > * { + display: block; + } } } } diff --git a/ui-ngx/src/styles.scss b/ui-ngx/src/styles.scss index 0ee154cf7d..ee6f6374cf 100644 --- a/ui-ngx/src/styles.scss +++ b/ui-ngx/src/styles.scss @@ -342,6 +342,12 @@ mat-label { } } +mat-icon { + &.tb-error { + color: rgb(221, 44, 0); + } +} + .tb-error-messages { height: 24px; //30px margin-top: -6px; @@ -356,6 +362,13 @@ mat-label { color: rgb(221, 44, 0); } +.mat-mdc-tooltip.tb-error-tooltip { + .mdc-tooltip__surface { + background-color: rgba(209, 39, 48, 0.12); + color: rgba(209, 39, 48, 1); + } +} + .tb-autocomplete { .mat-mdc-option { border-bottom: 1px solid #eee;