private void CleanQueries() { var emptyAlarms = new Alarm[0]; foreach (var c in _categories.Values) { foreach (var t in c.QueriesForCurrent()) { t.Item4(emptyAlarms); } foreach (var t in c.QueriesForHistory()) { t.Item4(emptyAlarms); } } if (_lastInfo != null) { foreach (var t in _lastInfo.CommonCurrentInfo) { t.Item1(emptyAlarms); } foreach (var t in _lastInfo.CommonHistoryInfo) { t.Item1(emptyAlarms); } foreach (var p in _lastInfo.Parameters) { foreach (var callback in p.Item2) { callback(emptyAlarms); } foreach (var callback in p.Item3) { callback(emptyAlarms); } } _lastInfo = null; } }
private static void ReadHistoryAlarms(RemapAlarmsParameter parameter, RemapAlarmResult result, IAlarmsRunTarget runTarget) { var currentAlarms = new Alarm[parameter.HistoryParameters.Length][]; for (var i = 0; i < parameter.HistoryParameters.Length; i++) { var curPar = parameter.HistoryParameters[i]; currentAlarms[i] = runTarget.GetHistoryAlarms(curPar.Item1, curPar.Item2, curPar.Item3); } result.History = currentAlarms; }
public void UpdateFrom(Alarm alarm) { EndTime = alarm.EndTime; AcknowledgeTime = alarm.AcknowledgeTime; UserId = alarm.UserId; }
public override void Acknowledge(Alarm[] alarms) { lock (_alarmsToAcknowledge) { _alarmsToAcknowledge.Add(new Tuple<AlarmSampleId[], Identity>( alarms.Select(a => new AlarmSampleId(a.StartTime, a.AlarmId)).ToArray(), _identity())); } }
public AlarmSampleId(Alarm alarm) : this(alarm.StartTime, alarm.AlarmId) { }
public abstract void Acknowledge(Alarm[] alarms);