Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public void UpdateFrom(Alarm alarm)
 {
     EndTime = alarm.EndTime;
     AcknowledgeTime = alarm.AcknowledgeTime;
     UserId = alarm.UserId;
 }
Exemplo n.º 4
0
 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()));
     }
 }
Exemplo n.º 5
0
 public AlarmSampleId(Alarm alarm)
     : this(alarm.StartTime, alarm.AlarmId)
 {
 }
Exemplo n.º 6
0
 public abstract void Acknowledge(Alarm[] alarms);