예제 #1
0
        //从传入的文件中提取发射机点
        //public static double TxFrequence;
        // public static double TxFrequenceWideth;
        /// <summary>
        ///从传入的文件中提取发射机点
        /// </summary>
        public static List <Node> GetTx(string txpath, string setup, string terpath)
        {
            List <Node>     txnode = new List <Node>();
            List <TxObject> txs    = TxReader(txpath);
            Node            temp;

            for (int i = 0; i < txs.Count; i++)
            {
                temp            = new Node();
                temp.IsEnd      = false;
                temp.IsReceiver = false;
                temp.LayNum     = 1;
                temp.NodeStyle  = NodeStyle.Tx;
                temp.Position   = new Point(txs[i].Lc.vertical[0], txs[i].Lc.vertical[1], txs[i].Lc.vertical[2]);
                temp.Position.Z = (txs[i].Lc.vertical[2] + txs[i].cubesize);
                temp.TxNum      = txs[i].num;
                temp.Power      = (txs[i].at.power);
                temp.NodeName   = txs[i].name;
                //加从setup文件中获取的频率函数、UAN
                //temp.frequence = GetTxCarrierFrequence(txs[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                //TxFrequence = temp.frequence;
                //temp.FrequenceWidth = GetWidth(txs[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                //TxFrequenceWideth = temp.FrequenceWidth;
                temp.UAN    = ReadUan.GetUan(txs[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                temp.Height = txs[i].cubesize;
                txnode.Add(temp);
            }
            return(txnode);
        }
예제 #2
0
        /// <summary>
        ///计算威胁度时,需要把其他的发射机也当接收机来算,从发射机文件中提取接收球
        /// </summary>
        public static List <List <ReceiveBall> > GetTxAsRx(string txpath, string setup, string terpath)
        {
            List <List <ReceiveBall> > TxAsRxBalls = new List <List <ReceiveBall> >();
            List <TxObject>            txForRx     = TxReader(txpath);

            for (int i = 0; i < txForRx.Count; i++)
            {
                Point lc = new Point(txForRx[i].Lc.vertical[0], txForRx[i].Lc.vertical[1], txForRx[i].Lc.vertical[2]);
                lc.Z = txForRx[i].Lc.vertical[2] + txForRx[i].cubesize;
                List <ReceiveBall> temp   = new List <ReceiveBall>();
                ReceiveBall        rxtemp = new ReceiveBall(lc, txForRx[i].num, txForRx[i].name);
                // rxtemp.frequence = GetTxCarrierFrequence(txForRx[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                // rxtemp.FrequenceWidth = GetWidth(txForRx[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                rxtemp.UAN  = ReadUan.GetUan(txForRx[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                rxtemp.isTx = true;
                temp.Add(rxtemp);
                TxAsRxBalls.Add(temp);
            }
            return(TxAsRxBalls);
        }
예제 #3
0
        /// <summary>
        ///返回接收球,如果是区域状则返回多个接收球
        /// </summary>
        public static List <List <ReceiveBall> > GetRx(string rxpath, string setup, string terpath)
        {
            List <List <ReceiveBall> > RxBalls = new List <List <ReceiveBall> >();
            List <RxObject>            Rx      = RxReader(rxpath);

            for (int i = 0; i < Rx.Count; i++)
            {
                //这是点状和区域状
                if (Rx[i].flag != "<situation>")
                {
                    if (Rx[i].flag.Equals("<points>"))
                    {
                        Point lc = new Point(Rx[i].Lc.vertical[0], Rx[i].Lc.vertical[1], Rx[i].Lc.vertical[2]);
                        //GetZValue(ter, lc);
                        lc.Z = Rx[i].Lc.vertical[2] + Rx[i].cubesize;
                        List <ReceiveBall> temp   = new List <ReceiveBall>();
                        ReceiveBall        rxtemp = new ReceiveBall(lc, Rx[i].num, Rx[i].name);
                        rxtemp.UAN = ReadUan.GetUan(Rx[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                        temp.Add(rxtemp);
                        RxBalls.Add(temp);
                    }
                    else  //现在不会进入这个分支
                    {
                        List <ReceiveBall> temp   = new List <ReceiveBall>();
                        double             length = (double)Rx[i].Lc.side1;
                        double             width  = (double)Rx[i].Lc.side2;
                        double             space  = (double)Rx[i].Lc.spacing;
                        for (int j = 0; j < width / space + 1; j++)
                        {
                            for (int k = 0; k < length / space + 1; k++)
                            {
                                Point lc = new Point(Rx[i].Lc.vertical[0] + k * space, Rx[i].Lc.vertical[1] - j * space, Rx[i].Lc.vertical[2]);
                                //GetZValue(ter, lc);
                                lc.Z += Rx[i].Lc.vertical[2] + Rx[i].cubesize;
                                ReceiveBall rxtemp = new ReceiveBall(lc, Rx[i].num, Rx[i].name);
                                rxtemp.UAN = ReadUan.GetUan(Rx[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                                temp.Add(new ReceiveBall(lc, Rx[i].num, Rx[i].name));
                            }
                        }
                        RxBalls.Add(temp);
                    }
                }
                //这是态势显示
                else
                {
                    if ((double)Rx[i].Lc.side1 == 0 || (double)Rx[i].Lc.side2 == 0)//态势区域边长不能为0
                    {
                        LogFileManager.ObjLog.debug("态势区域边长为0,出错");
                    }

                    //         Rx[i].Lc.spacing = 50;
                    //         Spacing = (double)Rx[i].Lc.spacing;
                    List <ReceiveBall> temp        = new List <ReceiveBall>();
                    ReceiveBall        receiveArea = new ReceiveArea();
                    receiveArea.UAN = ReadUan.GetUan(Rx[i], SetupFileProceed.GetSetupFile.GetSetup(setup));
                    Point lc = new Point(Rx[i].Lc.vertical[0], Rx[i].Lc.vertical[1], Rx[i].Lc.vertical[2]);
                    receiveArea.temp = Rx[i].Lc.vertical[2];
                    //GetZValue(ter, lc);
                    lc.Z = Rx[i].Lc.vertical[2] + Rx[i].cubesize;
                    //receiveArea.rxLength = (double)Rx[i].Lc.side1;
                    //receiveArea.rxWidth = (double)Rx[i].Lc.side2;
                    //receiveArea.spacing =(double)Rx[i].Lc.spacing;
                    //receiveArea.origen = lc;
                    receiveArea.Instance((double)Rx[i].Lc.side1, (double)Rx[i].Lc.side2, (double)Rx[i].Lc.spacing, lc);
                    receiveArea.RxName = Rx[i].name;
                    receiveArea.RxNum  = Rx[i].num;

                    temp.Add(receiveArea);
                    RxBalls.Add(temp);
                }
            }
            return(RxBalls);
        }