private void FormWedge_FormClosing(object sender, FormClosingEventArgs e) { // UltraWedge wedge1 = new UltraWedge(); UTPosition position1 = new UTPosition(); if (EnsurePrm()) { //if (wedge != wedge1 && position1!=positions) //{ // if (MessageBox.Show("楔块参数已改变,是否保存到文件?", "确认", MessageBoxButtons.YesNo) == DialogResult.Yes) // { // btnSaveXml_Click(null, null); // } //} e.Cancel = true; this.Hide(); mainform.Getwedge(wedge); mainform.Getposition(positions); } else { e.Cancel = true; this.Hide(); } }
public ClassCouple(UltraProbe pro, UltraWedge wed, UTPosition pos, Groove gro, int startele, int skewflag) { probe = pro; wedge = wed; groove = gro; position = pos; grooveheight = groove.height.Sum(); beamfile = CoupleDelay(startele, skewflag); }
private void init() { tabControl1.Visible = true; cmbName.SelectedItem = null; GeneralFuc.ClearTextBox(this); mstxtDate.Text = "00000000"; wedge = new UltraWedge(); positions = new UTPosition(); openPath = ""; savePath = ""; }
public FormFocus(MainForm mainform, Groove gro, UltraWedge wed, UltraProbe pro, UTPosition pos) { InitializeComponent(); MultiLanguage.getNames(this); SetDefaultGate(); formgatesetting = new FormGateSetting(this, gateB); //Getpara(); this.mainform = mainform; groove = gro; wedge = wed; probe = pro; position = pos; grooveheight = groove.height.Sum(); AutoSetpara(); }
public BeamPara(ClassChanpara chanpara, Groove gro, UltraWedge wed, UltraProbe pro, UTPosition pos, GateInformation gate) { this.gate = gate; xd = chanpara.defectX; yd = chanpara.defectY; groove = gro; wedge = wed; probe = pro; position = pos; grooveheight = groove.height.Sum(); skewflag = GetSkewflag(chanpara.skew); if (chanpara.method == (int)PathMethod.Direct) { activele[0] = chanpara.activenb[0]; linepoint[0] = Direct(xd, yd, chanpara.interfaceAngle[0]); index = linepoint[0].x[1]; centerele[0] = Centerelement(index, chanpara.interfaceAngle[0], activele[0]); } else if (chanpara.method == (int)PathMethod.Reflect) { activele[0] = chanpara.activenb[0]; linepoint[0] = Reflect(xd, yd, chanpara.interfaceAngle[0]); index = linepoint[0].x[2]; centerele[0] = Centerelement(index, chanpara.interfaceAngle[0], activele[0]); } else if (chanpara.method == (int)PathMethod.Series) { activele[0] = chanpara.activenb[0]; activele[1] = chanpara.activenb[1]; linepoint[0] = Reflect(xd, yd, chanpara.interfaceAngle[0]); index = linepoint[0].x[2]; centerele[0] = Centerelement(index, chanpara.interfaceAngle[0], activele[0]); linepoint[1] = DoubleReflect(xd, yd, chanpara.interfaceAngle[1]); index = linepoint[1].x[3]; centerele[1] = Centerelement(index, chanpara.interfaceAngle[1], activele[1]); } CaculateFocuspoint(); beamfile = GetBeamfile(xd, yd, centerele, chanpara.interfaceAngle, chanpara.method); arrowpoint = GetArrow(linepoint, chanpara.method); GetPathtime(chanpara.method); }
private void btnOpenXml_Click(object sender, EventArgs e) { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Title = ""; openDialog.InitialDirectory = Application.StartupPath + "\\resources\\wedge"; openDialog.RestoreDirectory = false; if (openDialog.ShowDialog() == DialogResult.OK) { openPath = openDialog.FileName; //deserialize wedge = (UltraWedge)SystemConfig.ReadBase64Data(openPath, "WEDGE"); positions = (UTPosition)SystemConfig.ReadBase64Data(openPath, "POSITION"); //wedge =DeserializeFromXml(openPath, wedge); ClassToUI(); } }
private void cmbName_SelectedIndexChanged(object sender, EventArgs e) { if (cmbName.SelectedItem != null && isclick) { if (MessageBox.Show("是否载入参数", "确认", MessageBoxButtons.OKCancel) == DialogResult.OK) { string path = Application.StartupPath + "\\resources\\wedge\\" + cmbName.SelectedItem.ToString() + ".xml"; //deserialize wedge = (UltraWedge)SystemConfig.ReadBase64Data(path, "WEDGE"); positions = (UTPosition)SystemConfig.ReadBase64Data(path, "POSITION"); //wedge =DeserializeFromXml(openPath, wedge); ClassToUI(); openPath = path; isclick = false; int a = cmbName.SelectedIndex; if (a < 0) { a = 0; } else { cmbName.Items[a] = wedge.name; } } else { isclick = false; int a = cmbName.SelectedIndex; if (a < 0) { a = 0; } else { cmbName.Items[a] = wedge.name; } } } }
public void FormLoad() { string filename = "wedge"; string filepath = ""; filepath = SystemConfig.GlobalLoad(filename); if (filepath == "") { MessageBox.Show("楔块信息配置失败", "警告"); return; } //deserialize wedge = (UltraWedge)SystemConfig.ReadBase64Data(filepath, "WEDGE"); positions = (UTPosition)SystemConfig.ReadBase64Data(filepath, "POSITION"); //wedge =DeserializeFromXml(openPath, wedge); ClassToUI(); mainform.Getwedge(wedge); mainform.Getposition(positions); }