/// <summary> /// 获取发射机互调 /// </summary> /// <param name="transmResult"></param> /// <returns></returns> private List <IMInterfereResult> GetTransmitterImResult(IMCompareResult transmResult) { List <IMInterfereResult> imInterfresultlst = new List <IMInterfereResult>(); if (transmResult != null) { #region 获取干扰结果 IMItemBase imBase = null; for (int i = 0; i < transmResult.Values.Length; i++) { imBase = transmResult.Values[i]; ActivityEquipmentInfo equ = new ActivityEquipmentInfo(); ComparableFreq imfreq = imBase.IMFreqs[0];//发射互调的干扰频率存在IMFreqs中 equ = _equipments.FirstOrDefault(r => r.GUID == imfreq.FreqID); bool isnewInterfere = true; //新的干扰,不存在dicIMInterfereResult字典中 if (equ != null) { if (this.dicIMInterfereResult.TryGetValue(equ, out imInterfresultlst)) { isnewInterfere = false; } else { isnewInterfere = true; imInterfresultlst = new List <IMInterfereResult>(); } IMInterfereResult iminterfinfo = new IMInterfereResult(); iminterfinfo.InterfType = InterfereTypeEnum.发射机互调干扰; iminterfinfo.InterfOrder = GetIMInterfOrder(imBase.Order); iminterfinfo.Formual = imBase.Formula; iminterfinfo.InterfObject = new List <InterfereObject>(); #region 获取干扰台站 ComparableFreq disfreq = imBase.DisturbedFreqs[0]; //先在设备列表中查找,如果有,则认为干扰物为设备 ActivityEquipmentInfo Interfequ1 = _equipments.FirstOrDefault(r => r.GUID == disfreq.FreqID); InterfereObject interfobject1 = null; if (Interfequ1 != null) { interfobject1 = CreateInterfObjectFromEqu(Interfequ1); } else { //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备 RoundStationInfo Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == disfreq.FreqID); if (Interfstation != null) { interfobject1 = CreateInterfObjectFromStation(Interfstation, disfreq); } else { //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??) interfobject1 = CreateInterfObjectFromOther(imBase.DisturbedFreqs[0]); } } iminterfinfo.InterfObject.Add(interfobject1); //先在设备列表中查找,如果有,则认为干扰物为设备 ActivityEquipmentInfo Interfequ2 = _equipments.FirstOrDefault(r => r.GUID == imBase.IMFreqs[1].FreqID); InterfereObject interfobject2 = null; if (Interfequ2 != null) { interfobject2 = CreateInterfObjectFromEqu(Interfequ2); } else { //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备 RoundStationInfo Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == imBase.IMFreqs[1].FreqID); if (Interfstation != null) { interfobject2 = CreateInterfObjectFromStation(Interfstation, imBase.IMFreqs[1]); } else { //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??) interfobject2 = CreateInterfObjectFromOther(imBase.IMFreqs[1]); } } iminterfinfo.InterfObject.Add(interfobject2); #endregion imInterfresultlst.Add(iminterfinfo); if (isnewInterfere) { this.dicIMInterfereResult.Add(equ, imInterfresultlst); } } } #endregion } return(imInterfresultlst); }
/// <summary> /// 获取接收机互调 /// </summary> /// <param name="receiverResult"></param> /// <returns></returns> private List <IMInterfereResult> GetReceiverImResult(IMCompareResult receiverResult) { List <IMInterfereResult> imInterfresultlst = new List <IMInterfereResult>(); if (receiverResult != null) { #region 获取干扰结果 IMItemBase imBase = null; for (int i = 0; i < receiverResult.Values.Length; i++) { imBase = receiverResult.Values[i]; ActivityEquipment equ = new ActivityEquipment(); ComparableFreq disfreq = imBase.DisturbedFreqs[0]; equ = _equipments.FirstOrDefault(r => r.Key == disfreq.FreqID); bool isnewInterfere = true; //新的干扰,不存在dicIMInterfereResult字典中 if (equ != null) { if (this.dicIMInterfereResult.TryGetValue(equ, out imInterfresultlst)) { isnewInterfere = false; } else { isnewInterfere = true; imInterfresultlst = new List <IMInterfereResult>(); } IMInterfereResult iminterfinfo = new IMInterfereResult(); iminterfinfo.InterfType = InterfereTypeEnum.接收机互调干扰; iminterfinfo.InterfOrder = GetIMInterfOrder(imBase.Order); iminterfinfo.Formual = imBase.Formula; iminterfinfo.InterfObject = new List <InterfereObject>(); #region 获取干扰台站 for (int k = 0; k < imBase.IMFreqs.Length; k++) { ComparableFreq freq = imBase.IMFreqs[k]; //先在设备列表中查找,如果有,则认为干扰物为设备 ActivityEquipment Interfequ = _equipments.FirstOrDefault(r => r.Key == freq.FreqID); InterfereObject interfobject = null; if (Interfequ != null) { interfobject = CreateInterfObjectFromEqu(Interfequ); interfobject.Freq = freq.Freq; //干扰频率有可能是备用频率 } else { //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备 ActivitySurroundStation Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == freq.FreqID); if (Interfstation != null) { interfobject = CreateInterfObjectFromStation(Interfstation, freq); } else { //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??) interfobject = CreateInterfObjectFromOther(freq); } } iminterfinfo.InterfObject.Add(interfobject); } #endregion imInterfresultlst.Add(iminterfinfo); if (isnewInterfere) { this.dicIMInterfereResult.Add(equ, imInterfresultlst); } } } #endregion } return(imInterfresultlst); }