Exemplo n.º 1
0
        private void button_inter_Click(object sender, EventArgs e)
        {
            double             interval      = double.Parse(this.textBox_interval.Text);
            List <AtomicClock> sortedRecords = this.bindingSource_clk.DataSource as List <AtomicClock>;

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

            //    Data.ClockDataSource datasource = new Data.ClockDataSource(_clockFile);

            ClockInterpolator interp = new ClockInterpolator(sortedRecords, 2);

            this.Clocks = interp.GetAtomicClocks(Time.Parse(from), Time.Parse(to), interval);

            this.bindingSource_clk.DataSource = this.Clocks;
            string          name = this.comboBox_name.SelectedItem.ToString();
            SatelliteNumber prn  = SatelliteNumber.Parse(name);

            this.Ephemerides = sp3File.Gets(SatelliteNumber.Parse(name), Time.Parse(from), Time.Parse(to), interval);
            this.bindingSource_sp3.DataSource = Ephemerides;

            ShowComparing();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 构建观测历元。
        /// </summary>
        /// <param name="row"></param>
        /// <param name="indexColName"></param>
        /// <returns></returns>
        public RinexEpochObservation BuildObs(Dictionary <String, object> row, string indexColName)
        {
            var obs = new RinexEpochObservation();

            obs.ReceiverTime = new Geo.Times.Time((DateTime)row[indexColName]);
            foreach (var item in row)
            {
                var name = item.Key;
                if (name == indexColName)
                {
                    continue;
                }

                var code = name.Substring(4);
                var prn  = SatelliteNumber.Parse(name);

                if (!obs.Contains(prn))
                {
                    obs[prn] = new RinexSatObsData(prn);
                }
                var obsValue = new RinexObsValue((double)item.Value, code);
                obs[prn].Add(code, obsValue);
            }
            return(obs);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 读取卫星信息。
        /// 由于卫星信息文件较小,这里一次性读取完毕。
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns></returns>
        public void Read()
        {
            Dictionary <Time, SatExcludeItem> sats = new Dictionary <Time, SatExcludeItem>();

            using (StreamReader sr = new StreamReader(path))
            {
                string line = null;
                while ((line = sr.ReadLine()) != null)
                {
                    string[] strs = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                    // SatExcludeItem
                    int year      = int.Parse(strs[0]);
                    int dayOfYear = int.Parse(strs[1]);

                    Time gpstime = new Time(year, dayOfYear);

                    int length = strs.Length;
                    List <SatelliteNumber> prns = new List <SatelliteNumber>();
                    for (int i = 2; i < length; i++)
                    {
                        SatelliteNumber prn = SatelliteNumber.Parse(strs[i]);
                        prns.Add(prn);
                    }
                    SatExcludeItem item = new SatExcludeItem(gpstime, prns);

                    if (!sats.ContainsKey(item.Date))
                    {
                        sats.Add(item.Date, item);
                    }
                }
            }
            ExcludeSats = sats;
        }
Exemplo n.º 4
0
        private void ShowComparing()
        {
            //比较
            List <ClockLite> compares = new List <ClockLite>();

            foreach (var item in Clocks)
            {
                Ephemeris eph = Ephemerides.Find(m => m.Time.Equals(item.Time));
                if (eph == null)
                {
                    continue;
                }

                ClockLite c = new ClockLite()
                {
                    Prn = item.Prn == null?SatelliteNumber.Parse(item.Name) : item.Prn,
                              GpsTime = item.Time,
                              Offset  = item.ClockBias - eph.ClockBias,
                              Drift   = item.ClockDrift - eph.ClockDrift
                };
                c.Distance = c.Offset * GnssConst.LIGHT_SPEED;
                compares.Add(c);
            }

            this.bindingSource_comparing.DataSource = compares;
        }
Exemplo n.º 5
0
        /// <summary>
        /// 执行无电离层双差模糊度固定
        /// </summary>
        /// <param name="rawFloatAmbiCycles"></param>
        /// <param name="isNetSolve">是否网解</param>
        /// <returns></returns>
        protected WeightedVector DoFixIonoFreeAmbiguity(WeightedVector rawFloatAmbiCycles, bool isNetSolve)
        {
            //-----------以下为无电离层组合模糊度固定算法--------------------
            if (this.DataSourceContext.SiteSatPeriodDataService == null)
            {
                log.Warn("必须开启时段数据服务,才能实现无电离层模糊度固定!");
                return(new WeightedVector());
            }
            var time = this.CurrentMaterial.ReceiverTime;

            //指定系统的无电离层组合参数计算器
            var IonoFreeAmbiguitySolver = IonoFreeAmbiguitySolverManager.GetOrCreate(CurrentBasePrn.SatelliteType);

            IonoFreeAmbiguitySolver.CheckOrInit(CurrentBasePrn, CurrentMaterial.ReceiverTime, !Option.IsLengthPhaseValue);

            //----------------------第一步 MW 宽巷星间单差 ------------------------
            var intMwDoubleDiffers = GetIntMwDiffersBeweenSat(isNetSolve);

            //----------------------第二步 MW 宽巷和模糊度浮点解求窄巷模糊度--------
            var ambiFloatVal = rawFloatAmbiCycles.GetNameRmsedNumeralVector();

            //求窄巷模糊度浮点解//单位周
            var narrowFloat = IonoFreeAmbiguitySolver.GetNarrowFloatValue(intMwDoubleDiffers, ambiFloatVal);

            //--------记录小数偏差部分-------
            var satPeriodService = this.DataSourceContext.SiteSatPeriodDataService.Get(this.CurrentMaterial.SiteName);

            foreach (var item in narrowFloat)
            {
                var prn = SatelliteNumber.Parse(item.Key);
                satPeriodService.GetOrCreate(prn).Regist(CurrentBasePrn + "-" + ParamNames.NarrowLaneBsdCycle, time, item.Value.Value, this.CurrentMaterial[prn].IsUnstable);
            }

            return(new WeightedVector());
        }
Exemplo n.º 6
0
        /// <summary>
        /// 传统构造函数。
        /// </summary>
        /// <param name="pathesOfWLInt"></param>
        /// <param name="pppPathes"></param>
        /// <param name="IsOutputInEachDirectory"></param>
        /// <param name="OutputDirectory"></param>
        public MultiPeriodNarrowLaneOfBsdSolver(string[] pathesOfWLInt, string[] pppPathes, int removeCountOfEachSegment, bool IsOutputInEachDirectory, string OutputDirectory)
        {
            //读取宽巷的整数解
            //分基准星计算
            this.IsOutputInEachDirectory = IsOutputInEachDirectory;
            this.OutputDirectory         = OutputDirectory;
            this.IntOfWLPathes           = new Dictionary <SatelliteNumber, List <string> >();
            SatelliteNumber basePrn = new SatelliteNumber();

            foreach (var path in pathesOfWLInt)
            {
                basePrn = SatelliteNumber.Parse(Path.GetFileName(path).Substring(4, 3));
                if (IntOfWLPathes.ContainsKey(basePrn))
                {
                    IntOfWLPathes[basePrn].Add(path);
                }
                else
                {
                    IntOfWLPathes[basePrn] = new List <string>();
                    IntOfWLPathes[basePrn].Add(path);
                }
            }
            this.FloatAmbiguitiesOfPpp = PppTableResultFileReader.ReadPppAmbiResultInCycle(pppPathes);
            //修理浮点解
            FloatAmbiguitiesOfPpp.RemoveStartRowOfEachSegment(removeCountOfEachSegment);
            MaxAllowedDiffer = 0.25;
        }
Exemplo n.º 7
0
        public override void UiToEntity()
        {
            base.UiToEntity();
            Option.IsBaseSiteRequried         = this.checkBox_IsBaseSiteRequried.Checked;
            Option.IndicatedBaseSiteName      = this.namedStringControl_BaseSiteName.GetValue();
            Option.IndicatedPrn               = SatelliteNumber.Parse(this.enabledStringControl_IndicatedPrn.GetEnabledValue().Value);
            Option.IsIndicatedPrn             = this.enabledStringControl_IndicatedPrn.GetEnabledValue().Enabled;
            Option.BaseLineSelectionType      = this.enumRadioControl_BaseLineSelectionType.GetCurrent <BaseLineSelectionType>();
            Option.BaseSatSelectionType       = this.enumRadioControl_baseSatSelectionType.GetCurrent <Gnsser.BaseSatSelectionType>();
            Option.MaxDistanceOfShortBaseLine = this.namedFloatControl_maxShotBaseLine.Value;
            Option.MinDistanceOfLongBaseLine  = this.namedFloatControl_MinDistanceOfLongBaseLine.Value;

            Option.BaseLineFilePath = fileOpenControl_baselineFile.FilePath;
            Option.CenterSiteName   = namedStringControl_ceterSiteName.GetValue();

            this.Option.BaseSiteSelectType = this.enumRadioControl_BaseSiteSelectType.GetCurrent <BaseSiteSelectType>();

            //手动输入
            double levelFixed    = this.namedFloatControl_fixedErrorLevel.GetValue();
            double verticalFixed = this.namedFloatControl_fixedErrorVertical.GetValue();
            double levelCoeef    = this.namedFloatControl_levelCoefOfProprotion.GetValue();
            double verticalCoeef = this.namedFloatControl_verticalCoefOfProprotion.GetValue();

            Option.GnssReveiverNominalAccuracy = new GnssReveiverNominalAccuracy(levelFixed, verticalFixed, levelCoeef, verticalCoeef);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 插值器
        /// </summary>
        /// <param name="prnStr"></param>
        /// <returns></returns>
        private ClockInterpolator GetClockInterpolator(string prnStr)
        {
            if (clockInterpolators.ContainsKey(prnStr))
            {
                return(clockInterpolators[prnStr]);
            }
            lock (locker2)
            {
                if (clockInterpolators.ContainsKey(prnStr))
                {
                    return(clockInterpolators[prnStr]);
                }
                if (SatelliteNumber.IsPrn(prnStr))
                {
                    var prn   = SatelliteNumber.Parse(prnStr);
                    var items = ClockFile.Get(prn);
                    if (items == null || items.Count == 0)
                    {
                        return(null);
                    }

                    var inter = new ClockInterpolator(items.Values);
                    clockInterpolators.TryAdd(prnStr, inter);
                    return(inter);
                }
            }

            return(null);
        }
Exemplo n.º 9
0
        private void button_show_Click(object sender, EventArgs e)
        {
            if (ephemerisA == null)
            {
                Geo.Utils.FormUtil.ShowErrorMessageBox("读入数据 A 先!"); return;
            }
            if (ephemerisB == null)
            {
                Geo.Utils.FormUtil.ShowErrorMessageBox("读入数据 B 先!"); return;
            }

            if (this.comboBox_prn.SelectedItem == null)
            {
                Geo.Utils.FormUtil.ShowWarningMessageBox("没有共同卫星,无法比较!");
                return;
            }

            SatelliteNumber PRN = SatelliteNumber.Parse(this.comboBox_prn.SelectedItem.ToString());

            //每次取10个数计算
            sortedRecordsA = ephemerisA.Gets(PRN);
            sortedRecordsB = ephemerisB.Gets(PRN);//, new Time(this.TimeFrom.Value), new Time(this.TimeTo.Value));

            this.bindingSource1.DataSource = sortedRecordsA;
            this.bindingSource2.DataSource = sortedRecordsB;
            this.bindingSource3.DataSource = GetDifferEphemeirs(sortedRecordsA, sortedRecordsB);
        }
        private void GetPredictedClockBias(string PredictedClockBiasPath)
        {
            bool isEnd = false;

            using (StreamReader sr = new StreamReader(PredictedClockBiasPath))
            {
                string   line = sr.ReadLine();
                string[] sat  = SinexCoord.SplitByBlank(line);
                while (!isEnd)
                {
                    line = sr.ReadLine();
                    if (line == null || line == "")
                    {
                        break;
                    }
                    if (line.Length == 0)
                    {
                        isEnd = false;
                    }
                    string[]  tmp  = SinexCoord.SplitByBlank(line);
                    Time      time = Time.Parse(tmp[0]);
                    clockbias cc   = new clockbias();
                    for (int i = 0; i < sat.Length; i++)
                    {
                        cc.sat.Add(SatelliteNumber.Parse(sat[i + 1]), double.Parse(tmp[i + 1]));
                    }
                    ClockBias.Add(time, cc);
                }
            }
        }
Exemplo n.º 11
0
        private void UpdateToNarrowBsdValue(ObjectTableStorage table)
        {
            var indexColName = table.GetIndexColName();
            var prn          = SatelliteNumber.Parse(table.Name);

            table.HandleRow(UpdateRowWithFloatNarowLane(indexColName, prn)
                            );
        }
Exemplo n.º 12
0
        public SatelliteNumber TryGetPrn(string CurrentName)
        {
            if (CurrentName.Trim().Length == 3 && Char.IsNumber(CurrentName[1]) && Char.IsNumber(CurrentName[2]))
            {
                return(SatelliteNumber.Parse(CurrentName));
            }

            return(SatelliteNumber.Default);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 分解第一行。V3
        /// </summary>
        /// <param name="line">行</param>
        /// <param name="header">头部</param>
        /// <param name="record">钟差</param>
        public static void ParseFirstLineV3(string line, GlonassNavRecord record)
        {
            line        = line.Replace('D', 'E');
            record.Prn  = SatelliteNumber.Parse(line.Substring(0, 3));
            record.Time = Time.Parse(line.Substring(4, 19));
            string val = line.Substring(23, 19);

            record.ClockBias             = double.Parse(val);
            record.RelativeFrequencyBias = double.Parse(line.Substring(42, 19));
            record.MessageTime           = double.Parse(line.Substring(61, 19));
        }
Exemplo n.º 14
0
        /// <summary>
        /// 分解第一行。
        /// </summary>
        /// <param name="line"></param>
        /// <param name="header"></param>
        /// <param name="record"></param>
        public static void ParseFirstLineV2(string line, NavFileHeader header, SatClockBias record)
        {
            line        = line.Replace('D', 'E');
            record.Prn  = SatelliteNumber.Parse(line.Substring(0, 2), header.SatelliteType);
            record.Time = Time.Parse(line.Substring(2, 20));
            string val = line.Substring(22, 19);

            record.ClockBias  = double.Parse(val);
            record.ClockDrift = double.Parse(line.Substring(41, 19));
            record.DriftRate  = double.Parse(line.Substring(60, 19));
        }
Exemplo n.º 15
0
        /// <summary>
        /// 分解第一行。V2
        /// </summary>
        /// <param name="line">行</param>
        /// <param name="header">头部</param>
        /// <param name="record">钟差</param>
        public static void ParseFirstLineV2(string line, NavFileHeader header, GlonassNavRecord record)
        {
            line        = line.Replace('D', 'E');
            record.Prn  = SatelliteNumber.Parse(line.Substring(0, 2), header.SatelliteType);
            record.Time = Time.Parse(line.Substring(2, 20));
            string val = line.Substring(22, 19);

            record.ClockBias             = double.Parse(val);
            record.RelativeFrequencyBias = double.Parse(line.Substring(41, 19));
            record.MessageTime           = double.Parse(line.Substring(60, 19));
        }
Exemplo n.º 16
0
        private void button_inter_Click(object sender, EventArgs e)
        {
            if (sortedRecordsA != null && sortedRecordsA.Count != 0 && sortedRecordsB != null && sortedRecordsB.Count != 0)
            {
                double           interval     = Double.Parse(this.textBox_interval.Text);
                SatelliteNumber  PRN          = SatelliteNumber.Parse(this.comboBox_prn.SelectedItem.ToString());
                List <Ephemeris> fitedResultA = new List <Ephemeris>();
                List <Ephemeris> fitedResultB = new List <Ephemeris>();
                Time             start        = new Time(this.dateTimePicker_from.Value);


                if (ephemerisA is Geo.Algorithm.IInterpolationCaller)
                {
                    Geo.Algorithm.IInterpolationCaller a = ephemerisA as Geo.Algorithm.IInterpolationCaller;
                    a.Order = int.Parse(this.textBox_A_count.Text);
                    if (this.radioButton_A_cheb.Checked)
                    {
                        a.InterpolationType = InterpolationType.ChebyshevPolyFit;
                    }
                    else
                    {
                        a.InterpolationType = InterpolationType.LagrangeInterplation;
                    }
                }
                if (ephemerisB is Geo.Algorithm.IInterpolationCaller)
                {
                    Geo.Algorithm.IInterpolationCaller b = ephemerisB as Geo.Algorithm.IInterpolationCaller;
                    b.Order = int.Parse(this.textBox_B_count.Text);
                    if (this.radioButton_B_cheb.Checked)
                    {
                        b.InterpolationType = InterpolationType.ChebyshevPolyFit;
                    }
                    else
                    {
                        b.InterpolationType = InterpolationType.LagrangeInterplation;
                    }
                }

                double cacuCount = (this.dateTimePicker_to.Value - this.dateTimePicker_from.Value).TotalSeconds / interval;
                for (int xi = 0; xi < cacuCount; xi++)
                {
                    Time      gpsTime = start + interval * xi;
                    Ephemeris eA      = ephemerisA.Get(PRN, gpsTime);
                    Ephemeris eB      = ephemerisB.Get(PRN, gpsTime);
                    fitedResultA.Add(eA);
                    fitedResultB.Add(eB);
                }
                this.bindingSource1.DataSource = fitedResultA;
                this.bindingSource2.DataSource = fitedResultB;
                this.bindingSource3.DataSource = GetDifferEphemeirs(fitedResultA, fitedResultB);
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 分解第一行。
        /// </summary>
        /// <param name="line"></param>
        /// <param name="header"></param>
        /// <param name="record"></param>
        public static SatClockBias ParseFirstLineV3(string line, NavFileHeader header)
        {
            SatClockBias record = new SatClockBias();

            line        = line.Replace('D', 'E');
            record.Prn  = SatelliteNumber.Parse(line.Substring(0, 3), header.SatelliteType);
            record.Time = Time.Parse(line.Substring(4, 19));
            string val = line.Substring(23, 19);

            record.ClockBias  = double.Parse(val);
            record.ClockDrift = double.Parse(line.Substring(42, 19));
            record.DriftRate  = double.Parse(line.Substring(61, 19));
            return(record);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 模糊度固定解,条件平差。
        /// </summary>
        /// <param name="result"></param>
        /// <param name="fixedPppAmbi"></param>
        private PppResult FixPppResult(PppResult result, Dictionary <SatelliteNumber, double> fixedPppAmbi)
        {
            if (fixedPppAmbi.Count < 2)
            {
                return(result);
            }

            var    floadParams = result.ResultMatrix.Estimated;
            var    paramCount  = floadParams.Count;
            int    fixedCount  = fixedPppAmbi.Count;
            Vector fixedVector = new Vector();//fixedCount + 1

            foreach (var item in fixedPppAmbi)
            {
                fixedVector.Add(item.Value, item.Key.ToString());
            }
            //构建控制阵
            Matrix constraintMatrix = new Matrix(fixedCount, paramCount);
            int    baseColIndex     = -1;// floadParams.ParamNames.IndexOf(this.CurrentBasePrn.ToString());

            for (int i = 5; i < paramCount; i++)
            {
                var sat = SatelliteNumber.Parse(floadParams.ParamNames[i]);
                if (sat == CurrentBasePrn)
                {
                    baseColIndex = i;
                    break;
                }
            }
            for (int colIndex = 5; colIndex < paramCount; colIndex++)
            {
                var sat      = SatelliteNumber.Parse(floadParams.ParamNames[colIndex]);
                int rowIndex = fixedVector.ParamNames.IndexOf(sat.ToString());//列编号与固定值对应
                if (rowIndex == -1)
                {
                    continue;//没有,略过
                }
                constraintMatrix[rowIndex, baseColIndex] = -1;
                constraintMatrix[rowIndex, colIndex]     = 1;
            }
            //条件平差
            AdjustObsMatrix obsMatrix = new AdjustObsMatrix();

            obsMatrix.SetCoefficient(constraintMatrix).SetObservation(floadParams).SetFreeVector(fixedVector);
            ConditionalAdjuster adjuster = new ConditionalAdjuster();
            var resultMatrix             = adjuster.Run(obsMatrix);

            result.ResultMatrix.Estimated = resultMatrix.CorrectedObs;
            return(result);
        }
Exemplo n.º 19
0
        private void button_view_Click(object sender, EventArgs e)
        {
            bool isValOrRms = checkBox_valOrRMS.Checked;
            var  name       = namedStringControl1.GetValue();
            var  timePeriod = timePeriodControl1.TimePeriod;
            var  strs       = name.Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries);

            var ionoService = GlobalIgsGridIonoDcbService.Instance;

            ObjectTableStorage table = new ObjectTableStorage();

            for (var time = timePeriod.StartDateTime; time < timePeriod.EndDateTime; time += TimeSpan.FromDays(1))
            {
                table.NewRow();
                table.AddItem("Epoch", time);
                foreach (var item in strs)
                {
                    if (item.Length == 3 && SatelliteNumber.IsPrn(item))
                    {
                        var prn = SatelliteNumber.Parse(item);
                        var val = ionoService.GetDcb(new Time(time), prn);
                        if (isValOrRms)
                        {
                            table.AddItem(prn, val.Value);
                        }
                        else
                        {
                            table.AddItem(prn, val.Rms);
                        }
                    }
                    else
                    {
                        var val = ionoService.GetDcb(new Time(time), item);
                        if (isValOrRms)
                        {
                            table.AddItem(item, val.Value);
                        }
                        else
                        {
                            table.AddItem(item, val.Rms);
                        }
                    }
                }
            }


            objectTableControl1.DataBind(table);
        }
Exemplo n.º 20
0
        /// <summary>
        /// 构建头部信息
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        public RinexObsFileHeader BuidHeader(ObjectTableStorage table)
        {
            var colNames      = table.ParamNames;
            var indexName     = table.GetIndexColName();
            var secondColName = colNames[1];


            var startEpochTime        = (DateTime)table.FirstIndex;
            var endEpoch              = (DateTime)table.LastIndex;
            var interval              = (int)((DateTime)table.SecondIndex - startEpochTime).TotalSeconds;
            RinexObsFileHeader header = new RinexObsFileHeader();

            header.Interval  = interval;
            header.StartTime = new Geo.Times.Time(startEpochTime);
            header.EndTime   = new Geo.Times.Time(endEpoch);
            header.Version   = secondColName.Length >= 7 ? 3.02 : 2.11;
            header.Comments.Add("Build from " + table.Name);
            var obsCodes = new Dictionary <SatelliteType, List <string> >();

            foreach (var name in colNames)
            {
                if (indexName == name)
                {
                    continue;
                }
                var prn = SatelliteNumber.Parse(name);
                if (!obsCodes.ContainsKey(prn.SatelliteType))
                {
                    obsCodes[prn.SatelliteType] = new List <string>();
                }
                var list = obsCodes[prn.SatelliteType];

                var code = name.Substring(4);

                if (!list.Contains(code))
                {
                    list.Add(code);
                }
            }
            header.ObsCodes          = obsCodes;
            header.MarkerType        = obsCodes.Count > 1 ? "M" : header.SatelliteTypes[0] + "";
            header.SiteInfo.SiteName = table.Name.Substring(0, 4);


            return(header);
        }
        protected override WeightedVector CreateInitAprioriParam()
        {
            var init = base.CreateInitAprioriParam();
            int i    = 0;

            foreach (var item in init.ParamNames)
            {
                if (item.Contains(Gnsser.ParamNames.Ambiguity))
                {
                    var prn  = SatelliteNumber.Parse(item);
                    var freq = this.CurrentMaterial[0][prn].FrequenceA;
                    init.Set(i, freq.ApproxAmbiguityLength, 10000);//100米精度
                }
                i++;
            }
            return(init);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 生成集合
        /// </summary>
        /// <returns></returns>
        public new SatSimpleClockCollection GetSatClockCollection()
        {
            SatSimpleClockCollection satClockCollection = new SatSimpleClockCollection(true, SourceCode);

            foreach (var kv in Data)
            {
                if (SatelliteNumber.IsPrn(kv.Key))
                {
                    var prn  = SatelliteNumber.Parse(kv.Key);
                    var list = satClockCollection.GetOrCreate(prn);
                    foreach (var item in this.Get(prn.ToString()))
                    {
                        list.Add(item);
                    }
                }
            }
            return(satClockCollection);
        }
Exemplo n.º 23
0
        private void button_inter_Click(object sender, EventArgs e)
        {
            if (sortedRecords != null &&
                sortedRecords.Count != 0)
            {
                double           interval    = Double.Parse(this.textBox_interval.Text);
                SatelliteNumber  PRN         = SatelliteNumber.Parse(this.comboBox_prn.SelectedItem.ToString());
                List <Ephemeris> fitedResult = new List <Ephemeris>();
                double           cacuCount   = (this.dateTimePicker_to.Value - this.dateTimePicker_from.Value).TotalSeconds / interval;
                for (int xi = 0; xi < cacuCount; xi++)
                {
                    Time gpsTime = sortedRecords[0].Time + interval * xi;
                    fitedResult.Add(coll.Get(PRN, gpsTime));
                }

                this.bindingSource1.DataSource = fitedResult;
            }
        }
Exemplo n.º 24
0
        private void button_filter_Click(object sender, EventArgs e)
        {
            if (this.comboBox_name.SelectedItem == null)
            {
                MessageBox.Show("请先读取数据。"); return;;
            }
            string name = this.comboBox_name.SelectedItem.ToString();

            from   = this.dateTimePicker_from.Value;
            to     = this.dateTimePicker_to.Value;
            Clocks = _clockFile.GetClockItems(name, Time.Parse(from), Time.Parse(to));
            this.bindingSource_clk.DataSource = Clocks;

            this.Ephemerides = sp3File.Gets(SatelliteNumber.Parse(name), Time.Parse(from), Time.Parse(to));

            this.bindingSource_sp3.DataSource = Ephemerides;

            ShowComparing();
        }
Exemplo n.º 25
0
        /// <summary>
        /// 尝试获取卫星编号。
        /// </summary>
        /// <param name="paramName"></param>
        /// <returns></returns>
        internal SatelliteNumber TryGetPrn(string paramName)
        {
            if (paramName == null)
            {
                return(SatelliteNumber.Default);
            }
            int    index = paramName.IndexOf("->");
            string str   = "";

            if (index == -1)
            {
                str = paramName.Substring(0, 3);
            }
            else
            {
                str = paramName.Substring(index + 2, 3);
            }

            return(SatelliteNumber.Parse(str));
        }
Exemplo n.º 26
0
        public override void UiToEntity()
        {
            base.UiToEntity();
            var val = enabledStringControl_RemoveSats.GetEnabledValue();

            Option.IsEnableRemoveSats = val.Enabled;
            Option.SatsToBeRemoved    = SatelliteNumberUtils.ParseString(val.Value);

            Option.IndicatedPrn                  = SatelliteNumber.Parse(this.enabledStringControl_IndicatedPrn.GetEnabledValue().Value);
            Option.IsIndicatedPrn                = this.enabledStringControl_IndicatedPrn.GetEnabledValue().Enabled;
            Option.MinSuccesiveEphemerisCount    = int.Parse(this.textBox_MinSuccesiveEphemerisCount.Text);
            Option.IsSwitchWhenEphemerisNull     = this.checkBox_IsSwitchWhenEphemerisNull.Checked;
            Option.VertAngleCut                  = double.Parse(this.textBox_angleCut.Text);
            Option.IsEphemerisRequired           = this.checkBox_IsEphemerisRequired.Checked;
            Option.IsRemoveOrDisableNotPassedSat = this.checkBox_IsRemoveOrDisableNotPassedSat.Checked;
            Option.IsDisableEclipsedSat          = this.checkBox_IsDisableEclipsedSat.Checked;
            Option.EphemerisInterpolationOrder   = this.namedIntControl_ephInterOrder.GetValue();
            Option.IsExcludeMalfunctioningSat    = this.checkBox_IsExcludeMalfunctioningSat.Checked;

            Option.IsConnectIgsDailyProduct = this.checkBox_IsConnectIgsDailyProduct.Checked;
        }
Exemplo n.º 27
0
        /// <summary>
        /// 精密单点定位结果构造函数。
        /// </summary>
        /// <param name="receiverInfo">接收信息</param>
        /// <param name="Adjustment">平差</param>
        /// <param name="paramNameBuilder">参数名称</param>
        public SingleFreqPppResult(
            EpochInformation receiverInfo,
            AdjustResultMatrix Adjustment, GnssParamNameBuilder paramNameBuilder
            )
            : base(receiverInfo, Adjustment, paramNameBuilder)
        {
            //处理模糊度
            this.AmbiguityDic = new Dictionary <SatelliteNumber, double>();

            Vector vector = Adjustment.Corrected.CorrectedValue;

            foreach (var name in this.ParamNames)
            {
                if (name.Contains(Gnsser.ParamNames.AmbiguityLen))
                {
                    var prn = SatelliteNumber.Parse(name);
                    var val = vector[name];
                    AmbiguityDic.Add(prn, val);
                }
            }
        }
Exemplo n.º 28
0
        private void button_show_Click(object sender, EventArgs e)
        {
            if (coll == null)
            {
                Geo.Utils.FormUtil.ShowErrorMessageBox("读入数据先!"); return;
            }

            SatelliteNumber PRN = SatelliteNumber.Parse(this.comboBox_prn.SelectedItem.ToString());

            //每次取10个数计算
            sortedRecords = coll.Gets(PRN, new Time(this.dateTimePicker_from.Value), new Time(this.dateTimePicker_to.Value));

            if (sortedRecords.Count != 0)
            {
                sortedRecords.Sort();
                ////设置时间间隔
                this.dateTimePicker_from.Value = sortedRecords[0].Time.DateTime;
                this.dateTimePicker_to.Value   = sortedRecords[sortedRecords.Count - 1].Time.DateTime;
            }
            this.bindingSource1.DataSource = sortedRecords;
        }
Exemplo n.º 29
0
        public override FcbOfUpd Parse(string[] items)
        {
            if (CurrentIndex <= 0)
            {
                Time time;
                if (!Time.TryParse(items[0], out time))
                {
                    return(null);
                }
            }
            var item = new FcbOfUpd();
            int i    = 0;

            item.Epoch    = Time.Parse(items[i++]);
            item.WnMarker = (items[i++]);
            item.BasePrn  = SatelliteNumber.Parse(items[i++]);
            item.Count    = int.Parse(items[i++]);
            //item.PrnsString = (items[i++]);
            int length = items.Length;

            for (int j = i; j < length; j++)
            {
                var prn = new SatelliteNumber(j - i + 1, SatelliteType.G);
                var val = RmsedNumeral.Parse(items[j]);
                //double rms = 0.0001;
                //int rmsIndex = j + FcbOfUpdFile.TotalGpsSatCount;
                //if(items.Length > rmsIndex)
                //{
                //    rms = Double.Parse(items[rmsIndex]);
                //}

                item.Data.Add(prn, val);// new RmsedNumeral(val,rms));
            }
            //foreach (var prn in item.Prns)
            //{
            //    item.Data.Add(prn, Double.Parse(items[i++]));
            //}

            return(item);
        }
Exemplo n.º 30
0
        /// <summary>
        /// 获取失败的卫星,具有周跳的,已经进行了降权,因此不返回。
        /// </summary>
        /// <returns></returns>
        public List <SatelliteNumber> GetBadPrns(BaseGnssResult product)
        {
            List <SatelliteNumber> badPrns = new List <SatelliteNumber>();
            var csedPrns = product.Material.UnstablePrns;//忽略周跳卫星的检查


            var postResiduals = product.ResultMatrix.PostfitResidual;

            if (product is NetDoubleDifferPositionResult || product is DualSiteEpochDoubleDifferResult)
            {
                postResiduals = postResiduals.FilterContains(ParamNames.DoubleDiffer + ParamNames.PhaseL);

                var collection = GetBadElementResidual(postResiduals);

                foreach (var item in collection)
                {
                    var name = NetDoubleDifferName.Parse(item);
                    AddToBadPrns(badPrns, csedPrns, name.RovPrn);
                }
            }
            else if (product.Material is EpochInformation)
            {
                var collection = GetBadElementResidual(postResiduals);
                foreach (var item in collection)
                {
                    SatelliteNumber prn = SatelliteNumber.Parse(item);
                    if (prn.PRN == 0)
                    {
                        continue;
                    }

                    AddToBadPrns(badPrns, csedPrns, prn);
                }
            }


            return(badPrns);
        }