UI: Add alarmFields to AlarmDataQuery

This commit is contained in:
Igor Kulikov 2020-07-09 13:00:02 +03:00
parent 31f0689f63
commit 7343afb876
2 changed files with 7 additions and 0 deletions

View File

@ -91,6 +91,11 @@ export class AlarmDataSubscription {
this.subscriber = new TelemetrySubscriber(this.telemetryService);
this.alarmDataCommand = new AlarmDataCmd();
const alarmFields: Array<EntityKey> =
this.alarmDataSubscriptionOptions.dataKeys.filter(dataKey => dataKey.type === DataKeyType.alarm).map(
dataKey => ({ type: EntityKeyType.ALARM_FIELD, key: dataKey.name })
);
const entityFields: Array<EntityKey> =
this.alarmDataSubscriptionOptions.dataKeys.filter(dataKey => dataKey.type === DataKeyType.entityField).map(
dataKey => ({ type: EntityKeyType.ENTITY_FIELD, key: dataKey.name })
@ -116,6 +121,7 @@ export class AlarmDataSubscription {
entityFilter: this.alarmDataSubscriptionOptions.entityFilter,
pageLink: deepClone(this.alarmDataSubscriptionOptions.pageLink),
keyFilters,
alarmFields,
entityFields,
latestValues
};

View File

@ -556,6 +556,7 @@ export interface EntityDataQuery extends AbstractDataQuery<EntityDataPageLink> {
}
export interface AlarmDataQuery extends AbstractDataQuery<AlarmDataPageLink> {
alarmFields?: Array<EntityKey>;
}
export interface TsValue {