/**Add the chanpara*/ public void Addpara(FormModify formModify, int cancelflag) { modifyisopen = 0; if (cancelflag == 0) { double defectY = formModify.yd; double angle = formModify.angled; int channel = chanPara.Count; ClassChanpara chanpara = new ClassChanpara(); switch (groove.type) { case GrooveType.V: AddVgroove(defectY, angle, formModify.method); break; case GrooveType.X: AddXgroove(defectY, angle, formModify.method); break; case GrooveType.CRC: AddCRCgroove(defectY, angle, formModify.method); break; default: MessageShow.show("testblock type error", "坡口类型错误"); break; } BeamRefresh(); } }
public BeamPara(ClassChanpara chanpara, testBlock block, wedge wed, probe pro, position pos) { double xd = 0; double yd = 0; testblock = block; Wedge = wed; Probe = pro; Position = pos; activele = chanpara.activenb[0]; skewflag = GetSkewflag(chanpara.skew); if (chanpara.method == 0) { xd = chanpara.defectX; yd = chanpara.defectY; point = Direct(xd, yd, chanpara.interfaceAngle[0]); index = point.x[1]; } else if (chanpara.method == 1) { xd = chanpara.defectX; yd = 2 * testblock.BlockHeight - chanpara.defectY; point = Reflect(chanpara.defectX, chanpara.defectY, chanpara.interfaceAngle[0]); index = point.x[2]; } centerele = Centerelement(index, chanpara.interfaceAngle[0]); beamfile = Dealytime(xd, yd, centerele, chanpara.interfaceAngle[0]); }
public void Modifypara(FormModify formModify, int cancelflag) { panelModify.Visible = false; if (cancelflag == 0) { int i = paraGrid.CurrentRow.Index; int channel = (int)paraGrid.Rows[i].Cells["channel"].Value; double defectX = 0; double defectY = 0; double angle = 0; ClassChanpara Chanpara = new ClassChanpara(); angle = BeamPara.TurntoRadian(testblock.VAngle); defectX = formModify.xd; defectY = testblock.BlockHeight - defectX * Math.Tan(angle); chanPara[channel].defectAngle[0] = angle; chanPara[channel].interfaceAngle[0] = Chanpara.defectAngle[0] + testblock.VAngle - 90;; BeamPara beampara = new BeamPara(Chanpara, testblock, Wedge, Probe, Position); beamPara[channel] = beampara; beamlist[channel] = beampara.beamfile; chanPara[channel].index = beampara.index; chanPara[channel].element[0] = beampara.centerele; } }
public CoupleDetectioninfo(ClassChanpara chanpara) { type = SessionType.Couple; ID = 0; name = chanpara.name; coupling = true; this.gatedelay = new List <GateDelay>(); this.gatedelay = chanpara.gatedelay; }
/**Add the VGroovepara*/ public void AddVgroove(double yd, double angle, int method) { int skewflag = 0; ClassChanpara Chanpara; for (skewflag = 0; skewflag < 2; skewflag++) { Chanpara = new ClassChanpara(); Chanpara.config = (int)FocusConfig.Pulse_Echo; Chanpara.method = method; Chanpara.defectAngle = angle; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 32; Chanpara.wave = "shear"; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } if (method == (int)PathMethod.Reflect) { Chanpara.name = "HP" + "DS"; Chanpara.defectY = yd; Chanpara.defectX = (groove.height[0] - yd) * Math.Tan(BeamPara.TurntoRadian(groove.angle[0])); Chanpara.interfaceAngle[0] = Chanpara.defectAngle - groove.angle[0]; } else if (method == (int)PathMethod.Direct) { Chanpara.name = "ROOT"; Chanpara.defectY = yd; Chanpara.defectX = 0; Chanpara.interfaceAngle[0] = Chanpara.defectAngle; } BeamPara beampara = new BeamPara(Chanpara, groove, wedge, probe, position, gateB); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.delay = beampara.pathtime - beampara.gatebefore; Chanpara.range = 2 * beampara.gatebefore; Chanpara.element[0] = beampara.centerele[0] + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } }
/**Change the chanpara after modify*/ public void Modifypara(FormModify formModify, int cancelflag) { modifyisopen = 0; panelModify.Visible = false; if (cancelflag == 0) { int i = paraGrid.CurrentRow.Index; int channel = (int)paraGrid.Rows[i].Cells["channel"].Value; int method = 0; ClassChanpara Chanpara = new ClassChanpara(); method = chanPara[channel].method; chanPara[channel].defectAngle = formModify.angled; chanPara[channel].defectY = formModify.yd; switch (groove.type) { case GrooveType.V: ModifyVgroove(chanPara[channel].defectY, chanPara[channel].defectAngle, channel); break; case GrooveType.X: ModifyXgroove(chanPara[channel].defectY, chanPara[channel].defectAngle, channel); break; case GrooveType.CRC: ModifyCRCgroove(chanPara[channel].defectY, chanPara[channel].defectAngle, channel); break; default: MessageShow.show("testblock type error", "坡口类型错误"); break; } BeamPara beampara = new BeamPara(chanPara[channel], groove, wedge, probe, position, gateB); beamPara[channel] = beampara; beamlist[channel] = beampara.beamfile; chanPara[channel].delay = beampara.pathtime - beampara.gatebefore; chanPara[channel].range = 2 * beampara.gatebefore; chanPara[channel].index = beampara.index; chanPara[channel].element[0] = beampara.centerele[0]; if (method == (int)PathMethod.Series) { chanPara[channel].element[1] = beampara.centerele[1]; } BeamRefresh(); } }
public PADetectioninfo(ClassChanpara chanpara) { type = SessionType.PA; ID = 0; name = chanpara.name; delay = chanpara.delay; range = chanpara.range; carlibrawave = CarlibraWave; alarmwave = AlarmWave; supwave = SupWave; displaywave = DisplayWave; strip = true; bscan = true; coupling = false; }
/**Creat beamfile which is used now.*/ private void Getcurrentpara() { ClassChanpara Chanpara; int zoneindex = 0; double defectX = 0; double defectY = 0; double angle = 0; int skewflag = 0; for (zoneindex = 0; zoneindex < 4; zoneindex++) { for (skewflag = 0; skewflag < 2; skewflag++) { angle = BeamPara.TurntoRadian(groove.angle[0]); defectX = 4.5 - 1.25 * zoneindex; defectY = grooveheight - defectX * Math.Tan(angle); Chanpara = new ClassChanpara(); Chanpara.config = (int)FocusConfig.Pulse_Echo; Chanpara.method = (int)PathMethod.Reflect; Chanpara.name = "HP" + Convert.ToString(zoneindex) + "DS"; Chanpara.defectAngle = 90; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 32; Chanpara.wave = "shear"; Chanpara.defectX = defectX; Chanpara.defectY = defectY; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } Chanpara.interfaceAngle[0] = Chanpara.defectAngle + groove.angle[0] - 90; BeamPara beampara = new BeamPara(Chanpara, groove, wedge, probe, position, gateB); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.element[0] = beampara.centerele[0] + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } } }
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 btn_addcouple_Click(object sender, EventArgs e) { int i = 0; int skewflag = 0; int startele = 0; int curchancount = 0; ClassChanpara couplechan; ClassCouple couplebeam; for (skewflag = 0; skewflag < 2; skewflag++) { for (i = 0; i < 4; i++) { curchancount = chanPara.Count; couplechan = new ClassChanpara(); startele = i * 16 + 1; couplebeam = new ClassCouple(probe, wedge, position, groove, i * 16 + 1, skewflag); couplechan.config = (int)FocusConfig.Pulse_Echo; couplechan.name = "Couple" + i + GetLeft(skewflag); couplechan.zonetype = (int)ZoneType.Couple; if (skewflag == 0) { couplechan.skew = 90; } else { couplechan.skew = 270; } couplechan.activenb[0] = 16; couplechan.element[0] = startele; couplechan.gatedelay = couplebeam.gatedelay; chanPara.Add(couplechan); beamlist.Add(couplebeam.beamfile); } } DisplayGrid(); }
private void GetXgroovepara(AutoSet autoset) { ClassChanpara Chanpara; int skewflag = 0; int i = 0; int j = 0; for (i = 0; i < autoset.reflectcount; i++) { for (skewflag = 0; skewflag < 2; skewflag++) { Chanpara = new ClassChanpara(); Chanpara.config = (int)FocusConfig.Pulse_Echo; Chanpara.method = (int)PathMethod.Reflect; Chanpara.zonetype = (int)ZoneType.Fill; Chanpara.name = "Fill" + Convert.ToString(i) + GetLeft(skewflag); Chanpara.defectAngle = autoset.defectlist[i].defectangle; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 32; Chanpara.wave = "shear"; Chanpara.defectX = autoset.defectlist[i].defectX; Chanpara.defectY = autoset.defectlist[i].defectY; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } Chanpara.interfaceAngle[0] = Chanpara.defectAngle + groove.angle[0] - 90; BeamPara beampara = new BeamPara(Chanpara, groove, wedge, probe, position, gateB); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.delay = beampara.pathtime - beampara.gatebefore; Chanpara.range = 2 * beampara.gatebefore; Chanpara.element[0] = beampara.centerele[0] + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } } for (j = 0; j < autoset.directcount; j++) { for (skewflag = 0; skewflag < 2; skewflag++) { Chanpara = new ClassChanpara(); Chanpara.config = (int)FocusConfig.Pulse_Echo; Chanpara.method = (int)PathMethod.Direct; Chanpara.zonetype = (int)ZoneType.Root; Chanpara.name = "Root" + Convert.ToString(j) + GetLeft(skewflag); Chanpara.defectAngle = autoset.defectlist[i + j].defectangle; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 32; Chanpara.wave = "shear"; Chanpara.defectX = autoset.defectlist[i + j].defectX; Chanpara.defectY = autoset.defectlist[i + j].defectY; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } Chanpara.interfaceAngle[0] = Chanpara.defectAngle + groove.angle[0] - 90; BeamPara beampara = new BeamPara(Chanpara, groove, wedge, probe, position, gateB); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.delay = beampara.pathtime - beampara.gatebefore; Chanpara.range = 2 * beampara.gatebefore; Chanpara.element[0] = beampara.centerele[0] + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } } }
private void GetCRCgroovepara(AutoSet autoset) { ClassChanpara Chanpara; int skewflag = 0; int i = 0; int precount = 0; for (i = 0; i < autoset.seriescount; i++) { for (skewflag = 0; skewflag < 2; skewflag++) { Chanpara = new ClassChanpara(); Chanpara.config = (int)FocusConfig.Pitch_Catch; Chanpara.method = (int)PathMethod.Series; Chanpara.zonetype = (int)ZoneType.Fill; Chanpara.name = "Fill" + Convert.ToString(i) + GetLeft(skewflag); Chanpara.defectAngle = autoset.defectlist[i].defectangle; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 16; Chanpara.activenb[1] = 16; Chanpara.wave = "shear"; Chanpara.defectX = autoset.defectlist[i].defectX; Chanpara.defectY = autoset.defectlist[i].defectY; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } Chanpara.interfaceAngle[0] = Chanpara.defectAngle - 5; Chanpara.interfaceAngle[1] = Chanpara.defectAngle + 5; BeamPara beampara = new BeamPara(Chanpara, groove, wedge, probe, position, gateB); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.delay = beampara.pathtime - beampara.gatebefore; Chanpara.range = 2 * beampara.gatebefore; Chanpara.element[0] = beampara.centerele[0] + 64 * skewflag; Chanpara.element[1] = beampara.centerele[1] + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } } precount += i; for (i = 0; i < autoset.reflectcount; i++) { for (skewflag = 0; skewflag < 2; skewflag++) { Chanpara = new ClassChanpara(); Chanpara.config = (int)FocusConfig.Pulse_Echo; Chanpara.method = (int)PathMethod.Reflect; Chanpara.zonetype = (int)ZoneType.HP; Chanpara.name = "HP" + Convert.ToString(i) + GetLeft(skewflag); Chanpara.defectAngle = autoset.defectlist[i + precount].defectangle; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 32; Chanpara.wave = "shear"; Chanpara.defectX = autoset.defectlist[i + precount].defectX; Chanpara.defectY = autoset.defectlist[i + precount].defectY; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } Chanpara.interfaceAngle[0] = Chanpara.defectAngle + 45 - 90; BeamPara beampara = new BeamPara(Chanpara, groove, wedge, probe, position, gateB); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.delay = beampara.pathtime - beampara.gatebefore; Chanpara.range = 2 * beampara.gatebefore; Chanpara.element[0] = beampara.centerele[0] + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } } precount += i; for (i = 0; i < autoset.directcount; i++) { for (skewflag = 0; skewflag < 2; skewflag++) { Chanpara = new ClassChanpara(); Chanpara.config = (int)FocusConfig.Pulse_Echo; Chanpara.method = (int)PathMethod.Direct; Chanpara.defectAngle = autoset.defectlist[i + precount].defectangle; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 32; Chanpara.wave = "shear"; Chanpara.defectX = autoset.defectlist[i + precount].defectX; Chanpara.defectY = autoset.defectlist[i + precount].defectY; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } //Judge which direct zone if (Chanpara.defectAngle == 90) { Chanpara.name = "LCP" + Convert.ToString(i) + GetLeft(skewflag); Chanpara.zonetype = (int)ZoneType.LCP; Chanpara.interfaceAngle[0] = Chanpara.defectAngle + groove.angle[2] - 90; } else { Chanpara.name = "Root" + Convert.ToString(i) + GetLeft(skewflag); Chanpara.zonetype = (int)ZoneType.Root; Chanpara.interfaceAngle[0] = Chanpara.defectAngle; } BeamPara beampara = new BeamPara(Chanpara, groove, wedge, probe, position, gateB); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.delay = beampara.pathtime - beampara.gatebefore; Chanpara.range = 2 * beampara.gatebefore; Chanpara.element[0] = beampara.centerele[0] + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } } }
private void Getchannelpara() { ClassChanpara Chanpara; int zoneindex = 0; double defectX = 0; double defectY = 0; double angle = 0; int skewflag = 0; for (zoneindex = 0; zoneindex < 4; zoneindex++) { for (skewflag = 0; skewflag < 2; skewflag++) { angle = BeamPara.TurntoRadian(testblock.VAngle); defectX = 4.5 - 1.25 * zoneindex; defectY = testblock.BlockHeight - defectX * Math.Tan(angle); Chanpara = new ClassChanpara(); Chanpara.config = 0; Chanpara.txrx = 0; Chanpara.method = 1; Chanpara.name = "HP" + Convert.ToString(zoneindex) + "DS"; Chanpara.defectAngle[0] = 90; Chanpara.velocity = 3.26; Chanpara.activenb[0] = 32; Chanpara.wave = "shear"; Chanpara.defectX = defectX; Chanpara.defectY = defectY; if (skewflag == 0) { Chanpara.skew = 90; } else { Chanpara.skew = 270; } Chanpara.interfaceAngle[0] = Chanpara.defectAngle[0] + testblock.VAngle - 90; BeamPara beampara = new BeamPara(Chanpara, testblock, Wedge, Probe, Position); beamPara.Add(beampara); beamlist.Add(beampara.beamfile); Chanpara.element[0] = beampara.centerele + 64 * skewflag; Chanpara.index = beampara.index; chanPara.Add(Chanpara); } } //for (skewflag = 0; skewflag < 2; skewflag++) //{ // angle = BeamPara.TurntoRadian(testblock.VAngle); // defectX = 0.5; // defectY = testblock.BlockHeight - defectX * Math.Tan(angle); // Chanpara = new ClassChanpara(); // Chanpara.config = 0; // Chanpara.txrx = 0; // Chanpara.method = 0; // Chanpara.name = "ROOT"; // Chanpara.defectAngle[0] = 70; // Chanpara.velocity = 3.26; // Chanpara.activenb[0] = 32; // Chanpara.wave = "shear"; // Chanpara.defectX = defectX; // Chanpara.defectY = defectY; // if (skewflag == 0) // { // Chanpara.skew = 90; // } // else // { // Chanpara.skew = 270; // } // Chanpara.interfaceAngle[0] = Chanpara.defectAngle[0]; // BeamPara beampara = new BeamPara(Chanpara, testblock, Wedge, Probe, Position); // beamPara.Add(beampara); // beamlist.Add(beampara.beamfile); // Chanpara.element[0] = beampara.centerele + 64 * skewflag; // Chanpara.index = beampara.index; // chanPara.Add(Chanpara); //} }