alarms/alarms-view.service.ts
Service for managing and retrieving alarms data within the alarms view.
The AlarmsViewService
provides functionality to interact with alarms,
including filtering, counting, and translation-related operations in an alarms view.
This service relies on the AlarmService
for fetching alarm data and the OptionsService
for configuring alarms view options.
Properties |
|
Methods |
constructor(alarmService: AlarmService, optionsService: OptionsService)
|
|||||||||
Parameters :
|
Async getAlarmsCountBySeverity | ||||||||||||||||
getAlarmsCountBySeverity(severity: SeverityType, showCleared: boolean, filter?: AlarmQueryFilter)
|
||||||||||||||||
Fetches the count of alarms filtered by severity and clearance status.
Parameters :
Returns :
Promise<number>
A promise that resolves to the number of alarms that match the filter criteria. |
getRouterLink | ||||||||||||
getRouterLink(contextData?: ContextData, alarm?: IAlarm)
|
||||||||||||
Returns the correct link based on the provided context data.
Parameters :
Returns :
string
A link to be used as an url navigation. |
getRouterNavigationArray | ||||||||||||
getRouterNavigationArray(contextData?: ContextData, alarm?: IAlarm)
|
||||||||||||
Returns the correct array navigation.
Parameters :
Returns :
string[]
A link to be used as a router.navigation. |
isIntervalRefresh |
isIntervalRefresh()
|
Retrieves the current alarms refresh type from the OptionsService and determines whether it is set to "interval".
Returns :
boolean
|
retrieveAlarmsByDate | ||||||
retrieveAlarmsByDate(dates: DateTimeContext)
|
||||||
Parameters :
Returns :
any
|
retrieveFilteredAlarms | |||||||||||||||||||||||||
retrieveFilteredAlarms(severities: SeverityType[], showCleared, selectedDates?: [Date, Date], filter?: AlarmQueryFilter)
|
|||||||||||||||||||||||||
Retrieves a list of alarms filtered by specified severities and other optional query filters.
Parameters :
Returns :
Promise<IResultList<IAlarm>>
A promise that resolves to a list of alarms satisfying the specified filters. |
updateAlarmList |
updateAlarmList()
|
Emits a subject to initialize the alarms reloading.
Returns :
void
|
updateIntervalState | ||||||||
updateIntervalState(value: boolean)
|
||||||||
Updates the state to enable or disable intervals.
Parameters :
Returns :
void
|
updateSelectedSeverities | ||||||||
updateSelectedSeverities(severityUpdates: SeverityFilter)
|
||||||||
Updates the list of selected severities based on the new severity filter.
Parameters :
Returns :
SeverityType[]
An array representing the updated selected severities. |
Readonly ALARM_REFRESH_TYPE_KEY |
Default value : 'alarmsRefreshType'
|
Readonly DEFAULT_INTERVAL_VALUE |
Type : number
|
Default value : 30_000
|
Readonly DEFAULT_INTERVAL_VALUES |
Type : []
|
Default value : [5_000, 10_000, 15_000, 30_000, 60_000]
|
Readonly DEFAULT_REFRESH_OPTION_VALUE |
Type : string
|
Default value : 'interval'
|
isIntervalEnabled$ |
Type : Observable<boolean>
|
Readonly REALTIME_UPDATE_ALARMS_MESSAGE |
Default value : gettext('The list was updated, click to refresh.')
|
reloadAlarmsList$ |
Default value : new Subject<void>()
|