public ObsFileSelectOptionForm(ObsFileSelectOption option) { InitializeComponent(); Init(); this.SetOption(option); }
public ObsFileSelectOption GetOrInitObsFileSelectOption() { if (ObsFileSelectOption == null) { ObsFileSelectOption = new ObsFileSelectOption(); } // ObsFileSelectOption.OutputDirectory = this.OutputDirectory; return(ObsFileSelectOption); }
private void Button_detailSetting_Click(object sender, EventArgs e) { this.ObsFileSelectOption = GetOrInitObsFileSelectOption(); var form = new ObsFileSelectOptionForm(ObsFileSelectOption); if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.ObsFileSelectOption = form.Option; } }
private void BackgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { var InputRawPathes = this.fileOpenControl1.FilePathes; ShowInfo("Start execution"); this.ObsFileSelectOption = GetOrInitObsFileSelectOption(); SelectedCount = 0; this.ObsFileSelector = new ObsFileSelector(ObsFileSelectOption, OutputDirectory); this.Invoke(new Action(() => { this.progressBar1.Maximum = InputRawPathes.Length; this.progressBar1.Minimum = 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, ObsFileSelectOption, inputPath); }); } else { foreach (var inputPath in InputRawPathes) { if (IsCancel) { ShowInfo("Canceled at :" + inputPath); break; } string subDir = Gdp.Utils.PathUtil.GetSubDirectory(InputRawPathes, inputPath); Process(subDir, ObsFileSelectOption, inputPath); } } }
private void Process(string subDir, ObsFileSelectOption opt, string inputPath) { ShowInfo("processing :" + inputPath); if (ObsFileSelector.Select(inputPath, subDir)) { SelectedCount++; } this.Invoke(new Action(() => { this.progressBar1.PerformStep(); this.progressBar1.Refresh(); })); }
public void UiToEntity() { if (Option == null) { Option = CreateNewModel(); } var spliter = new char[] { ',', ' ', '\n', '\t', '\r', ';' }; Option.IsEnableObsCodes = this.checkBox_enableCode.Checked; Option.IsEnableExcludeSiteNames = this.checkBox_enableExcludeSiteNames.Checked; Option.IsEnableIncludeSiteNames = this.checkBox_enableincludeSiteNames.Checked; Option.IsEnableCenterRegion = this.checkBox_enableRegionFilter.Checked; Option.IsEnableTimePeriod = this.checkBox_enableTimePeriod.Checked; Option.TimePeriod = this.timePeriodControl1.TimePeriod; Option.CenterRegion.Center = XYZ.Parse(this.textBox_centerXyz.Text); Option.CenterRegion.Radius = Double.Parse(this.textBox_radiusFromCenter.Text); Option.ObsCodes = new List <string>(this.textBox_obsCodes.Text.Split(spliter, StringSplitOptions.RemoveEmptyEntries)); Option.IncludeSiteNames = new List <string>(this.textBox_includeSiteNames.Text.Split(spliter, StringSplitOptions.RemoveEmptyEntries)); Option.ExcludeSiteNames = new List <string>(this.textBox_excludeSites.Text.Split(spliter, StringSplitOptions.RemoveEmptyEntries)); Option.IsNavCopy = checkBox_IsNavCopy.Checked; Option.MinEpochCount = int.Parse(this.textBox1MinEpochCount.Text); Option.IsEnableMinEpochCount = this.checkBox1MinEpochCount.Checked; Option.MinFileSizeMB = Double.Parse(this.textBox1MinFileSizeMB.Text); Option.IsEnableMinFileSizeMB = this.checkBox1MinFileSizeMB.Checked; Option.MinFrequencyCount = int.Parse(this.textBox1MinFrequencyCount.Text); Option.IsEnableMinFrequencyCount = this.checkBox1MinFrequencyCount.Checked; Option.MinSatCount = int.Parse(this.textBox1MinSatCount.Text); Option.MinRatioOfSatCount = double.Parse(this.textBox2MinSatCountRatio.Text); Option.IsEnableMinRatioOfSatCount = (this.checkBox1MinSatCount.Checked); this.Option.MultipathMp1 = enabledFloatControl_mp1Factor.GetEnabledValue(); this.Option.MultipathMp2 = enabledFloatControl_mp2Factor.GetEnabledValue(); Option.IsEnableSatelliteTypes = this.checkBox_enableSatelliteTypes.Checked; Option.SatelliteTypes = this.multiGnssSystemSelectControl1.SatelliteTypes; }
private void EntityToUi() { if (Option == null) { Option = CreateNewModel(); } this.checkBox_enableCode.Checked = Option.IsEnableObsCodes; this.checkBox_enableExcludeSiteNames.Checked = Option.IsEnableExcludeSiteNames; this.checkBox_enableincludeSiteNames.Checked = Option.IsEnableIncludeSiteNames; this.checkBox_enableRegionFilter.Checked = Option.IsEnableCenterRegion; this.checkBox_enableTimePeriod.Checked = Option.IsEnableTimePeriod; this.timePeriodControl1.SetTimePerid(Option.TimePeriod); this.textBox_centerXyz.Text = Option.CenterRegion.Center + ""; this.textBox_radiusFromCenter.Text = Option.CenterRegion.Radius + ""; this.textBox_obsCodes.Text = Gdp.Utils.StringUtil.GetFormatedString <string>(Option.ObsCodes, ","); this.textBox_includeSiteNames.Text = Gdp.Utils.StringUtil.GetFormatedString <string>(Option.IncludeSiteNames, ","); this.textBox_excludeSites.Text = Gdp.Utils.StringUtil.GetFormatedString <string>(Option.ExcludeSiteNames, ","); this.textBox1MinEpochCount.Text = Option.MinEpochCount + ""; this.checkBox1MinEpochCount.Checked = Option.IsEnableMinEpochCount; this.textBox1MinFileSizeMB.Text = Option.MinFileSizeMB + ""; this.checkBox1MinFileSizeMB.Checked = Option.IsEnableMinFileSizeMB; this.textBox1MinFrequencyCount.Text = Option.MinFrequencyCount + ""; this.checkBox1MinFrequencyCount.Checked = Option.IsEnableMinFrequencyCount; checkBox_IsNavCopy.Checked = Option.IsNavCopy; this.textBox1MinSatCount.Text = Option.MinSatCount + ""; this.textBox2MinSatCountRatio.Text = Option.MinRatioOfSatCount + ""; this.checkBox1MinSatCount.Checked = Option.IsEnableMinRatioOfSatCount; enabledFloatControl_mp1Factor.SetEnabledValue(this.Option.MultipathMp1); enabledFloatControl_mp2Factor.SetEnabledValue(this.Option.MultipathMp2); this.checkBox_enableSatelliteTypes.Checked = Option.IsEnableSatelliteTypes; this.multiGnssSystemSelectControl1.SetSatelliteTypes(Option.SatelliteTypes); }
private void SetOption(ObsFileSelectOption Option) { this.Option = Option; EntityToUi(); }