/// <summary> /// 初始化对话框 /// </summary> private void InitializeForm() { comboBox_material.Items.AddRange(GetContr("Material").ToArray()); comboBox_material.SelectedIndex = 0; comboBox_Condition.Items.AddRange(GetContr("Condition").ToArray()); comboBox_Condition.SelectedIndex = 0; comboBox_eleType.Items.AddRange(GetContr("EleType").ToArray()); comboBox_remarks.Items.AddRange(GetContr("Remarks").ToArray()); comboBox_technology.Items.AddRange(GetContr("Technology").ToArray()); comboBox_technology.SelectedIndex = 1; comboBox_cam.Items.AddRange(GetContr("Templates").ToArray()); comboBox_crudeInter.Enabled = false; comboBox_crudeNum.Enabled = false; comboBox_duringInter.Enabled = false; comboBox_duringNum.Enabled = false; comboBox_fineInter.Text = "0.05"; comboBox_fineNum.Text = "1"; checkBox_fine.Checked = true; textBox_pitchYNum.Text = "1"; textBox_pitchXNum.Text = "1"; textBox_pitchX.Text = "0"; textBox_pitchY.Text = "0"; textBox_CH.Text = "18"; textBox_Ext.Text = "1"; SetPichContrShow(); this.textBox_name.Text = ElectrodeName.GetEleName(); CreatePreview(); }
/// <summary> /// 获取属性 /// </summary> private void GetEleInfo() { eleInfo.EleName = this.textBox_name.Text; eleInfo.PitchX = double.Parse(this.textBox_pitchX.Text); eleInfo.PitchXNum = int.Parse(this.textBox_pitchXNum.Text); eleInfo.PitchY = double.Parse(this.textBox_pitchY.Text); eleInfo.PitchYNum = int.Parse(this.textBox_pitchYNum.Text); eleInfo.EleSetValue[0] = double.Parse(this.textBox_eleX.Text); eleInfo.EleSetValue[1] = double.Parse(this.textBox_eleY.Text); eleInfo.EleSetValue[2] = double.Parse(this.textBox_eleZ.Text); eleInfo.Preparation[0] = int.Parse(this.textBox_preparationX.Text); eleInfo.Preparation[1] = int.Parse(this.textBox_preparationY.Text); eleInfo.Preparation[2] = int.Parse(this.textBox_preparationZ.Text); if (checkBox_crude.Checked) { string cru = this.comboBox_crudeInter.Text; string num = this.comboBox_crudeNum.Text; if (cru != "" && num != "") { eleInfo.CrudeInter = double.Parse(cru); eleInfo.CrudeNum = int.Parse(num); } } if (checkBox_during.Checked) { string cru = this.comboBox_duringInter.Text; string num = this.comboBox_duringNum.Text; if (cru != "" && num != "") { eleInfo.DuringInter = double.Parse(cru); eleInfo.DuringNum = int.Parse(num); } } if (checkBox_fine.Checked) { string cru = this.comboBox_fineInter.Text; string num = this.comboBox_fineNum.Text; if (cru != "" && num != "") { eleInfo.FineInter = double.Parse(cru); eleInfo.FineNum = int.Parse(num); } } eleInfo.Material = this.comboBox_material.Text; eleInfo.EleType = this.comboBox_eleType.Text; eleInfo.Condition = this.comboBox_Condition.Text; eleInfo.Extrudewith = double.Parse(this.textBox_Ext.Text); eleInfo.Ch = "CH" + this.textBox_CH.Text; string temp = ""; if (this.checkBox_rotate.Checked) { temp += "旋转电极"; } if (this.checkBox_clearEngle.Checked) { temp += "清角电极"; } if (this.checkBox_wedm.Checked) { temp += "线割电极"; } if (this.checkBox_clearGlitch.Checked) { temp += "去毛刺电极"; } if (this.checkBox_gate.Checked) { temp += "浇口电极"; } eleInfo.ElePresentation = temp; eleInfo.CamTemplate = this.comboBox_cam.Text; eleInfo.Technology = this.comboBox_technology.Text; eleInfo.Remarks = this.comboBox_remarks.Text; eleInfo.EleNumber = ElectrodeName.GetEleNumber(this.textBox_name.Text); eleInfo.ZDatum = this.checkBox1.Checked; }