private void OnSimulationAlarmEvent(Cker.Simulator.OnAlarmEventArgs alarm) { CurrentAlarms.Add(alarm); // Keep only the high risk alarm if there is both a low and a high risk alarm for a vessel. if (alarm.type == Simulator.AlarmType.High) { CurrentAlarms.RemoveAll(a1 => a1.type == Simulator.AlarmType.Low && IsAlarmVesselShared(a1, alarm)); } }
/// <summary> /// Current Alarms will be removed from current alarm list but be still available as historical alarms. /// </summary> public void AcknowledgeAlarms() { IEnumerable <Alarm> currentAlarms = CurrentAlarms.ToReadOnly(); if (currentAlarms.IsNullOrEmpty()) { return; } foreach (var plugin in _pluginsSnapshot) { plugin.TryRemoveAlarms(currentAlarms); } foreach (var alarm in currentAlarms) { _historicAlarms.Add(alarm); } AlarmsChanged(); }
private void OnSimulationBeforeUpdateEvent() { // Clear current alarms every update. CurrentAlarms.Clear(); }