コード例 #1
0
        private PeriodPrn BuildOnePeriodPrnByCenterTop2(Time startTime)
        {
            var endTime = startTime + SearchTimeSpan;

            List <String>    prnsString = GetStartPrns(startTime);
            List <TableCell> maxCells   = new List <TableCell>();

            foreach (var item in prnsString)
            {
                if (SatElevationTable.MinusNext(item, startTime) < 0) //方向必须朝上
                {
                    var max = SatElevationTable.GetMaxCell(item, startTime, endTime);
                    maxCells.Add(max);
                }
            }
            var longest = maxCells.FindAll(m => (double)m.Value > CutOffAngle).OrderByDescending(m => m.RowNumber).First();

            SatelliteNumber selectedPrn = SatelliteNumber.Parse(longest.ColName);
            //查找其结尾处,满足条件的时刻或历元
            var       startTime2    = (Time)SatElevationTable.GetIndexValue(longest.RowNumber);
            var       endTime2      = startTime2 + SearchTimeSpan;
            TableCell endCell       = SatElevationTable.GetCellApproxTo(longest.ColName, CutOffAngle, startTime2, endTime2);
            var       endTimePeriod = (Time)SatElevationTable.GetIndexValue(endCell.RowNumber);

            TimePeriod TimePeriod = new Geo.Times.TimePeriod(startTime, endTimePeriod);
            var        PeriodPrn  = new PeriodPrn(TimePeriod, selectedPrn);

            return(PeriodPrn);
        }
コード例 #2
0
        //首先,选择在起始时刻所有满足条件的卫星,
        //查找这些卫星的最大高度角的位置(附近6小时内),选择距离远的,
        //查找其结束点高度角时刻,
        //继续遍历
        public PeriodPrn BuildOnePeriodPrnByCenterTop(Time startTime)
        {
            var endTime = startTime + SearchTimeSpan;

            List <String>    prnsString = GetStartPrns(startTime);
            List <TableCell> maxCells   = new List <TableCell>();

            foreach (var colName in prnsString)
            {
                if (SatElevationTable.MinusNext(colName, startTime) < 0) //方向必须朝上
                {
                    var max = SatElevationTable.GetFirstSlopeApproxTo(colName, CutOffAngle, startTime, false);

                    //   var max = SatElevationTable.GetMaxCell(colName, startTime, endTime);
                    maxCells.Add(max);
                }
            }
            if (maxCells.Count == 0)
            {
                return(null);
            }

            var longest = maxCells.OrderByDescending(m => m.RowNumber).First();

            SatelliteNumber selectedPrn = SatelliteNumber.Parse(longest.ColName);

            var endTimePeriod = (Time)SatElevationTable.GetIndexValue(longest.RowNumber);

            TimePeriod TimePeriod = new Geo.Times.TimePeriod(startTime, endTimePeriod);
            var        PeriodPrn  = new PeriodPrn(TimePeriod, selectedPrn);

            return(PeriodPrn);
        }
コード例 #3
0
        /// <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);
        }