/**Set Vgroove Defect.*/ private void VGroove(Groove groove, double zonestep) { int i = 0; double prehigh = 0; Defectpoint defectpoint = new Defectpoint(); double reflecthigh = 0; double directhigh = 0; double reflectangle = 0; double[] reflectzone; double[] directzone; reflecthigh = groove.height[0]; directhigh = groove.height[1]; reflectangle = 90 - groove.angle[0]; reflectzone = Getzone(reflecthigh, zonestep, ref reflectcount); directzone = Getzone(directhigh, zonestep, ref directcount); seriescount = 0; //direct for (i = 0; i < reflectcount; i++) { defectpoint = new Defectpoint(); defectpoint.defectY = prehigh + reflectzone[i] / 2; defectpoint.defectX = (reflecthigh - defectpoint.defectY) / Math.Tan(BeamPara.TurntoRadian(reflectangle)); defectpoint.defectangle = 90; defectlist.Add(defectpoint); prehigh += reflectzone[i]; } prehigh = 0; for (i = 0; i < directcount; i++) { defectpoint = new Defectpoint(); defectpoint.defectY = reflecthigh + prehigh + directzone[i] / 2; defectpoint.defectX = 0; defectpoint.defectangle = 70; defectlist.Add(defectpoint); prehigh += directzone[i]; } }
/**Set CRCgroove Defect.*/ private void CRCGroove(Groove groove, double zonestep) { double h = groove.height.Sum(); //manual set CRC para int i = 0; int direct1count = 0; int direct2count = 0; double prehigh = 0; Defectpoint defectpoint = new Defectpoint(); double serieshigh = groove.height[0]; double reflecthigh = groove.height[1]; double direct1high = groove.height[2]; double direct2high = groove.height[3]; double seriesangle = BeamPara.TurntoRadian(groove.angle[0]); double reflectangle = BeamPara.TurntoRadian(groove.angle[1]); double directangle = BeamPara.TurntoRadian(groove.angle[2]); double[] reflectzone; double[] serieszone; double[] direct1zone; double[] direct2zone; reflectzone = Getzone(reflecthigh, zonestep, ref reflectcount); serieszone = Getzone(serieshigh, zonestep, ref seriescount); direct1zone = Getzone(direct1high, zonestep, ref direct1count); direct2zone = Getzone(direct2high, zonestep, ref direct2count); directcount = direct1count + direct2count; for (i = 0; i < seriescount; i++) { defectpoint = new Defectpoint(); defectpoint.defectY = prehigh + serieszone[i] / 2; defectpoint.defectX = reflecthigh * Math.Tan(reflectangle) + (serieshigh - defectpoint.defectY) * Math.Tan(seriesangle); defectpoint.defectangle = 45; defectlist.Add(defectpoint); prehigh += serieszone[i]; } prehigh = 0; for (i = 0; i < reflectcount; i++) { defectpoint = new Defectpoint(); defectpoint.defectY = serieshigh + prehigh + reflectzone[i] / 2; defectpoint.defectX = (reflecthigh + serieshigh - defectpoint.defectY) * Math.Tan(reflectangle); defectpoint.defectangle = 90; defectlist.Add(defectpoint); prehigh += reflectzone[i]; } prehigh = 0; for (i = 0; i < direct1count; i++) { defectpoint = new Defectpoint(); defectpoint.defectY = serieshigh + reflecthigh + prehigh + direct1zone[i] / 2; defectpoint.defectX = 0; defectpoint.defectangle = 70; defectlist.Add(defectpoint); prehigh += direct1zone[i]; } prehigh = 0; for (i = 0; i < direct2count; i++) { defectpoint = new Defectpoint(); defectpoint.defectY = serieshigh + reflecthigh + direct1high + prehigh + direct2zone[i] / 2; defectpoint.defectX = (defectpoint.defectY - (h - direct2high)) * Math.Tan(directangle); defectpoint.defectangle = 90; defectlist.Add(defectpoint); prehigh += direct2zone[i]; } }