34 changed files with 2174 additions and 216 deletions
@ -0,0 +1,13 @@ |
|||
{ |
|||
"widgetsBundle": { |
|||
"alias": "weather_widgets", |
|||
"title": "Weather widgets", |
|||
"image": null, |
|||
"description": null, |
|||
"externalId": null, |
|||
"name": "Weather widgets" |
|||
}, |
|||
"widgetTypeFqns": [ |
|||
"wind_speed_and_direction" |
|||
] |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
{ |
|||
"fqn": "wind_speed_and_direction", |
|||
"name": "Wind speed and direction", |
|||
"deprecated": false, |
|||
"image": "data:image/png;base64,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", |
|||
"description": "Displays the latest values of the wind speed and direction.", |
|||
"descriptor": { |
|||
"type": "latest", |
|||
"sizeX": 3, |
|||
"sizeY": 3, |
|||
"resources": [], |
|||
"templateHtml": "<tb-wind-speed-direction-widget \n [ctx]=\"ctx\"\n [widgetTitlePanel]=\"widgetTitlePanel\">\n</tb-wind-speed-direction-widget>", |
|||
"templateCss": "", |
|||
"controllerScript": "self.onInit = function() {\n self.ctx.$scope.windSpeedDirectionWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.windSpeedDirectionWidget.onDataUpdated();\n};\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 2,\n singleEntity: true,\n previewWidth: '270px',\n previewHeight: '270px',\n embedTitlePanel: true\n };\n};\n\nself.actionSources = function() {\n return {\n 'cardClick': {\n name: 'widget-action.card-click',\n multiple: false\n }\n };\n}\n\nself.onDestroy = function() {\n};\n", |
|||
"settingsSchema": "", |
|||
"dataKeySettingsSchema": "", |
|||
"settingsDirective": "tb-wind-speed-direction-widget-settings", |
|||
"hasBasicMode": true, |
|||
"basicModeDirective": "tb-wind-speed-direction-basic-config", |
|||
"defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"windDirection\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.7227918773301678,\"funcBody\":\"if (prevValue === 0) {\\n prevValue = Math.random() * 360;\\n}\\nvar value = prevValue + Math.random() * 20 - 10;\\nif (value < 0) {\\n\\tvalue = 0;\\n} else if (value > 360) {\\n\\tvalue = 360;\\n}\\nreturn value;\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"centerValue\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.2392660816082064,\"funcBody\":\"var value = prevValue + Math.random() * 7;\\nif (value < 0) {\\n\\tvalue = 0;\\n} else if (value > 30) {\\n\\tvalue = 0;\\n}\\nreturn value;\",\"aggregationType\":null,\"units\":\"m/s\",\"decimals\":1,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"rgba(0, 0, 0, 0)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"layout\":\"default\",\"centerValueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"32px\"},\"centerValueColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"colorFunction\":\"var temperature = value;\\nif (typeof temperature !== undefined) {\\n var percent = (temperature + 60)/120 * 100;\\n return tinycolor.mix('blue', 'red', percent).toHexString();\\n}\\nreturn 'blue';\"},\"ticksColor\":\"rgba(0, 0, 0, 0.12)\",\"directionalNamesElseDegrees\":true,\"majorTicksFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"20px\"},\"majorTicksColor\":\"rgba(158, 158, 158, 1)\",\"minorTicksFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"20px\"},\"minorTicksColor\":\"rgba(0, 0, 0, 0.12)\",\"arrowColor\":\"rgba(0, 0, 0, 0.87)\",\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Wind speed and direction\",\"dropShadow\":true,\"enableFullscreen\":false,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"units\":\"\",\"decimals\":0,\"useDashboardTimewindow\":true,\"showLegend\":false,\"widgetStyle\":{},\"actions\":{\"headerButton\":[]},\"configMode\":\"basic\",\"displayTimewindow\":true,\"margin\":\"0px\",\"borderRadius\":\"0px\",\"widgetCss\":\"\",\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showTitleIcon\":false,\"titleTooltip\":\"\",\"titleFont\":{\"size\":16,\"sizeUnit\":\"px\",\"family\":\"Roboto\",\"weight\":\"500\",\"style\":\"normal\",\"lineHeight\":\"24px\"},\"titleIcon\":\"air\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"timewindowStyle\":{\"showIcon\":true,\"iconSize\":\"14px\",\"icon\":\"query_builder\",\"iconPosition\":\"left\",\"font\":{\"size\":12,\"sizeUnit\":\"px\",\"family\":null,\"weight\":null,\"style\":null,\"lineHeight\":\"1\"},\"color\":null},\"titleColor\":\"rgba(0, 0, 0, 0.87)\"}" |
|||
}, |
|||
"externalId": null, |
|||
"tags": [ |
|||
"wind", |
|||
"weather", |
|||
"compass", |
|||
"degrees" |
|||
] |
|||
} |
|||
@ -0,0 +1,213 @@ |
|||
<!-- |
|||
|
|||
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. |
|||
|
|||
--> |
|||
<ng-container [formGroup]="windSpeedDirectionWidgetConfigForm"> |
|||
<tb-timewindow-config-panel *ngIf="displayTimewindowConfig" |
|||
[onlyHistoryTimewindow]="onlyHistoryTimewindow()" |
|||
formControlName="timewindowConfig"> |
|||
</tb-timewindow-config-panel> |
|||
<tb-datasources |
|||
[configMode]="basicMode" |
|||
hideDataKeys |
|||
hideDatasourceLabel |
|||
formControlName="datasources"> |
|||
</tb-datasources> |
|||
<div class="tb-form-panel"> |
|||
<div class="tb-form-panel-title" translate>widgets.wind-speed-direction.values</div> |
|||
<div class="tb-form-row"> |
|||
<div class="fixed-title-width tb-required" translate>widgets.wind-speed-direction.wind-direction</div> |
|||
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<tb-data-key-row fxFlex |
|||
formControlName="windDirectionKey" |
|||
required |
|||
[datasourceType]="datasource?.type" |
|||
[deviceId]="datasource?.deviceId" |
|||
[entityAliasId]="datasource?.entityAliasId" |
|||
hideDataKeyLabel |
|||
hideDataKeyColor |
|||
hideDataKeyDecimals |
|||
hideDataKeyUnits> |
|||
</tb-data-key-row> |
|||
<tb-font-settings *ngIf="!windSpeedDirectionWidgetConfigForm.get('centerValueKey').value" |
|||
formControlName="centerValueFont" |
|||
[autoScale]="true" |
|||
[initialPreviewStyle]="{ color: windSpeedDirectionWidgetConfigForm.get('centerValueColor').value?.color }" |
|||
[previewText]="centerValuePreviewFn"> |
|||
</tb-font-settings> |
|||
<tb-color-settings *ngIf="!windSpeedDirectionWidgetConfigForm.get('centerValueKey').value" |
|||
formControlName="centerValueColor"> |
|||
</tb-color-settings> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-row column-xs"> |
|||
<div class="fixed-title-width" translate>widgets.wind-speed-direction.center-value</div> |
|||
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<tb-data-key-row fxFlex |
|||
formControlName="centerValueKey" |
|||
[datasourceType]="datasource?.type" |
|||
[deviceId]="datasource?.deviceId" |
|||
[entityAliasId]="datasource?.entityAliasId" |
|||
hideDataKeyLabel |
|||
hideDataKeyColor> |
|||
</tb-data-key-row> |
|||
<tb-font-settings *ngIf="windSpeedDirectionWidgetConfigForm.get('centerValueKey').value" |
|||
formControlName="centerValueFont" |
|||
[autoScale]="true" |
|||
[initialPreviewStyle]="{ color: windSpeedDirectionWidgetConfigForm.get('centerValueColor').value?.color }" |
|||
[previewText]="centerValuePreviewFn"> |
|||
</tb-font-settings> |
|||
<tb-color-settings *ngIf="windSpeedDirectionWidgetConfigForm.get('centerValueKey').value" |
|||
formControlName="centerValueColor"> |
|||
</tb-color-settings> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-panel"> |
|||
<div class="tb-form-panel-title" translate>widget-config.appearance</div> |
|||
<tb-image-cards-select rowHeight="1:1" |
|||
cols="3" |
|||
colsLtMd="2" |
|||
label="{{ 'widgets.wind-speed-direction.layout' | translate }}" formControlName="layout"> |
|||
<tb-image-cards-select-option *ngFor="let layout of windSpeedDirectionLayouts" |
|||
[value]="layout" |
|||
[image]="windSpeedDirectionLayoutImageMap.get(layout)"> |
|||
{{ windSpeedDirectionLayoutTranslationMap.get(layout) | translate }} |
|||
</tb-image-cards-select-option> |
|||
</tb-image-cards-select> |
|||
<div class="tb-form-row column-xs"> |
|||
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showTitle"> |
|||
{{ 'widget-config.title' | translate }} |
|||
</mat-slide-toggle> |
|||
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<mat-form-field class="flex" appearance="outline" subscriptSizing="dynamic"> |
|||
<input matInput formControlName="title" placeholder="{{ 'widget-config.set' | translate }}"> |
|||
</mat-form-field> |
|||
<tb-font-settings formControlName="titleFont" |
|||
clearButton |
|||
[previewText]="windSpeedDirectionWidgetConfigForm.get('title').value" |
|||
[initialPreviewStyle]="widgetConfig.config.titleStyle"> |
|||
</tb-font-settings> |
|||
<tb-color-input asBoxInput |
|||
colorClearButton |
|||
formControlName="titleColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-row column-xs"> |
|||
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showIcon"> |
|||
{{ 'widgets.wind-speed-direction.icon' | translate }} |
|||
</mat-slide-toggle> |
|||
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<mat-form-field appearance="outline" class="flex number" subscriptSizing="dynamic"> |
|||
<input matInput type="number" min="0" formControlName="iconSize" placeholder="{{ 'widget-config.set' | translate }}"> |
|||
</mat-form-field> |
|||
<tb-css-unit-select fxFlex formControlName="iconSizeUnit"></tb-css-unit-select> |
|||
<tb-material-icon-select asBoxInput |
|||
iconClearButton |
|||
[color]="windSpeedDirectionWidgetConfigForm.get('iconColor').value" |
|||
formControlName="icon"> |
|||
</tb-material-icon-select> |
|||
<tb-color-input asBoxInput |
|||
colorClearButton |
|||
formControlName="iconColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-panel"> |
|||
<div class="tb-form-panel-title" translate>widgets.wind-speed-direction.ticks</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widget-config.color' | translate }}</div> |
|||
<tb-color-input asBoxInput |
|||
formControlName="ticksColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.labels-type' | translate }}</div> |
|||
<mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic"> |
|||
<mat-select formControlName="directionalNamesElseDegrees"> |
|||
<mat-option [value]="true"> |
|||
{{ 'widgets.wind-speed-direction.directional-names' | translate }} |
|||
</mat-option> |
|||
<mat-option [value]="false"> |
|||
{{ 'widgets.wind-speed-direction.degrees' | translate }} |
|||
</mat-option> |
|||
</mat-select> |
|||
</mat-form-field> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.major-ticks' | translate }}</div> |
|||
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<tb-font-settings [fxShow]="majorTicksFontEnabled" |
|||
formControlName="majorTicksFont" |
|||
[initialPreviewStyle]="{ color: windSpeedDirectionWidgetConfigForm.get('majorTicksColor').value }" |
|||
[autoScale]="true" |
|||
previewText="N E S W"> |
|||
</tb-font-settings> |
|||
<tb-color-input asBoxInput |
|||
formControlName="majorTicksColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.minor-ticks' | translate }}</div> |
|||
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<tb-font-settings [fxShow]="minorTicksFontEnabled" |
|||
formControlName="minorTicksFont" |
|||
[initialPreviewStyle]="{ color: windSpeedDirectionWidgetConfigForm.get('minorTicksColor').value }" |
|||
[autoScale]="true" |
|||
previewText="NE SE SW NW"> |
|||
</tb-font-settings> |
|||
<tb-color-input asBoxInput |
|||
formControlName="minorTicksColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-panel"> |
|||
<div class="tb-form-panel-title" translate>widgets.wind-speed-direction.arrow</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widget-config.color' | translate }}</div> |
|||
<tb-color-input asBoxInput |
|||
formControlName="arrowColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-panel"> |
|||
<div class="tb-form-panel-title" translate>widget-config.card-appearance</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.background.background' | translate }}</div> |
|||
<tb-background-settings formControlName="background"> |
|||
</tb-background-settings> |
|||
</div> |
|||
<div class="tb-form-row space-between column-lt-md"> |
|||
<div translate>widget-config.show-card-buttons</div> |
|||
<mat-chip-listbox multiple formControlName="cardButtons"> |
|||
<mat-chip-option value="fullscreen">{{ 'fullscreen.fullscreen' | translate }}</mat-chip-option> |
|||
</mat-chip-listbox> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widget-config.card-border-radius' | translate }}</div> |
|||
<mat-form-field appearance="outline" subscriptSizing="dynamic"> |
|||
<input matInput formControlName="borderRadius" placeholder="{{ 'widget-config.set' | translate }}"> |
|||
</mat-form-field> |
|||
</div> |
|||
</div> |
|||
<tb-widget-actions-panel |
|||
formControlName="actions"> |
|||
</tb-widget-actions-panel> |
|||
</ng-container> |
|||
@ -0,0 +1,291 @@ |
|||
///
|
|||
/// 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, Injector } from '@angular/core'; |
|||
import { UntypedFormBuilder, UntypedFormGroup, 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, |
|||
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, isDefinedAndNotNull, isUndefined } from '@core/utils'; |
|||
import { |
|||
cssSizeToStrSize, getDataKey, |
|||
getDataKeyByLabel, |
|||
resolveCssSize, |
|||
updateDataKeyByLabel |
|||
} from '@shared/models/widget-settings.models'; |
|||
import { |
|||
centerValueLabel, |
|||
windDirectionLabel, |
|||
windSpeedDirectionDefaultSettings, |
|||
WindSpeedDirectionLayout, |
|||
windSpeedDirectionLayoutImages, |
|||
windSpeedDirectionLayouts, |
|||
windSpeedDirectionLayoutTranslations, |
|||
WindSpeedDirectionWidgetSettings |
|||
} from '@home/components/widget/lib/weather/wind-speed-direction-widget.models'; |
|||
|
|||
@Component({ |
|||
selector: 'tb-wind-speed-direction-basic-config', |
|||
templateUrl: './wind-speed-direction-basic-config.component.html', |
|||
styleUrls: ['../basic-config.scss'] |
|||
}) |
|||
export class WindSpeedDirectionBasicConfigComponent extends BasicWidgetConfigComponent { |
|||
|
|||
public get datasource(): Datasource { |
|||
const datasources: Datasource[] = this.windSpeedDirectionWidgetConfigForm.get('datasources').value; |
|||
if (datasources && datasources.length) { |
|||
return datasources[0]; |
|||
} else { |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
public get displayTimewindowConfig(): boolean { |
|||
const datasources = this.windSpeedDirectionWidgetConfigForm.get('datasources').value; |
|||
return datasourcesHasAggregation(datasources); |
|||
} |
|||
|
|||
public onlyHistoryTimewindow(): boolean { |
|||
const datasources = this.windSpeedDirectionWidgetConfigForm.get('datasources').value; |
|||
return datasourcesHasOnlyComparisonAggregation(datasources); |
|||
} |
|||
|
|||
windSpeedDirectionLayouts = windSpeedDirectionLayouts; |
|||
|
|||
windSpeedDirectionLayoutTranslationMap = windSpeedDirectionLayoutTranslations; |
|||
windSpeedDirectionLayoutImageMap = windSpeedDirectionLayoutImages; |
|||
|
|||
windSpeedDirectionWidgetConfigForm: UntypedFormGroup; |
|||
|
|||
centerValuePreviewFn = this._centerValuePreviewFn.bind(this); |
|||
|
|||
get majorTicksFontEnabled(): boolean { |
|||
const layout: WindSpeedDirectionLayout = this.windSpeedDirectionWidgetConfigForm.get('layout').value; |
|||
return [ WindSpeedDirectionLayout.default, WindSpeedDirectionLayout.advanced ].includes(layout); |
|||
} |
|||
|
|||
get minorTicksFontEnabled(): boolean { |
|||
const layout: WindSpeedDirectionLayout = this.windSpeedDirectionWidgetConfigForm.get('layout').value; |
|||
return layout === WindSpeedDirectionLayout.advanced; |
|||
} |
|||
|
|||
constructor(protected store: Store<AppState>, |
|||
protected widgetConfigComponent: WidgetConfigComponent, |
|||
private $injector: Injector, |
|||
private fb: UntypedFormBuilder) { |
|||
super(store, widgetConfigComponent); |
|||
} |
|||
|
|||
protected configForm(): UntypedFormGroup { |
|||
return this.windSpeedDirectionWidgetConfigForm; |
|||
} |
|||
|
|||
protected setupDefaults(configData: WidgetConfigComponentData) { |
|||
this.setupDefaultDatasource(configData, [{ name: 'winddirection', label: windDirectionLabel, type: DataKeyType.timeseries }, |
|||
{ name: 'windspeed', label: centerValueLabel, type: DataKeyType.timeseries, |
|||
units: 'm/s', decimals: 1 }]); |
|||
} |
|||
|
|||
protected onConfigSet(configData: WidgetConfigComponentData) { |
|||
const settings: WindSpeedDirectionWidgetSettings = {...windSpeedDirectionDefaultSettings, ...(configData.config.settings || {})}; |
|||
const iconSize = resolveCssSize(configData.config.iconSize); |
|||
let windDirectionDataKey = getDataKeyByLabel(configData.config.datasources, windDirectionLabel); |
|||
if (!windDirectionDataKey) { |
|||
windDirectionDataKey = getDataKey(configData.config.datasources); |
|||
} |
|||
this.windSpeedDirectionWidgetConfigForm = this.fb.group({ |
|||
timewindowConfig: [getTimewindowConfig(configData.config), []], |
|||
datasources: [configData.config.datasources, []], |
|||
|
|||
windDirectionKey: [windDirectionDataKey, [Validators.required]], |
|||
|
|||
centerValueKey: [getDataKeyByLabel(configData.config.datasources, centerValueLabel), []], |
|||
centerValueFont: [settings.centerValueFont, []], |
|||
centerValueColor: [settings.centerValueColor, []], |
|||
|
|||
layout: [settings.layout, []], |
|||
|
|||
showTitle: [configData.config.showTitle, []], |
|||
title: [configData.config.title, []], |
|||
titleFont: [configData.config.titleFont, []], |
|||
titleColor: [configData.config.titleColor, []], |
|||
|
|||
showIcon: [configData.config.showTitleIcon, []], |
|||
iconSize: [iconSize[0], [Validators.min(0)]], |
|||
iconSizeUnit: [iconSize[1], []], |
|||
icon: [configData.config.titleIcon, []], |
|||
iconColor: [configData.config.iconColor, []], |
|||
|
|||
ticksColor: [settings.ticksColor, []], |
|||
directionalNamesElseDegrees: [settings.directionalNamesElseDegrees, []], |
|||
|
|||
majorTicksFont: [settings.majorTicksFont, []], |
|||
majorTicksColor: [settings.majorTicksColor, []], |
|||
|
|||
minorTicksFont: [settings.minorTicksFont, []], |
|||
minorTicksColor: [settings.minorTicksColor, []], |
|||
|
|||
arrowColor: [settings.arrowColor, []], |
|||
|
|||
background: [settings.background, []], |
|||
|
|||
cardButtons: [this.getCardButtons(configData.config), []], |
|||
borderRadius: [configData.config.borderRadius, []], |
|||
|
|||
actions: [configData.config.actions || {}, []] |
|||
}); |
|||
} |
|||
|
|||
protected prepareOutputConfig(config: any): WidgetConfigComponentData { |
|||
setTimewindowConfig(this.widgetConfig.config, config.timewindowConfig); |
|||
this.widgetConfig.config.datasources = config.datasources; |
|||
|
|||
updateDataKeyByLabel(this.widgetConfig.config.datasources, config.windDirectionKey, windDirectionLabel); |
|||
updateDataKeyByLabel(this.widgetConfig.config.datasources, config.centerValueKey, centerValueLabel); |
|||
|
|||
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.showIcon; |
|||
this.widgetConfig.config.iconSize = cssSizeToStrSize(config.iconSize, config.iconSizeUnit); |
|||
this.widgetConfig.config.titleIcon = config.icon; |
|||
this.widgetConfig.config.iconColor = config.iconColor; |
|||
|
|||
this.widgetConfig.config.settings = this.widgetConfig.config.settings || {}; |
|||
|
|||
this.widgetConfig.config.settings.layout = config.layout; |
|||
|
|||
this.widgetConfig.config.settings.centerValueFont = config.centerValueFont; |
|||
this.widgetConfig.config.settings.centerValueColor = config.centerValueColor; |
|||
|
|||
this.widgetConfig.config.settings.ticksColor = config.ticksColor; |
|||
this.widgetConfig.config.settings.directionalNamesElseDegrees = config.directionalNamesElseDegrees; |
|||
|
|||
this.widgetConfig.config.settings.majorTicksFont = config.majorTicksFont; |
|||
this.widgetConfig.config.settings.majorTicksColor = config.majorTicksColor; |
|||
|
|||
this.widgetConfig.config.settings.minorTicksFont = config.minorTicksFont; |
|||
this.widgetConfig.config.settings.minorTicksColor = config.minorTicksColor; |
|||
|
|||
this.widgetConfig.config.settings.arrowColor = config.arrowColor; |
|||
|
|||
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 ['layout', 'showTitle', 'showIcon']; |
|||
} |
|||
|
|||
protected updateValidators(emitEvent: boolean, trigger?: string) { |
|||
const layout: WindSpeedDirectionLayout = this.windSpeedDirectionWidgetConfigForm.get('layout').value; |
|||
const showTitle: boolean = this.windSpeedDirectionWidgetConfigForm.get('showTitle').value; |
|||
const showIcon: boolean = this.windSpeedDirectionWidgetConfigForm.get('showIcon').value; |
|||
|
|||
const majorTicksFontEnabled = [ WindSpeedDirectionLayout.default, WindSpeedDirectionLayout.advanced ].includes(layout); |
|||
const minorTicksFontEnabled = layout === WindSpeedDirectionLayout.advanced; |
|||
|
|||
if (showTitle) { |
|||
this.windSpeedDirectionWidgetConfigForm.get('title').enable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('titleFont').enable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('titleColor').enable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('showIcon').enable({emitEvent: false}); |
|||
if (showIcon) { |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconSize').enable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconSizeUnit').enable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('icon').enable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconColor').enable(); |
|||
} else { |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconSize').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconSizeUnit').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('icon').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconColor').disable(); |
|||
} |
|||
} else { |
|||
this.windSpeedDirectionWidgetConfigForm.get('title').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('titleFont').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('titleColor').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('showIcon').disable({emitEvent: false}); |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconSize').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconSizeUnit').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('icon').disable(); |
|||
this.windSpeedDirectionWidgetConfigForm.get('iconColor').disable(); |
|||
} |
|||
|
|||
if (majorTicksFontEnabled) { |
|||
this.windSpeedDirectionWidgetConfigForm.get('majorTicksFont').enable(); |
|||
} else { |
|||
this.windSpeedDirectionWidgetConfigForm.get('majorTicksFont').disable(); |
|||
} |
|||
|
|||
if (minorTicksFontEnabled) { |
|||
this.windSpeedDirectionWidgetConfigForm.get('minorTicksFont').enable(); |
|||
} else { |
|||
this.windSpeedDirectionWidgetConfigForm.get('minorTicksFont').disable(); |
|||
} |
|||
} |
|||
|
|||
private getCardButtons(config: WidgetConfig): string[] { |
|||
const buttons: string[] = []; |
|||
if (isUndefined(config.enableFullscreen) || config.enableFullscreen) { |
|||
buttons.push('fullscreen'); |
|||
} |
|||
return buttons; |
|||
} |
|||
|
|||
private setCardButtons(buttons: string[], config: WidgetConfig) { |
|||
config.enableFullscreen = buttons.includes('fullscreen'); |
|||
} |
|||
|
|||
private _centerValuePreviewFn(): string { |
|||
const centerValueDataKey: DataKey = this.windSpeedDirectionWidgetConfigForm.get('centerValueKey').value; |
|||
if (centerValueDataKey) { |
|||
let units: string = this.widgetConfig.config.units; |
|||
let decimals: number = this.widgetConfig.config.decimals; |
|||
if (isDefinedAndNotNull(centerValueDataKey?.decimals)) { |
|||
decimals = centerValueDataKey.decimals; |
|||
} |
|||
if (centerValueDataKey?.units) { |
|||
units = centerValueDataKey.units; |
|||
} |
|||
return formatValue(25, decimals, units, true); |
|||
} else { |
|||
return '225°'; |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,102 @@ |
|||
<!-- |
|||
|
|||
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. |
|||
|
|||
--> |
|||
<ng-container [formGroup]="windSpeedDirectionWidgetSettingsForm"> |
|||
<div class="tb-form-panel"> |
|||
<div class="tb-form-panel-title" translate>widgets.wind-speed-direction.wind-speed-direction-card-style</div> |
|||
<tb-image-cards-select rowHeight="1:1" |
|||
cols="3" |
|||
colsLtMd="2" |
|||
label="{{ 'widgets.wind-speed-direction.layout' | translate }}" formControlName="layout"> |
|||
<tb-image-cards-select-option *ngFor="let layout of windSpeedDirectionLayouts" |
|||
[value]="layout" |
|||
[image]="windSpeedDirectionLayoutImageMap.get(layout)"> |
|||
{{ windSpeedDirectionLayoutTranslationMap.get(layout) | translate }} |
|||
</tb-image-cards-select-option> |
|||
</tb-image-cards-select> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ (hasCenterValue ? 'widgets.wind-speed-direction.center-value' : 'widgets.wind-speed-direction.wind-direction') | translate }}</div> |
|||
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<tb-font-settings formControlName="centerValueFont" |
|||
[autoScale]="true" |
|||
[initialPreviewStyle]="{ color: windSpeedDirectionWidgetSettingsForm.get('centerValueColor').value?.color }" |
|||
[previewText]="centerValuePreviewFn"> |
|||
</tb-font-settings> |
|||
<tb-color-settings formControlName="centerValueColor"> |
|||
</tb-color-settings> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.ticks-color' | translate }}</div> |
|||
<tb-color-input asBoxInput |
|||
formControlName="ticksColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.ticks-labels-type' | translate }}</div> |
|||
<mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic"> |
|||
<mat-select formControlName="directionalNamesElseDegrees"> |
|||
<mat-option [value]="true"> |
|||
{{ 'widgets.wind-speed-direction.directional-names' | translate }} |
|||
</mat-option> |
|||
<mat-option [value]="false"> |
|||
{{ 'widgets.wind-speed-direction.degrees' | translate }} |
|||
</mat-option> |
|||
</mat-select> |
|||
</mat-form-field> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.major-ticks' | translate }}</div> |
|||
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<tb-font-settings [fxShow]="majorTicksFontEnabled" |
|||
formControlName="majorTicksFont" |
|||
[initialPreviewStyle]="{ color: windSpeedDirectionWidgetSettingsForm.get('majorTicksColor').value }" |
|||
[autoScale]="true" |
|||
previewText="N E S W"> |
|||
</tb-font-settings> |
|||
<tb-color-input asBoxInput |
|||
formControlName="majorTicksColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.minor-ticks' | translate }}</div> |
|||
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|||
<tb-font-settings [fxShow]="minorTicksFontEnabled" |
|||
formControlName="minorTicksFont" |
|||
[initialPreviewStyle]="{ color: windSpeedDirectionWidgetSettingsForm.get('minorTicksColor').value }" |
|||
[autoScale]="true" |
|||
previewText="NE SE SW NW"> |
|||
</tb-font-settings> |
|||
<tb-color-input asBoxInput |
|||
formControlName="minorTicksColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.wind-speed-direction.arrow-color' | translate }}</div> |
|||
<tb-color-input asBoxInput |
|||
formControlName="arrowColor"> |
|||
</tb-color-input> |
|||
</div> |
|||
<div class="tb-form-row space-between"> |
|||
<div>{{ 'widgets.background.background' | translate }}</div> |
|||
<tb-background-settings formControlName="background"> |
|||
</tb-background-settings> |
|||
</div> |
|||
</div> |
|||
</ng-container> |
|||
@ -0,0 +1,139 @@ |
|||
///
|
|||
/// 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, Injector } from '@angular/core'; |
|||
import { WidgetSettings, WidgetSettingsComponent } from '@shared/models/widget.models'; |
|||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; |
|||
import { Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { formatValue, isDefinedAndNotNull } from '@core/utils'; |
|||
import { |
|||
centerValueLabel, |
|||
windSpeedDirectionDefaultSettings, |
|||
WindSpeedDirectionLayout, |
|||
windSpeedDirectionLayoutImages, |
|||
windSpeedDirectionLayouts, |
|||
windSpeedDirectionLayoutTranslations |
|||
} from '@home/components/widget/lib/weather/wind-speed-direction-widget.models'; |
|||
import { getDataKeyByLabel } from '@shared/models/widget-settings.models'; |
|||
|
|||
@Component({ |
|||
selector: 'tb-wind-speed-direction-widget-settings', |
|||
templateUrl: './wind-speed-direction-widget-settings.component.html', |
|||
styleUrls: [] |
|||
}) |
|||
export class WindSpeedDirectionWidgetSettingsComponent extends WidgetSettingsComponent { |
|||
|
|||
get hasCenterValue(): boolean { |
|||
return !!getDataKeyByLabel(this.widgetConfig.config.datasources, centerValueLabel); |
|||
} |
|||
|
|||
get majorTicksFontEnabled(): boolean { |
|||
const layout: WindSpeedDirectionLayout = this.windSpeedDirectionWidgetSettingsForm.get('layout').value; |
|||
return [ WindSpeedDirectionLayout.default, WindSpeedDirectionLayout.advanced ].includes(layout); |
|||
} |
|||
|
|||
get minorTicksFontEnabled(): boolean { |
|||
const layout: WindSpeedDirectionLayout = this.windSpeedDirectionWidgetSettingsForm.get('layout').value; |
|||
return layout === WindSpeedDirectionLayout.advanced; |
|||
} |
|||
|
|||
windSpeedDirectionLayouts = windSpeedDirectionLayouts; |
|||
|
|||
windSpeedDirectionLayoutTranslationMap = windSpeedDirectionLayoutTranslations; |
|||
windSpeedDirectionLayoutImageMap = windSpeedDirectionLayoutImages; |
|||
|
|||
windSpeedDirectionWidgetSettingsForm: UntypedFormGroup; |
|||
|
|||
centerValuePreviewFn = this._centerValuePreviewFn.bind(this); |
|||
|
|||
constructor(protected store: Store<AppState>, |
|||
private $injector: Injector, |
|||
private fb: UntypedFormBuilder) { |
|||
super(store); |
|||
} |
|||
|
|||
protected settingsForm(): UntypedFormGroup { |
|||
return this.windSpeedDirectionWidgetSettingsForm; |
|||
} |
|||
|
|||
protected defaultSettings(): WidgetSettings { |
|||
return {...windSpeedDirectionDefaultSettings}; |
|||
} |
|||
|
|||
protected onSettingsSet(settings: WidgetSettings) { |
|||
this.windSpeedDirectionWidgetSettingsForm = this.fb.group({ |
|||
layout: [settings.layout, []], |
|||
|
|||
centerValueFont: [settings.centerValueFont, []], |
|||
centerValueColor: [settings.centerValueColor, []], |
|||
|
|||
ticksColor: [settings.ticksColor, []], |
|||
directionalNamesElseDegrees: [settings.directionalNamesElseDegrees, []], |
|||
|
|||
majorTicksFont: [settings.majorTicksFont, []], |
|||
majorTicksColor: [settings.majorTicksColor, []], |
|||
|
|||
minorTicksFont: [settings.minorTicksFont, []], |
|||
minorTicksColor: [settings.minorTicksColor, []], |
|||
|
|||
arrowColor: [settings.arrowColor, []], |
|||
|
|||
background: [settings.background, []] |
|||
}); |
|||
} |
|||
|
|||
protected validatorTriggers(): string[] { |
|||
return ['layout']; |
|||
} |
|||
|
|||
protected updateValidators(emitEvent: boolean) { |
|||
const layout: WindSpeedDirectionLayout = this.windSpeedDirectionWidgetSettingsForm.get('layout').value; |
|||
|
|||
const majorTicksFontEnabled = [ WindSpeedDirectionLayout.default, WindSpeedDirectionLayout.advanced ].includes(layout); |
|||
const minorTicksFontEnabled = layout === WindSpeedDirectionLayout.advanced; |
|||
|
|||
if (majorTicksFontEnabled) { |
|||
this.windSpeedDirectionWidgetSettingsForm.get('majorTicksFont').enable(); |
|||
} else { |
|||
this.windSpeedDirectionWidgetSettingsForm.get('majorTicksFont').disable(); |
|||
} |
|||
|
|||
if (minorTicksFontEnabled) { |
|||
this.windSpeedDirectionWidgetSettingsForm.get('minorTicksFont').enable(); |
|||
} else { |
|||
this.windSpeedDirectionWidgetSettingsForm.get('minorTicksFont').disable(); |
|||
} |
|||
} |
|||
|
|||
private _centerValuePreviewFn(): string { |
|||
const centerValueDataKey = getDataKeyByLabel(this.widgetConfig.config.datasources, centerValueLabel); |
|||
if (centerValueDataKey) { |
|||
let units: string = this.widgetConfig.config.units; |
|||
let decimals: number = this.widgetConfig.config.decimals; |
|||
if (isDefinedAndNotNull(centerValueDataKey?.decimals)) { |
|||
decimals = centerValueDataKey.decimals; |
|||
} |
|||
if (centerValueDataKey?.units) { |
|||
units = centerValueDataKey.units; |
|||
} |
|||
return formatValue(25, decimals, units, true); |
|||
} else { |
|||
return '225°'; |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
<!-- |
|||
|
|||
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. |
|||
|
|||
--> |
|||
<div class="tb-wind-speed-direction-panel" [style]="backgroundStyle" [class.tb-wind-speed-direction-pointer]="hasCardClickAction" (click)="cardClick($event)"> |
|||
<div class="tb-wind-speed-direction-overlay" [style]="overlayStyle"></div> |
|||
<ng-container *ngTemplateOutlet="widgetTitlePanel"></ng-container> |
|||
<div class="tb-wind-speed-direction-content"> |
|||
<div #windSpeedDirectionShape class="tb-wind-speed-direction-shape"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,49 @@ |
|||
/** |
|||
* 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-wind-speed-direction-panel { |
|||
width: 100%; |
|||
height: 100%; |
|||
position: relative; |
|||
display: flex; |
|||
flex-direction: column; |
|||
gap: 16px; |
|||
padding: 24px; |
|||
&.tb-wind-speed-direction-pointer { |
|||
cursor: pointer; |
|||
} |
|||
> div:not(.tb-wind-speed-direction-overlay) { |
|||
z-index: 1; |
|||
} |
|||
.tb-wind-speed-direction-overlay { |
|||
position: absolute; |
|||
top: 12px; |
|||
left: 12px; |
|||
bottom: 12px; |
|||
right: 12px; |
|||
} |
|||
.tb-wind-speed-direction-content { |
|||
flex: 1; |
|||
min-width: 0; |
|||
min-height: 0; |
|||
.tb-wind-speed-direction-shape { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,333 @@ |
|||
///
|
|||
/// 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 { |
|||
AfterViewInit, |
|||
ChangeDetectorRef, |
|||
Component, |
|||
ElementRef, |
|||
Input, |
|||
OnDestroy, |
|||
OnInit, |
|||
Renderer2, |
|||
TemplateRef, |
|||
ViewChild, ViewEncapsulation |
|||
} from '@angular/core'; |
|||
import { WidgetContext } from '@home/models/widget-component.models'; |
|||
import { |
|||
centerValueLabel, |
|||
windDirectionLabel, |
|||
windSpeedDirectionDefaultSettings, |
|||
WindSpeedDirectionLayout, |
|||
WindSpeedDirectionWidgetSettings |
|||
} from '@home/components/widget/lib/weather/wind-speed-direction-widget.models'; |
|||
import { |
|||
backgroundStyle, |
|||
ColorProcessor, |
|||
ComponentStyle, |
|||
Font, getDataKey, |
|||
getDataKeyByLabel, |
|||
getSingleTsValueByDataKey, |
|||
overlayStyle |
|||
} from '@shared/models/widget-settings.models'; |
|||
import { WidgetComponent } from '@home/components/widget/widget.component'; |
|||
import { formatValue, isDefinedAndNotNull, isNumeric } from '@core/utils'; |
|||
import { ResizeObserver } from '@juggle/resize-observer'; |
|||
import { Path, Svg, SVG, Text } from '@svgdotjs/svg.js'; |
|||
import { DataKey } from '@shared/models/widget.models'; |
|||
|
|||
const shapeSize = 180; |
|||
const cx = shapeSize / 2; |
|||
const cy = shapeSize / 2; |
|||
const ticksDiameter = 140; |
|||
|
|||
const ticksTextMap: {[angle: number]: string} = { |
|||
0: 'N', |
|||
45: 'NE', |
|||
90: 'E', |
|||
135: 'SE', |
|||
180: 'S', |
|||
225: 'SW', |
|||
270: 'W', |
|||
315: 'NW' |
|||
}; |
|||
|
|||
@Component({ |
|||
selector: 'tb-wind-speed-direction-widget', |
|||
templateUrl: './wind-speed-direction-widget.component.html', |
|||
styleUrls: ['./wind-speed-direction-widget.component.scss'], |
|||
encapsulation: ViewEncapsulation.None |
|||
}) |
|||
export class WindSpeedDirectionWidgetComponent implements OnInit, OnDestroy, AfterViewInit { |
|||
|
|||
@ViewChild('windSpeedDirectionShape', {static: false}) |
|||
windSpeedDirectionShape: ElementRef<HTMLElement>; |
|||
|
|||
settings: WindSpeedDirectionWidgetSettings; |
|||
|
|||
@Input() |
|||
ctx: WidgetContext; |
|||
|
|||
@Input() |
|||
widgetTitlePanel: TemplateRef<any>; |
|||
|
|||
layout: WindSpeedDirectionLayout; |
|||
|
|||
centerValueColor: ColorProcessor; |
|||
|
|||
backgroundStyle: ComponentStyle = {}; |
|||
overlayStyle: ComponentStyle = {}; |
|||
|
|||
shapeResize$: ResizeObserver; |
|||
|
|||
hasCardClickAction = false; |
|||
|
|||
private decimals = 0; |
|||
private units = ''; |
|||
|
|||
private drawSvgShapePending = false; |
|||
private svgShape: Svg; |
|||
private arrow: Path; |
|||
private centerValueTextNode: Text; |
|||
|
|||
private windDirectionDataKey: DataKey; |
|||
private centerValueDataKey: DataKey; |
|||
|
|||
private windDirection = 0; |
|||
private centerValueText = 'N/A'; |
|||
|
|||
constructor(private widgetComponent: WidgetComponent, |
|||
private renderer: Renderer2, |
|||
private cd: ChangeDetectorRef) { |
|||
} |
|||
|
|||
ngOnInit(): void { |
|||
this.ctx.$scope.windSpeedDirectionWidget = this; |
|||
this.settings = {...windSpeedDirectionDefaultSettings, ...this.ctx.settings}; |
|||
|
|||
this.windDirectionDataKey = getDataKeyByLabel(this.ctx.datasources, windDirectionLabel); |
|||
if (!this.windDirectionDataKey) { |
|||
this.windDirectionDataKey = getDataKey(this.ctx.datasources); |
|||
} |
|||
this.centerValueDataKey = getDataKeyByLabel(this.ctx.datasources, centerValueLabel); |
|||
|
|||
if (this.centerValueDataKey) { |
|||
this.decimals = this.ctx.decimals; |
|||
this.units = this.ctx.units; |
|||
if (isDefinedAndNotNull(this.centerValueDataKey.decimals)) { |
|||
this.decimals = this.centerValueDataKey.decimals; |
|||
} |
|||
if (this.centerValueDataKey.units) { |
|||
this.units = this.centerValueDataKey.units; |
|||
} |
|||
} |
|||
|
|||
this.layout = this.settings.layout; |
|||
|
|||
this.centerValueColor = ColorProcessor.fromSettings(this.settings.centerValueColor); |
|||
|
|||
this.backgroundStyle = backgroundStyle(this.settings.background); |
|||
this.overlayStyle = overlayStyle(this.settings.background.overlay); |
|||
|
|||
this.hasCardClickAction = this.ctx.actionsApi.getActionDescriptors('cardClick').length > 0; |
|||
} |
|||
|
|||
ngAfterViewInit() { |
|||
if (this.drawSvgShapePending) { |
|||
this.drawSvg(); |
|||
} |
|||
} |
|||
|
|||
ngOnDestroy() { |
|||
if (this.shapeResize$) { |
|||
this.shapeResize$.disconnect(); |
|||
} |
|||
} |
|||
|
|||
public onInit() { |
|||
const borderRadius = this.ctx.$widgetElement.css('borderRadius'); |
|||
this.overlayStyle = {...this.overlayStyle, ...{borderRadius}}; |
|||
if (this.windSpeedDirectionShape) { |
|||
this.drawSvg(); |
|||
} else { |
|||
this.drawSvgShapePending = true; |
|||
} |
|||
this.cd.detectChanges(); |
|||
} |
|||
|
|||
public onDataUpdated() { |
|||
let centerValue = 0; |
|||
this.windDirection = 0; |
|||
this.centerValueText = 'N/A'; |
|||
const windDirectionTsValue = getSingleTsValueByDataKey(this.ctx.data, this.windDirectionDataKey); |
|||
if (windDirectionTsValue && isDefinedAndNotNull(windDirectionTsValue[1]) && isNumeric(windDirectionTsValue[1])) { |
|||
this.windDirection = windDirectionTsValue[1]; |
|||
} |
|||
if (this.centerValueDataKey) { |
|||
const centerValueTsValue = getSingleTsValueByDataKey(this.ctx.data, this.centerValueDataKey); |
|||
if (centerValueTsValue && isDefinedAndNotNull(centerValueTsValue[1]) && isNumeric(centerValueTsValue[1])) { |
|||
centerValue = centerValueTsValue[1]; |
|||
this.centerValueText = formatValue(centerValue, this.decimals, '', true); |
|||
} |
|||
} |
|||
this.centerValueColor.update(centerValue); |
|||
this.renderValues(); |
|||
} |
|||
|
|||
public cardClick($event: Event) { |
|||
this.ctx.actionsApi.cardClick($event); |
|||
} |
|||
|
|||
private drawSvg() { |
|||
this.svgShape = SVG().addTo(this.windSpeedDirectionShape.nativeElement).size(shapeSize, shapeSize); |
|||
this.renderer.setStyle(this.svgShape.node, 'overflow', 'visible'); |
|||
this.renderer.setStyle(this.svgShape.node, 'user-select', 'none'); |
|||
|
|||
// Draw ticks
|
|||
|
|||
const ticksYStart = (shapeSize - ticksDiameter) / 2; |
|||
for (let i = 0; i < 360; i += 3) { |
|||
if (i !== 0) { |
|||
let color: string; |
|||
let width: number; |
|||
let height: number; |
|||
if (i % 90 === 0) { |
|||
// Major ticks
|
|||
color = this.settings.majorTicksColor; |
|||
width = 2; |
|||
height = 8; |
|||
} else if (i % 45 === 0) { |
|||
// Minor ticks
|
|||
color = this.settings.minorTicksColor; |
|||
width = 2; |
|||
height = 8; |
|||
} else { |
|||
color = this.settings.ticksColor; |
|||
width = 1.2; |
|||
height = 3; |
|||
} |
|||
this.svgShape.line(cx, ticksYStart, cx, ticksYStart + height).attr({ |
|||
'stroke-width': width, |
|||
stroke: color |
|||
}).rotate(i, cx, cy); |
|||
} |
|||
} |
|||
|
|||
// Draw pointer
|
|||
this.svgShape.path('m 89.152,20.470002 c 0.3917,-0.626669 1.3043,-0.626669 1.696,0 l 3.1958,5.1132 ' + |
|||
'c 0.4162,0.66605 -0.0626,1.53 -0.848,1.53 h -6.3916 c -0.7854,0 -1.2642,-0.86395 -0.848,-1.53 z') |
|||
.fill(this.settings.majorTicksColor); |
|||
|
|||
let x: number; |
|||
let y: number; |
|||
let degree: number; |
|||
|
|||
const drawMajorTicksText = [ WindSpeedDirectionLayout.default, WindSpeedDirectionLayout.advanced ].includes(this.settings.layout); |
|||
const drawMinorTicksText = this.settings.layout === WindSpeedDirectionLayout.advanced; |
|||
|
|||
if (drawMajorTicksText) { |
|||
// Draw major ticks text
|
|||
for (let i = 0; i < 4; i += 1) { |
|||
degree = i * 90; |
|||
if (i % 2 === 0) { |
|||
x = cx; |
|||
y = i === 0 ? 10 : shapeSize - 10; |
|||
} else { |
|||
y = cy; |
|||
x = i === 3 ? 10 : shapeSize - 10; |
|||
} |
|||
this.drawTickText(degree, this.settings.majorTicksFont, this.settings.majorTicksColor, x, y); |
|||
} |
|||
} |
|||
|
|||
if (drawMinorTicksText) { |
|||
// Draw minor ticks text
|
|||
for (let i = 0; i < 4; i += 1) { |
|||
degree = 45 + (i * 90); |
|||
if (i < 2) { |
|||
x = shapeSize - 30; |
|||
y = i === 0 ? 30 : shapeSize - 30; |
|||
} else { |
|||
x = 30; |
|||
y = i === 3 ? 30 : shapeSize - 30; |
|||
} |
|||
this.drawTickText(degree, this.settings.minorTicksFont, this.settings.minorTicksColor, x, y); |
|||
} |
|||
} |
|||
|
|||
// Draw arrow
|
|||
this.arrow = this.svgShape.path('m 89.263587,23.438382 c 0.388942,-0.392146 1.022181,-0.388549 1.414649,0 ' + |
|||
'l 6.389758,6.389 c 0.392414,0.388462 0.394911,1.022828 0.0059,1.415 -0.388987,0.392109 -1.022226,0.383311 -1.41408,-0.006 ' + |
|||
'l -4.6762,-4.676 v 28.417 h -2 v -28.417 l -4.637642,4.676 ' + |
|||
'c -0.388878,0.392069 -1.022053,0.394895 -1.414202,0.006 -0.392082,-0.388967 -0.394683,-1.022852 -0.0057,-1.415 ' + |
|||
'z M 88.983614,154.85438 h -2.217 v 2 h 6.434 v -2 h -2.217 v -29.939 h -2 z').fill(this.settings.arrowColor); |
|||
|
|||
// Draw value
|
|||
this.centerValueTextNode = this.svgShape.text('').font({ |
|||
family: this.settings.centerValueFont.family, |
|||
weight: this.settings.centerValueFont.weight, |
|||
style: this.settings.centerValueFont.style |
|||
}).attr({x: '50%', y: '50%', 'text-anchor': 'middle'}); |
|||
if (!this.units) { |
|||
this.centerValueTextNode.attr({'dominant-baseline': 'middle'}); |
|||
} |
|||
|
|||
this.shapeResize$ = new ResizeObserver(() => { |
|||
this.onResize(); |
|||
}); |
|||
this.shapeResize$.observe(this.windSpeedDirectionShape.nativeElement); |
|||
this.onResize(); |
|||
|
|||
this.renderValues(); |
|||
} |
|||
|
|||
private drawTickText(degree: number, font: Font, color: string, x: number, y: number) { |
|||
const tickText = this.settings.directionalNamesElseDegrees ? ticksTextMap[degree] : degree + ''; |
|||
this.svgShape.text(tickText).font({ |
|||
family: font.family, |
|||
weight: font.weight, |
|||
style: font.style, |
|||
size: this.settings.directionalNamesElseDegrees ? '14px' : '10px' |
|||
}).fill(color).center(x, y); |
|||
} |
|||
|
|||
private renderValues() { |
|||
if (this.svgShape) { |
|||
this.arrow.timeline().finish(); |
|||
this.arrow.animate(800).transform({rotate: this.windDirection}); |
|||
this.renderCenterValueText(); |
|||
} |
|||
} |
|||
|
|||
private renderCenterValueText() { |
|||
const text = this.centerValueDataKey ? this.centerValueText : formatValue(this.windDirection, 0, '') + '°'; |
|||
this.centerValueTextNode.text(add => { |
|||
add.tspan(text).font({size: '24px'}); |
|||
if (this.units) { |
|||
add.tspan(this.units).newLine().font({size: '14px'}); |
|||
} |
|||
}).fill(this.centerValueColor.color); |
|||
} |
|||
|
|||
private onResize() { |
|||
const shapeWidth = this.windSpeedDirectionShape.nativeElement.getBoundingClientRect().width; |
|||
const shapeHeight = this.windSpeedDirectionShape.nativeElement.getBoundingClientRect().height; |
|||
const size = Math.min(shapeWidth, shapeHeight); |
|||
const scale = size / shapeSize; |
|||
this.renderer.setStyle(this.svgShape.node, 'transform', `scale(${scale})`); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,108 @@ |
|||
///
|
|||
/// 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 { BatteryLevelLayout } from '@home/components/widget/lib/indicator/battery-level-widget.models'; |
|||
import { |
|||
BackgroundSettings, |
|||
BackgroundType, |
|||
ColorSettings, |
|||
constantColor, |
|||
Font |
|||
} from '@shared/models/widget-settings.models'; |
|||
|
|||
export enum WindSpeedDirectionLayout { |
|||
default = 'default', |
|||
advanced = 'advanced', |
|||
simplified = 'simplified' |
|||
} |
|||
|
|||
export const windSpeedDirectionLayouts = Object.keys(WindSpeedDirectionLayout) as WindSpeedDirectionLayout[]; |
|||
|
|||
export const windSpeedDirectionLayoutTranslations = new Map<WindSpeedDirectionLayout, string>( |
|||
[ |
|||
[WindSpeedDirectionLayout.default, 'widgets.wind-speed-direction.layout-default'], |
|||
[WindSpeedDirectionLayout.advanced, 'widgets.wind-speed-direction.layout-advanced'], |
|||
[WindSpeedDirectionLayout.simplified, 'widgets.wind-speed-direction.layout-simplified'] |
|||
] |
|||
); |
|||
|
|||
export const windSpeedDirectionLayoutImages = new Map<WindSpeedDirectionLayout, string>( |
|||
[ |
|||
[WindSpeedDirectionLayout.default, 'assets/widget/wind-speed-direction/default-layout.svg'], |
|||
[WindSpeedDirectionLayout.advanced, 'assets/widget/wind-speed-direction/advanced-layout.svg'], |
|||
[WindSpeedDirectionLayout.simplified, 'assets/widget/wind-speed-direction/simplified-layout.svg'] |
|||
] |
|||
); |
|||
|
|||
export interface WindSpeedDirectionWidgetSettings { |
|||
layout: WindSpeedDirectionLayout; |
|||
centerValueFont: Font; |
|||
centerValueColor: ColorSettings; |
|||
ticksColor: string; |
|||
arrowColor: string; |
|||
directionalNamesElseDegrees: boolean; |
|||
majorTicksColor: string; |
|||
majorTicksFont: Font; |
|||
minorTicksColor: string; |
|||
minorTicksFont: Font; |
|||
background: BackgroundSettings; |
|||
} |
|||
|
|||
export const windSpeedDirectionDefaultSettings: WindSpeedDirectionWidgetSettings = { |
|||
layout: WindSpeedDirectionLayout.default, |
|||
centerValueFont: { |
|||
family: 'Roboto', |
|||
size: 24, |
|||
sizeUnit: 'px', |
|||
style: 'normal', |
|||
weight: '500', |
|||
lineHeight: '32px' |
|||
}, |
|||
centerValueColor: constantColor('rgba(0, 0, 0, 0.87)'), |
|||
ticksColor: 'rgba(0, 0, 0, 0.12)', |
|||
arrowColor: 'rgba(0, 0, 0, 0.87)', |
|||
directionalNamesElseDegrees: true, |
|||
majorTicksColor: 'rgba(158, 158, 158, 1)', |
|||
majorTicksFont: { |
|||
family: 'Roboto', |
|||
size: 14, |
|||
sizeUnit: 'px', |
|||
style: 'normal', |
|||
weight: '500', |
|||
lineHeight: '20px' |
|||
}, |
|||
minorTicksColor: 'rgba(0, 0, 0, 0.12)', |
|||
minorTicksFont: { |
|||
family: 'Roboto', |
|||
size: 14, |
|||
sizeUnit: 'px', |
|||
style: 'normal', |
|||
weight: '500', |
|||
lineHeight: '20px' |
|||
}, |
|||
background: { |
|||
type: BackgroundType.color, |
|||
color: '#fff', |
|||
overlay: { |
|||
enabled: false, |
|||
color: 'rgba(255,255,255,0.72)', |
|||
blur: 3 |
|||
} |
|||
} |
|||
}; |
|||
|
|||
export const windDirectionLabel = 'windDirection'; |
|||
export const centerValueLabel = 'centerValue'; |
|||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 13 KiB |
Loading…
Reference in new issue