public ObsFileConvertOptionForm(ObsFileConvertOption option)
 {
     InitializeComponent();
     enumRadioControl_nameType.Init <RinexNameType>();
     enumCheckBoxControlObsTypes.Init <ObsTypes>();
     this.SetOption(option);
 }
Example #2
0
 public ObsFileConvertOption GetOrInitObsFileFormatOption()
 {
     if (ObsFileConvertOption == null)
     {
         ObsFileConvertOption = new ObsFileConvertOption();
     }
     ObsFileConvertOption.OutputDirectory = this.OutputDirectory;
     return(ObsFileConvertOption);
 }
Example #3
0
        private void Button_detailSetting_Click(object sender, EventArgs e)
        {
            this.ObsFileConvertOption = GetOrInitObsFileFormatOption();
            var form = new ObsFileConvertOptionForm(ObsFileConvertOption);

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.ObsFileConvertOption = form.Option;
            }
        }
Example #4
0
        protected override void DetailSetting()
        {
            this.ObsFileConvertOption = GetOrInitObsFileFormatOption();
            var form = new ObsFileConvertOptionForm(ObsFileConvertOption);

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.ObsFileConvertOption = form.Option;
            }
        }
Example #5
0
        protected override void Run(string inputPath)
        {
            ObsFileConvertOption opt = GetOrInitObsFileFormatOption();
            //opt.OutputDirectory = this.OutputDirectory;
            string subDir = Geo.Utils.PathUtil.GetSubDirectory(InputRawPathes, inputPath);

            ObsFileFormater ObsFileFormater = new ObsFileFormater(opt, inputPath);

            ObsFileFormater.SubDirectory = subDir;
            ObsFileFormater.Init();
            ObsFileFormater.Run();

            base.Run(inputPath);
        }
Example #6
0
        private void Run()
        {
            var InputRawPathes       = this.fileOpenControl1.FilePathes;
            ObsFileConvertOption opt = GetOrInitObsFileFormatOption();

            this.Invoke(new Action(() =>
            {
                this.progressBar1.Maximum = InputRawPathes.Length;
                this.progressBar1.Minimum = 0;
                this.progressBar1.Value   = 0;
                this.progressBar1.Step    = 1;
            }));

            if (IsParallel)
            {
                var             count           = namedIntControl_processCount.GetValue();
                ParallelOptions parallelOptions = new ParallelOptions()
                {
                    MaxDegreeOfParallelism = count
                };
                Parallel.ForEach(InputRawPathes, parallelOptions, (inputPath, state) =>
                {
                    if (IsCancel || this.backgroundWorker1.CancellationPending)
                    {
                        ShowInfo("Canceled at :" + inputPath); state.Stop();
                    }

                    string subDir = Gdp.Utils.PathUtil.GetSubDirectory(InputRawPathes, inputPath);

                    Process(subDir, opt, inputPath);
                });
            }
            else
            {
                foreach (var inputPath in InputRawPathes)
                {
                    if (IsCancel)
                    {
                        ShowInfo("Canceled at :" + inputPath);
                        break;
                    }
                    string subDir = Gdp.Utils.PathUtil.GetSubDirectory(InputRawPathes, inputPath);

                    Process(subDir, opt, inputPath);
                }

                Complete();
            }
        }
Example #7
0
        private void button_testobs_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter      = "Rinex Text|*.rnx;*.??o|All|*.*";;
            openFileDialog.Multiselect = true;

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string[] files = openFileDialog.FileNames;
                foreach (var filePath in files)
                {
                    var opt = new ObsFileConvertOption();
                    opt.IsEnableRinexVertion = true;
                    opt.Version = 3.02;
                    ObsFileFormater ObsFileFormater = new ObsFileFormater(opt, filePath);
                    ObsFileFormater.Init();
                    ObsFileFormater.Run();
                }
                Utils.FormUtil.ShowOkMessageBox("执行完毕!");
            }
        }
