/// <summary>
        /// 取设备的Transmitter(包含备用频率发射信息)
        /// </summary>
        /// <param name="equs"></param>
        /// <returns></returns>
        private static Transmitter[] GetEquTransmitters(List <ActivityEquipment> equs)
        {
            List <Transmitter> transList = new List <Transmitter>();

            if (equs != null && equs.Count > 0)
            {
                ActivityEquipment equ = null;
                for (int i = 0; i < equs.Count; i++)
                {
                    equ = equs[i];

                    double freqsend = 0;
                    if (equ.AssignSendFreq != null)
                    {
                        freqsend = equ.AssignSendFreq.Value;
                    }


                    double band = 0;
                    if (equ.Band_kHz != null)
                    {
                        band = equ.Band_kHz.Value;
                    }

                    double sendFreqStart = 0;
                    if (equ.FreqRange.Little != null)
                    {
                        sendFreqStart = equ.FreqRange.Little.Value;
                    }

                    double sendFreqEnd = 0;
                    if (equ.FreqRange.Great != null)
                    {
                        sendFreqEnd = equ.FreqRange.Great.Value;
                    }

                    double maxPower = 0;
                    if (equ.Power_W != null)
                    {
                        maxPower = equ.Power_W.Value;
                    }

                    Transmitter transmitter = new Transmitter(equ.Key,
                                                              new ComparableFreq(freqsend, 0, band / 1000, equ.Key),
                                                              new TransmitterParams()
                    {
                        TuningRangeStart = new EMCFreqValue(EMCFreqUnitEnum.MHZ, sendFreqStart),
                        TuningRangeEnd   = new EMCFreqValue(EMCFreqUnitEnum.MHZ, sendFreqEnd),
                        Power            = new EMCPowerValue(EMCPowerUnitEnum.W, maxPower)
                    }, null);
                    transList.Add(transmitter);


                    //备用发射频率也作为一条发射
                    double sparefreq = 0;
                    if (equ.AssignSpareFreq != null)
                    {
                        sparefreq = equ.AssignSpareFreq.Value;
                        Transmitter sparetransmitter = new Transmitter(equ.Key,
                                                                       new ComparableFreq(sparefreq, 0, band / 1000, equ.Key),
                                                                       new TransmitterParams()
                        {
                            TuningRangeStart = new EMCFreqValue(EMCFreqUnitEnum.MHZ, sendFreqStart),
                            TuningRangeEnd   = new EMCFreqValue(EMCFreqUnitEnum.MHZ, sendFreqEnd),
                            Power            = new EMCPowerValue(EMCPowerUnitEnum.W, maxPower)
                        }, null);
                        transList.Add(sparetransmitter);
                    }
                }
            }
            return(transList.ToArray());
        }
Exemplo n.º 2
0
 /// <summary>
 /// 计算五阶互调
 /// </summary>
 /// <param name="transmitter">发射机</param>
 /// <param name="max">另一个发射机位置</param>
 private void CalcStationFifthOrderIM(Transmitter transmitter, int max)
 {
     RegisterFifthOrderIMItem(transmitter.ComparableFreq, this.stationtransmitters[max].ComparableFreq);
     RegisterFifthOrderIMItem(this.stationtransmitters[max].ComparableFreq, transmitter.ComparableFreq);
 }