Пример #1
0
        /// <summary>
        /// 根据接收机时间和位置,获取计算卫星发射时刻的位置。不计算相对地面的延迟。
        /// </summary>
        /// <param name="nameOrPrn">卫星编号</param>
        /// <param name="gpsTime">时间</param>
        /// <returns>如果返回 null,在表示计算失败</returns>
        public override AtomicClock Get(string nameOrPrn, Time gpsTime)
        {
            ClockInterpolator clockInterpolator = GetClockInterpolator(nameOrPrn);

            if (clockInterpolator == null || !clockInterpolator.IsAvailable(gpsTime))
            {
                return(null);
            }

            #region czs
            AtomicClock fittedClock = clockInterpolator.GetAtomicClock(gpsTime);
            #endregion

            return(fittedClock);
        }
Пример #2
0
        private void button_inter_Click(object sender, EventArgs e)
        {
            double             interval      = double.Parse(this.textBox_interval.Text);
            List <AtomicClock> sortedRecords = this.bindingSource1.DataSource as List <AtomicClock>;

            if (sortedRecords == null)
            {
                MessageBox.Show("请先读取,并删选数据。"); return;;
            }
            ClockInterpolator interp = new ClockInterpolator(sortedRecords);

            List <AtomicClock> fitedResult = new List <AtomicClock>();
            double             cacuCount   = (ClockFileTo - ClockFileFrom).TotalSeconds / interval;

            for (int xi = 0; xi <= cacuCount; xi++)
            {
                Time gpsTime = sortedRecords[0].Time + interval * xi;
                fitedResult.Add(interp.GetAtomicClock(gpsTime));
            }

            this.bindingSource1.DataSource = fitedResult;
        }