Example #8
0
        private void Process(string subDir, ObsFileConvertOption opt, string inputPath)
        {
            try
            {
                ShowInfo("processing :" + inputPath);

                ObsFileFormater ObsFileFormater = new ObsFileFormater(opt, inputPath);
                CurrentRunners.Add(ObsFileFormater);
                ObsFileFormater.SubDirectory = subDir;
                ObsFileFormater.Init();
                ObsFileFormater.Run();
                CurrentRunners.Remove(ObsFileFormater);
                this.Invoke(new Action(() =>
                {
                    this.progressBar1.PerformStep();
                    this.progressBar1.Refresh();
                }));
            }catch (Exception ex)
            {
                log.Error("转换出错:\t" + inputPath + "\t, " + ex.Message);
            }
        }
        private void EntityToUi()
        {
            if (Option == null)
            {
                Option = CreateNewModel();
            }
            this.fileOpenControl1IndicatedEphemeris.FilePath = Option.IndicatedEphemeris.Value;
            this.checkBox1IndicatedEphemeris.Checked         = Option.IndicatedEphemeris.Enabled;

            this.checkBox_IsUpperSiteName.Checked = Option.IsUpperSiteName;
            this.checkBox_IsUpperFileName.Checked = Option.IsUpperFileName;

            checkBox1IsConvertPhaseToLength.Checked          = Option.IsConvertPhaseToLength;
            checkBox1IsRemoveRedundantObsForIonoFree.Checked = Option.IsRemoveRedundantObsForIonoFree;
            checkBox1IsRemoveIonoFreeUnavaliable.Checked     = Option.IsRemoveIonoFreeUnavaliable;
            this.checkBox_IsUseFileNameAsSiteName.Checked    = Option.IsUseFileNameAsSiteName;

            this.enabledIntControl_SiteNameLength.SetEnabledValue(Option.SiteNameLength);
            var prnStr = SatelliteNumberUtils.GetString(Option.SatsToBeRemoved);

            enabledStringControl_RemoveSats.SetEnabledValue(new EnableString()
            {
                Enabled = Option.IsEnableRemoveSats, Value = prnStr
            });
            this.checkBox_enableCode.Checked       = Option.IsEnableObsCodes;
            this.checkBox_interval.Checked         = Option.IsEnableInterval;
            this.checkBox_enableTimePeriod.Checked = Option.IsEnableTimePeriod;
            this.timePeriodControl1.SetTimePerid(Option.TimePeriod);
            this.comboBox_version.Text = Option.Version.ToString();
            this.textBox_interval.Text = Option.Interval.ToString();
            this.checkBoxMinObsCodeAppearRatio.Checked = Option.IsEnableMinObsCodeAppearRatio;
            this.textBoxMinObsCodeAppearRatio.Text     = Option.MinObsCodeAppearRatio.ToString();

            this.checkBoxSatelliteTypes.Checked = Option.IsEnableSatelliteTypes;
            this.multiGnssSystemSelectControl1.SetSatelliteTypes(Option.SatelliteTypes);

            textBoxNotVacantCodes.Text     = Option.NotVacantCodes;
            checkBox_deleVacantSat.Checked = Option.IsDeleteVacantSat;
            Option.IsEnableObsTypes        = checkBox_enableCode.Checked;
            enumCheckBoxControlObsTypes.Select <ObsTypes>(Option.ObsTypes);

            enabledFloatControl1Section.SetEnabledValue(Option.EnabledSection);
            checkBoxIsRemoveZeroRangeSat.Checked      = Option.IsRemoveZeroRangeSat;
            this.checkBoxIsRemoveZeroPhaseSat.Checked = Option.IsRemoveZeroPhaseSat;

            this.checkBoxIsEnableAlignPhase.Checked = Option.IsEnableAlignPhase;
            this.checkBox1IsAmendBigCs.Checked      = Option.IsAmendBigCs;

            this.checkBox1IsReomveOtherCodes.Checked = Option.IsReomveOtherCodes;
            this.textBox1OnlyCodes.Text = Option.OnlyCodesString;
            this.enabledIntControl_removeEpochCount.SetEnabledValue(new EnableInteger()
            {
                Enabled = Option.IsEnableMinEpochCount, Value = Option.MinEpochCount
            });
            this.namedIntControl1MaxBreakCount.SetValue(this.Option.MaxBreakCount);
            this.checkBox_IsEnableRinexVertion.Checked = Option.IsEnableRinexVertion;
            this.enumRadioControl_nameType.SetCurrent <RinexNameType>(Option.RinexNameType);
            enabledFloatControl_SatCutOffAngle.SetEnabledValue(this.Option.SatCutOffAngle);


            this.checkBox_StrOfFrequenceNumToBeRemoved.Checked = Option.IsEnableRemoveIndicatedFrequence;
            namedStringControl_StrOfFrequenceNumToBeRemoved.SetValue(Option.StrOfFrequenceNumToBeRemoved);

            checkBox_XToP2Enabled.Checked = Option.IsUseXCodeAsPLWhenEmpty;
        }
