public override void Revert() { SensorPositionSetting data = new SensorPositionSetting(); if (this.oldValue == null) { if (System.IO.File.Exists(this.FilePath)) { this.oldValue = (SensorPositionSetting)SensorPositionSetting.Deserialize(this.FilePath); } else { this.oldValue = new SensorPositionSetting(); } } data = (SensorPositionSetting)this.oldValue; this.bolsterDepth = data.bolsterDepth; this.bolsterWidth = data.bolsterWidth; this.moldDepth = data.moldDepth; this.moldPressDepth = data.moldPressDepth; this.moldPressWidth = data.moldPressWidth; this.moldWidth = data.moldWidth; this.usedMold = data.usedMold; this.IsUpdated = false; }
public object Clone() { SensorPositionSetting ret = new SensorPositionSetting(); ret.BolsterWidth = this.BolsterWidth; ret.BolsterDepth = this.BolsterDepth; ret.UsedMold = this.UsedMold; ret.MoldWidth = this.MoldWidth; ret.MoldDepth = this.MoldDepth; ret.MoldPressWidth = this.MoldPressWidth; ret.MoldPressDepth = this.MoldPressDepth; if (this.PositionList != null) for (int i = 0; i < this.PositionList.Length; i++) ret.PositionList[i] = (PositionSetting)this.PositionList[i].Clone(); return ret; }
/// <summary> /// load content analyze data /// </summary> private void LoadContent() { bool selectAll = false; try { this.analyzeData.Desirialize_WithOut_Data(); } catch { } if (this.analyzeData.DataTagSetting != null) { this.tagSetting = this.analyzeData.DataTagSetting; } else { this.tagSetting = new DataTagSetting(); } if (this.analyzeData.MeasureSetting != null) { this.measSetting = this.analyzeData.MeasureSetting; } else { selectAll = true; this.measSetting = new MeasureSetting(); } if (this.analyzeData.TagChannelRelationSetting != null) { this.relationSetting = this.analyzeData.TagChannelRelationSetting; } else { this.relationSetting = new TagChannelRelationSetting(); } if (this.analyzeData.ChannelsSetting != null) { this.chSetting = this.analyzeData.ChannelsSetting; } else { this.chSetting = new ChannelsSetting(); } if (this.analyzeData.PositionSetting != null) { this.positionSetting = this.analyzeData.PositionSetting; } else { this.positionSetting = new SensorPositionSetting(); } if (selectAll) { for (int i = 1; i < this.relationSetting.RelationList.Length; i++) { this.measSetting.MeasTagList[i - 1] = this.relationSetting.RelationList[i].TagNo_1; } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmLocationSetting_Load(object sender, EventArgs e) { try { AppResource.SetControlsText(this); //システム設定からチャンネル設定を取得 this.chSettings = SystemSetting.ChannelsSetting; //システム設定からセンサ位置情報を取得 if (SystemSetting.PositionSetting != null) { this.sensorPositionSetting = SystemSetting.PositionSetting; } else { this.sensorPositionSetting = new SensorPositionSetting(); this.sensorPositionSetting.PositionList = new PositionSetting[10]; for (int i = 0; i < this.sensorPositionSetting.PositionList.Length; i++) { this.sensorPositionSetting.PositionList[i] = new PositionSetting(); this.sensorPositionSetting.PositionList[i].ChNo = -1; this.sensorPositionSetting.PositionList[i].X = -100; this.sensorPositionSetting.PositionList[i].Z = -100; this.sensorPositionSetting.PositionList[i].Way = PositionSetting.WayType.INVAILED; this.sensorPositionSetting.PositionList[i].Target = PositionSetting.TargetType.INVAILED; } } this.readSettingData(); this.setGridData(); frmLocationSetting2 win2 = new frmLocationSetting2(this.log); this.locationSetting2 = win2; this.locationSetting2.visibleKanagata(this.chkDispKanagata.Checked); win2.locationSetting = this; win2.setLocationSetting(this); win2.Show(this.Parent); win2.setDefault(this.getSettingStage(), this.settingList); win2.DoneInitailized += new EventHandler(win2_DoneInitailized); } catch (Exception ex) { ShowErrorMessage(ex); } }
/// <summary> /// load settings from xml files /// </summary> public static void LoadInstance() { MeasureSetting = new MeasureSetting(); string xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + MeasureSetting.FileName; if (System.IO.File.Exists(xmlFilePath)) { MeasureSetting = (MeasureSetting)MeasureSetting.Deserialize(xmlFilePath); if (MeasureSetting.Mode1_MeasCondition != null) { MeasureSetting.Mode1_MeasCondition.IsUpdated = false; } } else { MeasureSetting = new MeasureSetting() { FilePath = xmlFilePath }; } ChannelsSetting = new ChannelsSetting(); xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + ChannelsSetting.FileName; if (System.IO.File.Exists(xmlFilePath)) { ChannelsSetting = (ChannelsSetting)ChannelsSetting.Deserialize(xmlFilePath); } else { ChannelsSetting = new ChannelsSetting() { FilePath = xmlFilePath }; } ConstantSetting = new ConstantSetting(); xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + ConstantSetting.FileName; if (System.IO.File.Exists(xmlFilePath)) { ConstantSetting = (ConstantSetting)ConstantSetting.Deserialize(xmlFilePath); } else { ConstantSetting = new ConstantSetting() { FilePath = xmlFilePath }; } DataTagSetting = new DataTagSetting(); xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + DataTagSetting.FileName; if (System.IO.File.Exists(xmlFilePath)) { DataTagSetting = (DataTagSetting)DataTagSetting.Deserialize(xmlFilePath); } else { DataTagSetting = new DataTagSetting() { FilePath = xmlFilePath }; } RelationSetting = new TagChannelRelationSetting(); xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + TagChannelRelationSetting.FileName; if (System.IO.File.Exists(xmlFilePath)) { RelationSetting = (TagChannelRelationSetting)TagChannelRelationSetting.Deserialize(xmlFilePath); } else { RelationSetting = new TagChannelRelationSetting() { FilePath = xmlFilePath }; } PositionSetting = new SensorPositionSetting(); xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + SensorPositionSetting.FileName; if (System.IO.File.Exists(xmlFilePath)) { PositionSetting = (SensorPositionSetting)SensorPositionSetting.Deserialize(xmlFilePath); } else { PositionSetting = new SensorPositionSetting() { FilePath = xmlFilePath }; } SystemConfig = new SystemConfig(); SystemConfig.LoadXmlFile(); HardInfoStruct = new HardInfoStruct(); HardInfoStruct.LoadXmlFile(); }