Ejemplo n.º 1
0
        public static void propos(obs_t obss, dcb_t dcb, pcv_t pcv, station sta, nav_t nav, erp_t erp, List <result> res, RichTextBox text)
        {
            int     nobs    = 0;
            rtktime solt    = new rtktime();
            string  timestr = null;
            obs_t   obs     = new obs_t();
            ppp_t   p3      = new ppp_t();
            spp_t   spp     = new spp_t();

            while ((nobs = inputobs(obs, obss)) > 0)
            {
                result re = new result();
                solt = spp.tcur;
                if (pntpos(obs.obs_b, nav, spp, dcb) == 0)
                {
                    continue;
                }
                p3.spp     = spp;
                p3.soltime = spp.tcur;
                if (solt.time_int != 0)
                {
                    p3.tt = rtklibcmn.timediff(p3.soltime, solt);
                }
                if (pppos(p3, obs.obs_b, nav, dcb, sta, erp) != 1)
                {
                    continue;
                }

                for (int j = 0; j < 3; j++)
                {
                    spp.rr[j] = p3.x[j];
                }
                spp.dtr = p3.x[4];
                re.time = obs.obs_b[0].t.calend;
                re.X    = p3.x[0]; re.Y = p3.x[1]; re.Z = p3.x[2];
                timestr = re.time[0] + "/" + re.time[1] + "/" + re.time[2] + " " + re.time[3] + ":" + re.time[4] + ":" + re.time[5];
                text.AppendText(string.Format("{0,-20}", timestr) + string.Format("{0,-20}", re.X) + string.Format("{0,-20}", re.Y) + string.Format("{0,-20}", re.Z) + "\r\n");

                res.Add(re);
            }
        }
Ejemplo n.º 2
0
 /*读取天线文件*/
 public static void readatx(string path, pcv_t pcvs)
 {
     using (StreamReader sr = new StreamReader(path))
     {
         string line = "";
         pcvb   pcvd = null;
         int    state = 0, freq = 0;
         while (!sr.EndOfStream)
         {
             line = sr.ReadLine();
             if (line.Contains("COMMENT"))
             {
                 continue;
             }
             if (line.Contains("START OF ANTENNA"))
             {
                 state = 1;
             }
             if (line.Contains("END OF ANTENNA"))
             {
                 state = 0;
                 if (pcvd != null)
                 {
                     pcvs.pcvdata.Add(pcvd);
                 }
                 pcvd = null;
             }
             if (state == 0)
             {
                 continue;
             }
             if (line.Contains("TYPE / SERIAL NO"))
             {
                 string type = line.Substring(0, 20);
                 string sys  = line.Substring(20, 20);
                 pcvd      = new pcvb();
                 pcvd.type = type;
                 pcvd.prn  = sys.Trim();
                 // }
                 continue;
             }
             if (line.Contains("VALID FROM"))
             {
                 pcvd.ts = new time(line.Substring(0, 43), "atx");
                 rtklibcmn.str2time(line.Substring(0, 43), pcvd.rtkts);
                 continue;
             }
             if (line.Contains("VALID UNTIL"))
             {
                 pcvd.te = new time(line.Substring(0, 43), "atx");
                 rtklibcmn.str2time(line.Substring(0, 43), pcvd.rtkte);
                 continue;
             }
             if (line.Contains("START OF FREQUENCY"))
             {
                 freq = int.Parse(line.Substring(4, 2));
                 if (freq < 1 || freq >= 3)
                 {
                     continue;
                 }
                 continue;
             }
             if (line.Contains("END OF FREQUENCY"))
             {
                 freq = 0; continue;
             }
             if (line.Contains("NORTH / EAST / UP"))
             {
                 if (freq < 1 || freq >= 3)
                 {
                     continue;
                 }
                 string[] ss = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                 pcvd.off[freq - 1] = new double[3];
                 for (int i = 0; i < 3; i++)
                 {
                     pcvd.off[freq - 1][i] = double.Parse(ss[i]) * 1E-3; //N E U (m)
                 }
                 if (pcvd.prn == "")                                     //接收机
                 {
                     double tep = pcvd.off[freq - 1][0]; pcvd.off[freq - 1][0] = pcvd.off[freq - 1][1]; pcvd.off[freq - 1][1] = tep;
                 }
                 continue;
             }
             if (line.Contains("NOAZI"))
             {
                 if (freq < 1 || freq >= 3)
                 {
                     continue;
                 }
                 string[] ss = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                 pcvd.var[freq - 1] = new double[ss.Length - 1];
                 for (int i = 0; i < ss.Length - 1; i++)
                 {
                     pcvd.var[freq - 1][i] = double.Parse(ss[i + 1]) * 1E-3;//天线相位变化,变换成米
                 }
                 continue;
             }
         }
     }
 }