Exemple #1
0
 internal static void MarkAllEmergenciesCleared()
 {
     foreach (EmergencyRadioSignalItemModel emerModel in _emergencyRadioLog.Where(e => e.EmergencyState == Common.EmergencyState.EmergencyActive))
     {
         ClearMaydayForRadio(emerModel);
     }
 }
Exemple #2
0
        internal static void StartMaydayForRadio(string signalingLookupKey)
        {
            if (string.IsNullOrWhiteSpace(signalingLookupKey))
            {
                return;
            }
            RadioSignalItemModel rItemModel = _radioLog.FirstOrDefault(r => r.SignalingLookupKey == signalingLookupKey);

            if (rItemModel == null)
            {
                return;
            }
            EmergencyRadioSignalItemModel mdl = _emergencyRadioLog.FirstOrDefault(r => r.SignalingLookupKey == signalingLookupKey);

            if (mdl != null)
            {
                mdl.EmergencyState = Common.EmergencyState.EmergencyActive;
                mdl.StartedDT      = DateTime.Now;
                mdl.EndedDT        = null;
            }
            else
            {
                mdl = new EmergencyRadioSignalItemModel(rItemModel.RawSignalItem);
                mdl.EmergencyState = Common.EmergencyState.EmergencyActive;
                mdl.StartedDT      = DateTime.Now;
                mdl.EndedDT        = null;
                if (_emergencyRadioLog.Count > 0)
                {
                    _emergencyRadioLog.Insert(0, mdl);
                }
                else
                {
                    _emergencyRadioLog.Add(mdl);
                }
            }
            foreach (RadioSignalItemModel rItem in _radioLog.Where(r => r.SignalingLookupKey == signalingLookupKey))
            {
                rItem.EmergencyState = Common.EmergencyState.EmergencyActive;
            }
        }