コード例 #1
0
        //读取目标卫星信息,并保存到类中的list0中
        private void ReadList()
        {
            if (list.Count == 0)
            {
                MessageBox.Show("读取内容为空");
                return;
            }
            RINEX_VERSION = System.Convert.ToDouble(list[0].ToString().Substring(5, 4));
            int i = -1;

            sat = new CSatellite();
            foreach (string line in list)
            {
                if (line[1] != ' ' && (line[2] == ' ' || line[3] == ' '))
                {
                    i  += 1;
                    sat = new CSatellite();
                    sats.EpochSats.Add(sat);
                }
                if (i >= 0)
                {
                    sat.List0.Add(line);
                }
            }
            MessageBox.Show("读取成功");
        }
コード例 #2
0
 //测试用
 private void init_test()
 {
     sat = new CSatellite
     {
         Name = "G01",
         X    = 0,
         Y    = 0,
         Z    = 0
     };
     sats = new CSatellites();
     sats.EpochSats.Add(sat);
 }
コード例 #3
0
        // c = 'w' 则返回 gps 周, c = 's' 则返回 gps 周内秒,默认返回周内秒
        private long get_gpstime(CSatellite satellite, char c = 's')
        {
            if (c != 'w' && c != 's')
            {
                return(-1);    // 若传递的参数不正确,则返回-1
            }
            int days = satellite.Day;

            for (int i = 1980; i < satellite.Year; i++)
            {
                days += ydcount(i);     // 计算年天数
            }
            for (int i = 1; i < satellite.Month; i++)
            {
                days += ydcount(satellite.Year, i);      // 计算月天数
            }
            return(c == 'w' ? days / 7 : (days % 7) * 86400 + (satellite.Hour * 3600) + (satellite.Min * 60) + satellite.Sec);
        }