Beispiel #1
0
        /// <summary>
        /// 向下移动
        /// </summary>
        /// <returns></returns>
        public override bool MoveNext()
        {
            //#region 流程控制
            //CurrentIndex++;
            //if (CurrentIndex == StartIndex) { log.Debug("数据流 " + this.Name + " 开始读取数据。"); }
            //if (this.IsCancel) { log.Info("数据流 " + this.Name + " 已被手动取消。"); return false; }
            //if (CurrentIndex > this.MaxEnumIndex) { log.Info("数据流 " + this.Name + " 已达指定的最大编号 " + this.MaxEnumIndex); return false; }
            //while (CurrentIndex < this.StartIndex) { this.MoveNext(); }
            //#endregion

            if (_CurrentReader.MoveNext())
            {
                var result = (EpochInfoBuilder.Build(_CurrentReader.Current));
                if (result == null)
                {
                    return(false);
                }
                this.Current = result;
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// 通过文件构建,按照文件坐标计算,按照其采样率输出。
        /// </summary>
        /// <param name="oFilePath"></param>
        /// <param name="EphemerisService"></param>
        /// <param name="tableName"></param>
        /// <param name="AngleCut"></param>
        /// <returns></returns>
        public static ObjectTableStorage BuildTable(string oFilePath, double AngleCut = 12, IEphemerisService EphemerisService = null, string tableName = null)
        {
            if (String.IsNullOrWhiteSpace(tableName))
            {
                tableName = Path.GetFileName(oFilePath) + "-卫星高度角";
            }
            RinexObsFileReader reader = new RinexObsFileReader(oFilePath);
            var header  = reader.GetHeader();
            var siteXyz = header.ApproxXyz;

            if (EphemerisService == null)
            {
                if (File.Exists(header.NavFilePath))//优先考虑自带导航文件
                {
                    EphemerisService = EphemerisDataSourceFactory.Create(header.NavFilePath);
                }
                else
                {
                    EphemerisService = GlobalNavEphemerisService.Instance;
                }
            }

            var ephObj = EphemerisService.Get(SatelliteNumber.G01, reader.GetHeader().StartTime);

            if (ephObj == null)
            {
                EphemerisService = GlobalIgsEphemerisService.Instance;
            }


            var table = new ObjectTableStorage(tableName);

            while (reader.MoveNext())
            {
                var time = reader.Current.ReceiverTime;
                AddRow(AngleCut, EphemerisService, siteXyz, table, time);
            }
            return(table);
        }