/// <summary>
        /// 邻频
        /// </summary>
        /// <param name="adjInterfResult"></param>
        /// <returns></returns>
        internal List <InterferedBindingData> GetBindingData(AdjFreqCompareResult[] adjInterfResult)
        {
            List <InterferedBindingData> bindingDatas = new List <InterferedBindingData>();

            foreach (AdjFreqCompareResult rst in adjInterfResult)
            {
                foreach (var freqinfo in rst.Keys)
                {
                    InterferedBindingData bindingData = new InterferedBindingData()
                    {
                        InterferedType = "邻频干扰"
                    };
                    List <ComparableFreq> allAdjFreqlist = new List <ComparableFreq>();
                    allAdjFreqlist.AddRange(rst.UpperAdjFreqs);
                    allAdjFreqlist.AddRange(rst.LowerAdjFreqs);
                    ComparableFreq adjFreq = allAdjFreqlist.Where(p => p.FreqID == freqinfo.FreqID).SingleOrDefault();
                    bindingData.InterferedBand = adjFreq.Band.ToString();
                    bindingData.InterferedFreq = adjFreq.Freq.ToString();
                    if (LoadBaseBindingData(bindingData, freqinfo.FreqID))
                    {
                        bindingDatas.Add(bindingData);
                    }
                }
            }
            return(bindingDatas);
        }
        /// <summary>
        /// 其他干扰信息
        /// </summary>
        /// <param name="Interfother"></param>
        /// <returns></returns>
        private InterfereObject CreateInterfObjectFromOther(ComparableFreq Interfother)
        {
            InterfereObject intobject = new InterfereObject();

            intobject.Guid = Interfother.FreqID;
            intobject.Name = "其他干扰";
            intobject.Type = InterfereObjectEnum.其他;
            intobject.Freq = Interfother.Freq;
            intobject.Band = Interfother.Band;
            return(intobject);
        }
        /// <summary>
        /// 同频
        /// </summary>
        /// <param name="sameResult"></param>
        /// <returns></returns>
        internal List <InterferedBindingData> GetBindingData(SameFreqCompareResult sameResult)
        {
            List <InterferedBindingData> bindingDatas = new List <InterferedBindingData>();

            foreach (ComparableFreq freqinfo in sameResult.Keys)
            {
                //freqinfo.FreqID
                InterferedBindingData bindingData = new InterferedBindingData()
                {
                    InterferedType = "同频干扰"
                };
                List <ComparableFreq> list           = sameResult.Values.Where(p => p.FreqID == freqinfo.FreqID).ToList();
                ComparableFreq        comparableFreq = sameResult.Values.Where(p => p.FreqID == freqinfo.FreqID).SingleOrDefault();
                bindingData.InterferedBand = comparableFreq.Band.ToString();
                bindingData.InterferedFreq = comparableFreq.Freq.ToString();
                if (LoadBaseBindingData(bindingData, freqinfo.FreqID))
                {
                    bindingDatas.Add(bindingData);
                }
            }
            return(bindingDatas);
        }
        /// <summary>
        /// 取非法信号干扰信息
        /// </summary>
        /// <param name="illsignal"></param>
        /// <param name="freq"></param>
        /// <returns></returns>
        private InterfereObject CreateInterfObjectFromSignal(AnalysisResult illsignal, ComparableFreq freq)
        {
            InterfereObject intosignal = new InterfereObject();

            intosignal.Guid = illsignal.Id;
            intosignal.Name = illsignal.EquimentName;
            intosignal.Type = InterfereObjectEnum.非法信号;
            intosignal.Freq = freq.Freq;
            intosignal.Band = freq.Band;
            return(intosignal);
        }
        /// <summary>
        /// 取台站干扰信息
        /// </summary>
        /// <param name="Interfstation"></param>
        /// <returns></returns>
        private InterfereObject CreateInterfObjectFromStation(RoundStationInfo Interfstation, ComparableFreq freq)
        {
            InterfereObject intobject = new InterfereObject();

            intobject.Guid = Interfstation.STATGUID;
            intobject.Name = Interfstation.STAT_NAME;
            intobject.Type = InterfereObjectEnum.周围台站;
            intobject.Freq = freq.Freq;
            intobject.Band = freq.Band;
            return(intobject);
        }
        /// <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);
        }
示例#7
0
        /// <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);
        }