private static void readSeq(string line, StreamReader sr, Part part) { if (line.StartsWith("BorderSequence")) { part.Border = BorderSeq.LoadSeq(line); } else if (line.StartsWith("VdrillSequence")) { part.Vdrillings.Add(VdrillSeq.LoadSeq(line)); } else if (line.StartsWith("HDrillSequence")) { part.Hdrillings.Add(HdrillSeq.LoadSeq(line)); } else if (line.StartsWith("RouteSetMillSequence")) { RouteSeq rs = new RouteSeq(line); while (((line = sr.ReadLine()) != null) && (line.StartsWith("RouteSequence"))) { rs.AddRoute(line); } part.Routes.Add(rs); if (line != null) { readSeq(line, sr, part); } } else if (line.StartsWith("EndSequence")) { return; } }
private void drawVdrill(VdrillSeq vd) { if (!this.isMirrorPart) { g.DrawEllipse(vdrillPen, gap + (vd.VDrillX - vd.VDrillDiameter / 2) * ratio, gap + (vd.VDrillY - vd.VDrillDiameter / 2) * ratio, vd.VDrillDiameter * ratio, vd.VDrillDiameter * ratio); string index = vdrillInfos.Find(it => it.Diameter == vd.VDrillDiameter && it.Depth == vd.VDrillZ).Index.ToString(); g.DrawString(index, new Font("Arial", vdrillNumberSize), new SolidBrush(Color.Red), gap + (vd.VDrillX + vd.VDrillDiameter) * ratio, gap + (vd.VDrillY + vd.VDrillDiameter) * ratio); } else { g.DrawEllipse(vdrillPen, gap + (part.Border.PanelLength - vd.VDrillX - vd.VDrillDiameter / 2) * ratio, gap + (vd.VDrillY - vd.VDrillDiameter / 2) * ratio, vd.VDrillDiameter * ratio, vd.VDrillDiameter * ratio); string index = vdrillInfos.Find(it => it.Diameter == vd.VDrillDiameter && it.Depth == vd.VDrillZ).Index.ToString(); g.DrawString(index, new Font("Arial", vdrillNumberSize), new SolidBrush(Color.Red), gap + (part.Border.PanelLength - vd.VDrillX + vd.VDrillDiameter) * ratio, gap + (vd.VDrillY + vd.VDrillDiameter) * ratio); } }
public static VdrillSeq LoadSeq(string line) { VdrillSeq vds = new VdrillSeq(); var pars = line.Split(','); vds.VDrillX = float.Parse(pars[1]); vds.VDrillY = float.Parse(pars[2]); vds.VDrillZ = float.Parse(pars[3]); vds.VDrillX_Offset = float.Parse(pars[4]); vds.VDrillY_Offset = float.Parse(pars[5]); vds.VDrillDiameter = float.Parse(pars[6]); vds.VDrillToolName = pars[7]; //vds.VDrillFeedSpeed = float.Parse(pars[8]); //vds.VDrillEntrySpeed = pars[9]; //vds.VDrillBitType = int.Parse(pars[10]); vds.VDrillFirstDrillDone = pars[11]; vds.VDrillPreviousToolName = pars[12]; vds.VDrillCounter = pars[13]; return(vds); }