public Toolpath(Toolpath tp) { Id = Guid.NewGuid(); Paths = new List <WPath>(); Name = tp.Name; PlaneRetractVertical = tp.PlaneRetractVertical; RapidZ = tp.RapidZ; SafeZ = tp.SafeZ; Tool = tp.Tool; Safety = tp.Safety; LinkPlane = tp.LinkPlane; IsPlanar = tp.IsPlanar; FlipWrist = tp.FlipWrist; for (int i = 0; i < tp.Paths.Count; ++i) { WPath p = new WPath(); for (int j = 0; j < tp.Paths[i].Count; ++j) { p.Add(new Waypoint(tp.Paths[i][j])); } Paths.Add(p); } }
public void AddTool(MachineTool t) { if (Tools.ContainsKey(t.Name)) { Tools[t.Name] = t; } else { Tools.Add(t.Name, t); } }
public override bool Equals(object obj) { if (obj as MachineTool != null) { MachineTool mt = obj as MachineTool; if (mt.Name == this.Name && mt.Number == this.Number && mt.OffsetNumber == this.OffsetNumber && mt.Length == this.Length && mt.Shape == this.Shape) { return(true); } } return(false); }
public void CreateHeader() { // Create headers Program.Add($"{PreComment}----------------------------------------------------------------{PostComment}{EOL}"); Program.Add($"{PreComment} Revision : 1 {PostComment}{EOL}"); Program.Add($"{PreComment} File name : {Name} {PostComment}{EOL}"); Program.Add($"{PreComment} Programmed by : {Author} {PostComment}{EOL}"); Program.Add($"{PreComment} Date : {Date} {PostComment}{EOL}"); Program.Add($"{PreComment} Program length : {ProgramTime} {PostComment}"); Program.Add($"{PreComment} Bounds min. : {BoundingBox.Min.X:F3} {BoundingBox.Min.Y:F3} {BoundingBox.Min.Z:F3} {PostComment}{EOL}"); Program.Add($"{PreComment} Bounds max. : {BoundingBox.Max.X:F3} {BoundingBox.Max.Y:F3} {BoundingBox.Max.Z:F3} {PostComment}{EOL}"); Program.Add($"{PreComment}{PostComment};"); Program.Add($"{PreComment}Tool # Offset # Name Diameter Length {PostComment}{EOL}"); foreach (var d in Tools) { MachineTool mt = d.Value; Program.Add($"{PreComment} {mt.Number} {mt.OffsetNumber} {mt.Name} {mt.Diameter:0.0} {mt.Length:0.000} {PostComment}{EOL}"); } Program.Add($"{PreComment}----------------------------------------------------------------{PostComment}{EOL}"); }