/// <summary> /// 选择 /// </summary> /// <returns></returns> public override PeriodPrnManager Select() { this.DetailResultTable = new ObjectTableStorage("DetailResultTableOfFlexible_" + CutOffAngle + "deg"); var PeriodPrnManager = new PeriodPrnManager(); var totalEndTime = SatElevationTable.GetLastIndexValue <Time>(); var firstStartTime = SatElevationTable.GetFirstIndexValue <Time>(); var prevEndPeriodTime = firstStartTime; while (prevEndPeriodTime < totalEndTime) { // PeriodPrn PeriodPrn = BuildOnePeriodPrnByCenterTop2(prevEndPeriodTime); var PeriodPrn = BuildOnePeriodPrnByCenterTop(prevEndPeriodTime); if (PeriodPrn == null || PeriodPrn.TimePeriod.Span == 0) { log.Error("无满足条件的时段。" + PeriodPrn); break; } AddPeriodPrnToManager(PeriodPrnManager, PeriodPrn); prevEndPeriodTime = PeriodPrn.TimePeriod.End; } return(PeriodPrnManager); }
/// <summary> ///读取 /// </summary> /// <param name="path"></param> /// <returns></returns> public static PeriodPrnManager ReadFromFile(string path) { var reader = new PeriodPrnReader(path); var all = reader.ReadAll(); PeriodPrnManager mgr = new PeriodPrnManager(); foreach (var item in all) { mgr.Add(item); } return(mgr); }
/// <summary> /// 选择 /// </summary> /// <returns></returns> public override PeriodPrnManager Select() { this.DetailResultTable = new ObjectTableStorage("DetailResultTableOf_" + TableSatSelectorType + "_" + PeriodCount + "Count"); var PeriodPrnManager = new PeriodPrnManager(); var startTime = (Time)SatElevationTable.GetIndexValue(0); var stepPeriod = TotalPeriodSpan / PeriodCount; for (int i = 0; i < PeriodCount; i++) { var start = startTime + TimeSpan.FromSeconds(i * stepPeriod); var end = start + TimeSpan.FromSeconds(stepPeriod); TimePeriod TimePeriod = new TimePeriod(start, end); BaseTableSatelliteSelector selector = null; switch (TableSatSelectorType) { case Gnsser.BaseSatSelectionType.MaxElevation: selector = new TableElevationSatSelector(SatElevationTable, TimePeriod, CutOffAngle, false); break; case Gnsser.BaseSatSelectionType.MaxCenterElevation: selector = new TableElevationSatSelector(SatElevationTable, TimePeriod, CutOffAngle, true, 1); break; case Gnsser.BaseSatSelectionType.MaxTimeSpan: selector = new TableSpanSatSelector(SatElevationTable, TimePeriod, CutOffAngle); break; } SatelliteNumber prn = selector.Select(); var PeriodPrn = new PeriodPrn(TimePeriod, prn); this.AddPeriodPrnToManager(PeriodPrnManager, PeriodPrn); } return(PeriodPrnManager); }