Ejemplo n.º 1
0
        public void AddOrUpdateRadio(Guid unitKeyId, Guid agencyKeyId, string signalingFormat, string signalingUnitId, string radioName, string roleName, string personnelName, RadioTypeCode radioType, bool excludeFromRollCall)
        {
            if (string.IsNullOrWhiteSpace(signalingUnitId) || string.IsNullOrWhiteSpace(signalingFormat))
            {
                return;
            }
            string strKey = RadioInfo.GenerateLookupKey(signalingFormat, signalingUnitId);

            if (_radios.ContainsKey(strKey))
            {
                _radios[strKey].UnitKeyId           = unitKeyId;
                _radios[strKey].AgencyKeyId         = agencyKeyId;
                _radios[strKey].SignalingFormat     = signalingFormat;
                _radios[strKey].SignalingUnitId     = signalingUnitId;
                _radios[strKey].RadioName           = radioName;
                _radios[strKey].RoleName            = roleName;
                _radios[strKey].PersonnelName       = personnelName;
                _radios[strKey].RadioType           = radioType;
                _radios[strKey].ExcludeFromRollCall = excludeFromRollCall;
            }
            else
            {
                _radios[strKey] = new RadioInfo(unitKeyId, agencyKeyId, signalingFormat, signalingUnitId, radioName, roleName, personnelName, radioType, "MANUAL ENTRY", excludeFromRollCall);
            }
            MarkChangesMade();
        }
Ejemplo n.º 2
0
        public RadioInfo GetRadioInfoFromSignalingItem(RadioSignalingItem sigItem)
        {
            if (sigItem == null || string.IsNullOrWhiteSpace(sigItem.UnitId) || sigItem.SourceType == SignalingSourceType.StreamingTag)
            {
                return(null);
            }
            string radioLookupKey = RadioInfo.GenerateLookupKey(sigItem.SignalingFormat, sigItem.UnitId);

            if (_radios.ContainsKey(radioLookupKey))
            {
                return(_radios[radioLookupKey]);
            }
            return(null);
        }