Exemplo n.º 1
0
        public static void OutPathArea(List <CalculateModelClasses.Path> Paths, string sPath, string projectName, int txIndex, int txTotol, ReceiveArea rArea, Terrain ter, ref Dictionary <int, List <Plural> > projectionResult, int Frequence, int minFrequence, int maxFrequence)
        {
            string Rxname = Paths[0].node[Paths[0].node.Count - 1].NodeName;

            Console.WriteLine(sPath + projectName + "_erm" + "_t00" + txIndex + "_0" + txTotol + ".p2m");
            FileStream   fs        = new FileStream(sPath + projectName + "_" + "situation" + "_erm" + "_t00" + txIndex + "_0" + txTotol + "_" + Frequence.ToString("D4") + "_" + minFrequence.ToString("D4") + "_" + maxFrequence.ToString("D4") + ".p2m", FileMode.Create);//如果是接收区域的话,多个接收点组成一组接收机组成一个编号
            StreamWriter sw        = new StreamWriter(fs);
            List <int>   rxCounter = AreaUtils.getCount4Rx(rArea);
            int          Rxnum     = rxCounter[0] * rxCounter[1];

            sb.AppendLine("# Receiver Set:" + Rxname);
            sb.AppendLine("#   Rx#      X(m)           Y(m)            Z(m)     Distance          Erms");
            if (projectionResult == null)
            {
                List <CalculateModelClasses.Path> omg = AreaUtils.getPaths(Paths);
                projectionResult = AreaUtils.yingshe(rxCounter, omg, rArea);
            }
            double temp = rArea.temp;

            foreach (var item in projectionResult.Keys)
            {
                Point  receiverPoint = AreaUtils.GetCenterPointInAreaDivision(rArea, rxCounter, ter, item, temp);
                double distance      = Paths[0].node[0].Position.GetDistance(receiverPoint);
                Plural exTotal       = projectionResult[item][1];
                Plural eyTotal       = projectionResult[item][2];
                Plural ezTotal       = projectionResult[item][3];
                Plural eTotal        = new Plural(exTotal.Re + eyTotal.Re + ezTotal.Re, exTotal.Im + eyTotal.Im + ezTotal.Im);
                sb.AppendLine(AreaUtils.getBlank(item, 6) + item + "  " + receiverPoint.X.ToString("E7") + "  " + receiverPoint.Y.ToString("E7") + "     " + receiverPoint.Z.ToString("f3") + "       " + distance.ToString("f2") + "  " + Math.Sqrt(Math.Pow(eTotal.Re, 2) + Math.Pow(eTotal.Im, 2)).ToString("E5"));
            }
            sw.Write(sb);
            sb.Clear();
            sw.Close();
            fs.Close();
        }
Exemplo n.º 2
0
 private static void OutEveryRxPath(List <Node> RxNode, string Rxname, double passloss, double distance)//接收机的名字,加到path里面
 {
     sb.AppendLine("# Receiver Set:" + Rxname);
     sb.AppendLine("#   Rx#      X(m)           Y(m)            Z(m)   Distance        Erms");
     for (int i = 0; i < RxNode.Count; i++)
     {
         sb.AppendLine(AreaUtils.getBlank(i, 6) + (i + 1) + "  " + RxNode[i].Position.X.ToString("0.#######E+00") + "  " + RxNode[i].Position.Y.ToString("0.#######E+00") + "     " + RxNode[i].Position.Z.ToString("f3") + "       " + distance.ToString("f2") + "  ");
     }
 }