/// <summary>
        /// 向结果中增加上邻频信息
        /// </summary>
        /// <param name="freq">参考频率</param>
        /// <param name="disturbFreq">参考频率的上邻频频率</param>
        private void AddLowerAdjCompareResult(ComparableFreq freq, ComparableFreq disturbFreq, string interfdescribe)
        {
            disturbFreq.InterfereResult = interfdescribe;
            AdjFreqCompareResult  result;
            List <ComparableFreq> list;

            if (!this.resultList.TryGetValue(freq, out result))
            {
                if (this.dicFreqMapping.TryGetValue(freq, out list))
                {
                    ComparableFreq[] freqArray = new ComparableFreq[dicFreqMapping[freq].Count + 1];
                    freqArray[0] = freq;
                    dicFreqMapping[freq].CopyTo(freqArray, 1);
                    result = new AdjFreqCompareResult(freqArray);
                }
                else
                {
                    result = new AdjFreqCompareResult(freq);
                }
                this.resultList.Add(freq, result);
            }
            result.AddLowerAdjFreq(disturbFreq);
            if (this.dicFreqMapping.TryGetValue(disturbFreq, out list))
            {
                result.AddLowerAdjFreq(list.ToArray());
            }
        }
Пример #2
0
        /// <summary>
        /// 领频计算
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnAdjFreq_Click(object sender, RoutedEventArgs e)
        {
            adjfreqresult.Text = null;
            AdjFreqCalculator adjfreqCalc = new AdjFreqCalculator(calcFreqs, compareFreqs);

            AdjFreqCompareResult[] adjcompareResult = adjfreqCalc.CalcAdjFreqInterference();
            StringBuilder          strmsg           = new StringBuilder();

            if (adjcompareResult != null && adjcompareResult.Length > 0)
            {
                for (int i = 0; i < adjcompareResult.Length; i++)
                {
                    AdjFreqCompareResult adjresult = adjcompareResult[i];
                    ComparableFreq       ifreq     = adjresult.Keys[0];
                    strmsg.AppendFormat("{0}:受干扰频率:ID:{1},频率:{2},带宽:{3} \r", i + 1, ifreq.FreqID, ifreq.Freq, ifreq.Band);
                    //上邻频干扰
                    if (adjresult.HasUpperAdjFreq)
                    {
                        foreach (ComparableFreq item in adjresult.UpperAdjFreqs)
                        {
                            strmsg.AppendFormat("上邻频干扰:ID:{0},频率:{1},带宽:{2} \r", item.FreqID, item.Freq, item.Band);
                        }
                    }

                    //下邻频干扰
                    if (adjresult.HasLowerAdjFreq)
                    {
                        foreach (ComparableFreq item in adjresult.LowerAdjFreqs)
                        {
                            strmsg.AppendFormat("下邻频干扰:ID:{0},频率:{1},带宽:{2} \r", item.FreqID, item.Freq, item.Band);
                        }
                    }
                    strmsg.Append("\r");
                }
            }
            adjfreqresult.Text = strmsg.ToString();
        }