Example #10
0
 private void SetOption(ObsFileConvertOption Option)
 {
     this.Option = Option;
     EntityToUi();
 }
Example #11
0
        public void UiToEntity()
        {
            if (Option == null)
            {
                Option = CreateNewModel();
            }

            Option.IsUpperFileName = this.checkBox_IsUpperFileName.Checked;
            Option.IsUpperSiteName = this.checkBox_IsUpperSiteName.Checked;
            Option.SiteNameLength  = this.enabledIntControl_SiteNameLength.GetEnabledValue();

            Option.IsConvertPhaseToLength = checkBox1IsConvertPhaseToLength.Checked;
            Option.IndicatedEphemeris     = new EnableString(this.fileOpenControl1IndicatedEphemeris.FilePath, this.checkBox1IndicatedEphemeris.Checked);

            Option.IsRemoveRedundantObsForIonoFree = checkBox1IsRemoveRedundantObsForIonoFree.Checked;
            Option.IsRemoveIonoFreeUnavaliable     = checkBox1IsRemoveIonoFreeUnavaliable.Checked;
            Option.IsUseFileNameAsSiteName         = this.checkBox_IsUseFileNameAsSiteName.Checked;

            Option.IsEnableRinexVertion = this.checkBox_IsEnableRinexVertion.Checked;
            var val = enabledStringControl_RemoveSats.GetEnabledValue();

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

            Option.IsEnableObsCodes = this.checkBox_enableCode.Checked;
            Option.IsEnableInterval = this.checkBox_interval.Checked;

            Option.IsEnableTimePeriod = this.checkBox_enableTimePeriod.Checked;
            Option.TimePeriod         = this.timePeriodControl1.TimePeriod;
            Option.Version            = double.Parse(this.comboBox_version.Text);
            Option.Interval           = double.Parse(this.textBox_interval.Text);

            Option.IsEnableMinObsCodeAppearRatio = this.checkBoxMinObsCodeAppearRatio.Checked;
            Option.MinObsCodeAppearRatio         = double.Parse(this.textBoxMinObsCodeAppearRatio.Text);

            Option.IsEnableSatelliteTypes = this.checkBoxSatelliteTypes.Checked;
            Option.SatelliteTypes         = this.multiGnssSystemSelectControl1.SatelliteTypes;

            Option.IsEnableObsTypes = checkBox_enableCode.Checked;
            Option.ObsTypes         = enumCheckBoxControlObsTypes.GetSelected <ObsTypes>();

            Option.IsRemoveZeroRangeSat = checkBoxIsRemoveZeroRangeSat.Checked;
            Option.IsRemoveZeroPhaseSat = this.checkBoxIsRemoveZeroPhaseSat.Checked;

            Option.NotVacantCodes    = textBoxNotVacantCodes.Text.Trim();
            Option.IsDeleteVacantSat = checkBox_deleVacantSat.Checked;
            Option.EnabledSection    = enabledFloatControl1Section.GetEnabledValue();

            Option.IsReomveOtherCodes = this.checkBox1IsReomveOtherCodes.Checked;
            Option.OnlyCodesString    = this.textBox1OnlyCodes.Text;
            Option.IsEnableAlignPhase = this.checkBoxIsEnableAlignPhase.Checked;
            Option.IsAmendBigCs       = this.checkBox1IsAmendBigCs.Checked;

            Option.IsEnableMinEpochCount = this.enabledIntControl_removeEpochCount.GetEnabledValue().Enabled;
            Option.MinEpochCount         = this.enabledIntControl_removeEpochCount.GetValue();
            this.Option.MaxBreakCount    = this.namedIntControl1MaxBreakCount.GetValue();
            this.Option.SatCutOffAngle   = enabledFloatControl_SatCutOffAngle.GetEnabledValue();
            Option.RinexNameType         = this.enumRadioControl_nameType.GetCurrent <RinexNameType>();

            Option.IsEnableRemoveIndicatedFrequence = this.checkBox_StrOfFrequenceNumToBeRemoved.Checked;
            Option.StrOfFrequenceNumToBeRemoved     = this.namedStringControl_StrOfFrequenceNumToBeRemoved.GetValue();
            Option.IsUseXCodeAsPLWhenEmpty          = checkBox_XToP2Enabled.Checked;
        }