示例#1
0
        protected override void OnWizardCompleted()
        {
            base.OnWizardCompleted();
            this.Enabled = false;

            var netFiles = GroupRinexFileWizardPage.Result;



            //ProgressBarWizardPage.Init(this.SelectFilePageControl.FilePathes.Length);
            //nFilePath = SelectFilePageControl.NFilePath;

            var            singlePpType = SelectPointPositionTypePage.GetCurrent <TwoSiteSolverType>();
            GnssSolverType type         = GnssSolverTypeHelper.GetGnssSolverType(singlePpType);

            if (Option == null)
            {
                Option = GnssProcessOptionManager.Instance[type];
            }
            Option.AdjustmentType                 = SelectAdjustmentPage.GetCurrent <AdjustmentType>();
            this.Option.IsUpdateStationInfo       = SiteInfoSetingPage.IsUpdateSiteInfo;
            this.Option.IsStationInfoRequired     = SiteInfoSetingPage.IsUpdateSiteInfo;
            this.Option.IsUpdateEstimatePostition = SiteInfoSetingPage.IsUpdateEpochSiteCoord;
            this.Option.PositionType              = SiteInfoSetingPage.PositionType;

            //this.Option.isup
            //ProgressBarWizardPage.Init(this.SelectFilePageControl.FilePathes.Length);
            backgroundWorker1.RunWorkerAsync();
        }
示例#2
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            log.Info("启动本地Ntrip数据传输");
            ReceivedByteCount = 0;
            string filePath = this.fileOpenControl1.FilePath;
            var    fileName = Path.GetFileName(filePath);

            FileInfo info = new FileInfo(filePath);

            progressBarComponent1.InitProcess(info.Length);

            RtcmFileNamer          = RtcmFileNamer.Parse(fileName);
            this.NtripMountPoint   = RtcmFileNamer.NtripMountPoint;
            RealTimeGnssDataWriter = new Ntrip.RealTimeGnssDataWriter(this.LocalDirectory, NtripMountPoint, RtcmFileNamer.Time);
            //解析器
            Rtcm3DataReceiver = new Rtcm.Rtcm3DataReceiver();
            RtcmDataParser    = new Rtcm.RtcmDataParser(NtripMountPoint);
            RealTimeGnssDataWriter.BindRealTimeGnssDataProvider(RtcmDataParser);

            IEphemerisService indicatedEph = null;

            if (System.IO.File.Exists(fileOpenControl_nav.FilePath))
            {
                indicatedEph = EphemerisDataSourceFactory.Create(fileOpenControl_nav.FilePath);
            }
            var type = GnssSolverTypeHelper.GetGnssSolverType(this.singleSiteGnssSolverTypeSelectionControl1.CurrentdType);

            RealTimeGnssPositioner = new RealTimeGnssPositioner(type, this.LocalDirectory, NtripMountPoint, RtcmFileNamer.Time);
            RealTimeGnssPositioner.BindRealTimeGnssDataProvider(this.RtcmDataParser);

            RealTimeGnssPositioner.EphemerisService = indicatedEph;

            Rtcm3DataReceiver.ContentReceived += Rtcm3DataReceiver_ContentReceived;


            BinaryReader reader    = new BinaryReader(new FileStream(filePath, FileMode.Open, FileAccess.Read), Encoding.ASCII);
            int          readCount = 100;
            List <Byte>  list      = new List <byte>();

            reader.BaseStream.Position = 0;
            while (!isStopLocalReading && reader.PeekChar() != -1)
            {
                var bt = reader.ReadByte();
                list.Add(bt);
                if (list.Count >= readCount)
                {
                    this.NTRIPCallBacktoUIThread(ResponseType.NtripClientIsReceivingData, "正在传送本地数据", list.ToArray());

                    list.Clear();

                    System.Threading.Thread.Sleep(3);
                }
            }

            if (RealTimeGnssPositioner != null && RealTimeGnssPositioner.Solver != null)
            {
                RealTimeGnssPositioner.Solver.TableTextManager.WriteAllToFileAndClearBuffer();
            }
        }
示例#3
0
        private void button_start_Click(object sender, EventArgs e)
        {
            var selectedSites = Geo.Utils.DataGridViewUtil.GetObjects <NtripStream>(dataGridView_site);

            if (selectedSites.Count == 0)
            {
                Geo.Utils.FormUtil.ShowWarningMessageBox("请选择测站后再试!"); return;
            }
            button_start.Enabled = false;

            var tables = new BaseDictionary <string, SourceTable>(Setting.NtripSourceManager.SourceTables);
            var table  = tables.First;
            var sites  = Setting.NtripSourceManager.CurrentCasterSites[selectedSites[0].CasterName];//tables.FirstKey];

            IEphemerisService indicatedEph = null;

            if (System.IO.File.Exists(fileOpenControl_nav.FilePath))
            {
                indicatedEph = EphemerisDataSourceFactory.Create(fileOpenControl_nav.FilePath);
            }

            var type = GnssSolverTypeHelper.GetGnssSolverType(this.singleSiteGnssSolverTypeSelectionControl1.CurrentdType);


            NtripRunner = new MultiSiteNtripRunner();
            foreach (var item in selectedSites)
            {
                if (NtripRunner.Contains(item.Mountpoint))
                {
                    continue;
                }

                var caster = Setting.NtripSourceManager.NtripCasters[item.CasterName];

                var         t      = tables.Get(item.CasterName);
                NtripOption option = new NtripOption();
                option.IsWriteToLocal      = this.checkBox_saveRawData.Checked;
                option.LocalDirectory      = this.directorySelectionControl1.Path;
                option.CasterIp            = caster.Host;
                option.CasterName          = item.CasterName;
                option.Port                = caster.Port;
                option.Username            = caster.UserName;
                option.Password            = caster.Password;
                option.PreferredMountPoint = item.Mountpoint;
                option.IsRequiresGGA       = t.Get(item.Mountpoint).Num11 == 1;
                var runner = new NtripRunner(option);
                runner.GnssSolverType = type;

                runner.InfoProduced        += NtripRunner_InfoProduced;
                runner.InstantInfoProduced += NtripRunner_InstantInfoProduced;
                NtripRunner.Add(item.Mountpoint, runner);
            }

            NtripRunner.Init();
            foreach (var runner in NtripRunner)
            {
                //runner.RealTimeGnssPositioner.EphemerisService = indicatedEph;
            }

            NtripRunner.Start();
        }