public ProjectCreationForm(GnsserProject Project) { InitializeComponent(); this.Project = Project; this.ObjectToUi(); }
public void ObjectToUi() { if (Project == null) { Project = new GnsserProject(); } this.Text = Project.ProjectName + "的信息"; this.textBox_projFilePath.Text = Project.ProjectFilePath; this.textBox_ProjName.Text = this.Project.ProjectName; this.timePeriodControl1.TimeFrom = this.Project.Session.Start.DateTime; this.timePeriodControl1.TimeTo = this.Project.Session.End.DateTime; this.multiGnssSystemSelectControl1.SetSatelliteTypes(this.Project.SatelliteTypes); this.directoryProjectDirectory.Path = this.Project.ProjectDirectory; this.directoryObservationDirectory.Path = this.Project.ObservationDirectory; this.directoryCommonDirectory.Path = this.Project.CommonDirectory; this.directoryMiddleDirectory.Path = this.Project.MiddleDirectory; this.directoryOutputDirectory.Path = this.Project.OutputDirectory; this.directoryRevisedObsDirectory.Path = this.Project.RevisedObsDirectory; this.directorySelectionControlParam.Path = this.Project.ParamDirectory; this.directorySelectionControl1Script.Path = this.Project.ScriptDirectory; }
public ProjectEditForm(GnsserProject Project) { InitializeComponent(); this.button_saveOrCreate.Text = "修改"; this.Project = Project; projectInfoControl1.EntityToUi(); }
/// <summary> /// 是否变化 /// </summary> private void ReadAndShow() { var path = Project.ProjectFilePath; Geo.IO.ConfigReader reader = new Geo.IO.ConfigReader(path); var config = reader.Read(); Project = new GnsserProject(config); ObjectToUi(); }
public void EntityToUi() { if (Entity == null) { Entity = new GnsserProject(); } this.Text = Entity.ProjectName + "的信息"; this.textBox_ProjName.Text = this.Entity.ProjectName; this.timePeriodControl1.TimeFrom = this.Entity.Session.Start.DateTime; this.timePeriodControl1.TimeTo = this.Entity.Session.End.DateTime; this.textBox_projDirectory.Text = this.Entity.ProjectDirectory; this.multiGnssSystemSelectControl1.SetSatelliteTypes(this.Entity.SatelliteTypes); }
/// <summary> /// 执行 /// </summary> /// <returns></returns> public override bool Do() { var reader = new IoParamReader(this.OperationInfo.ParamFilePath); reader.ItemSpliters = new string[] { "\t" }; foreach (var item in reader) { this.CurrentParam = item; if (File.Exists(item.OutputPath)) { if (item.IsOverwrite) { this.StatedMessage = StatedMessage.Processing; this.StatedMessage.Message = "文件(夹)已存在,即将覆盖 " + item.OutputPath; this.OnStatedMessageProduced(); } else { this.StatedMessage = StatedMessage.Processing; this.StatedMessage.Message = "文件(夹)已存在,操作取消 " + item.OutputPath; this.OnStatedMessageProduced(); } } string directory = Geo.Utils.FileUtil.GetDirectory(item.OutputPath); GnsserProject Project = new GnsserProject(); Project.ProjectDirectory = directory; Project.CheckOrCreateProjectDirectories(); //添加工作流 Project.SetWorkflowFiles(item.InputPath); Project.SaveToFile(); this.StatedMessage = StatedMessage.Processing; this.StatedMessage.Message = "已在 " + directory + " 创建工程目录 "; this.OnStatedMessageProduced(); //if (Geo.Utils.FileUtil.MoveFileOrDirectory(key.InputPath, key.OutputPath, key.IsOverwrite)) //{ // this.StatedMessage = StatedMessage.Processing; // this.StatedMessage.Message = "已移动 " + key.InputPath + " 到 " + key.OutputPath; // this.OnStatedMessageProduced(); //} } return(true); }
public void UiToObject() { if (Project == null) { Project = new GnsserProject(); } this.Project.ProjectName = this.textBox_ProjName.Text.Trim(); this.Text = Project.ProjectName + "的信息"; this.Project.Session = new Geo.Times.BufferedTimePeriod(this.timePeriodControl1.TimeFrom, this.timePeriodControl1.TimeTo); this.Project.SatelliteTypes = this.multiGnssSystemSelectControl1.SatelliteTypes; this.Project.ProjectDirectory = this.directoryProjectDirectory.Path; this.Project.ObservationDirectory = this.directoryObservationDirectory.Path; this.Project.CommonDirectory = this.directoryCommonDirectory.Path; this.Project.MiddleDirectory = this.directoryMiddleDirectory.Path; this.Project.OutputDirectory = this.directoryOutputDirectory.Path; this.Project.RevisedObsDirectory = this.directoryRevisedObsDirectory.Path; this.Project.ParamDirectory = this.directorySelectionControlParam.Path; this.Project.ScriptDirectory = this.directorySelectionControl1Script.Path; }