private void Message(string message) { string m = message + Path.GetFileName(_sendingFileName); GRBLMachinePlugin.Log("\n" + m); ThisApplication.AddLogMessage(m); }
public override void Draw() { CamBam.CAD.Line line = new CamBam.CAD.Line(new Point2F(this.X1, this.Y1), new Point2F(this.X2, this.Y2)); ThisApplication.AddLogMessage(3, string.Format("Add new line ({0}, {1}) ({2}, {3})", this.X1, this.Y1, this.X2, this.Y2)); CamBam.UI.CamBamUI.MainUI.InsertEntity(line); }
public override void Draw() { Point2F point = new Point2F(this.CenterX, this.CenterY); CamBam.CAD.Circle rect = new CamBam.CAD.Circle(point, this.Radius); ThisApplication.AddLogMessage(3, string.Format("Add new circle ({0}, {1}) Radius={2}", this.CenterX, this.CenterY, this.Radius)); CamBam.UI.CamBamUI.MainUI.InsertEntity(rect); }
public void DrawSVGFile() { ThisApplication.AddLogMessage(4, ">> DrawSVGFile()"); this.Groups.ForEach(g => { g.Draw(); }); ThisApplication.AddLogMessage(4, "<< DrawSVGFile"); }
public override void Draw() { Point3F point = new Point3F(this.X, this.Y, 0); PolyRectangle rect = new PolyRectangle(point, this.Width, this.Height); rect.CornerRadius = this.RX; ThisApplication.AddLogMessage(3, string.Format("Add new rect ({0}, {1}) W={2} H={3}", this.X, this.Y, this.Width, this.Height)); CamBam.UI.CamBamUI.MainUI.InsertEntity(rect); }
private void ProcessGroups(List <XElement> groups) { ThisApplication.AddLogMessage(4, ">> DrawSVGFile()"); groups.ForEach(g => { Group group = new Group(g); this.Groups.Add(group); }); ThisApplication.AddLogMessage(4, "<< DrawSVGFile"); }
private static void ProcessSVGFilesImport(List <string> files) { ThisApplication.AddLogMessage(4, string.Format(">> ProcessSVGFileImport({0})", string.Join(",", files.ToArray()))); files.ForEach(f => { SVGFile svg = new SVGFile(f); svg.DrawSVGFile(); }); ThisApplication.AddLogMessage(4, "<< ProcessSVGFileImport"); }
private void GotoMouse_Click(object sender, EventArgs e) { MoveToLocationMode editMode = new MoveToLocationMode(CamBamUI.MainUI.ActiveView); editMode.DefaultValue = (object)null; editMode.Prompt = "Select Move Destination"; editMode.OnReturnOK += (o, ea) => { Point3F moveDelta = editMode.MoveDestination - editMode.MoveSource; ThisApplication.AddLogMessage("MoveDelta = " + moveDelta); ConnectionExpander.WriteCOMPortFmt("$J=G91 G21 X{0:+#;-#;+0} Y{1:+#;-#;+0} F4000", moveDelta.X, moveDelta.Y); }; CamBamUI.MainUI.ActiveView.SetEditMode((EditMode)editMode); CamBamUI.MainUI.ActiveView.RepaintEditMode(); }
public void Draw() { ThisApplication.AddLogMessage(4, ">> Draw()"); if (!CamBam.UI.CamBamUI.MainUI.ActiveView.CADFile.Layers.ContainsKey(this.Name)) { CamBam.UI.CamBamUI.MainUI.ActiveView.CADFile.CreateLayer(this.Name); } CamBam.UI.CamBamUI.MainUI.ActiveView.CADFile.SetActiveLayer(this.Name); this.Elements.ForEach(l => l.Draw()); ThisApplication.AddLogMessage(4, "<< Draw"); }
private void ProcessSVGFile() { ThisApplication.AddLogMessage(4, string.Format(">> ProcessSVGFile({0})", this.FileName)); List <XElement> groups = new List <XElement>(); XDocument XD = XDocument.Load(this.FileName); XElement SVG_Element = XD.Root; groups = SVG_Element.Descendants("{http://www.w3.org/2000/svg}g").ToList(); if (groups != null && groups.Count > 0) { ProcessGroups(groups); } else { this.Groups.Add(new Group(SVG_Element)); } ThisApplication.AddLogMessage(4, "<< ProcessSVGFile"); }
public SVGFile(string fileName) { ThisApplication.AddLogMessage(4, string.Format(">> SVGFile({0})", fileName)); try { this.FileName = fileName; this.Groups = new List <Group>(); SVGFile.Provider = new NumberFormatInfo(); SVGFile.Provider.NumberDecimalSeparator = "."; ProcessSVGFile(); } catch (Exception ex) { ThisApplication.AddLogMessage(0, string.Format("Exception: {0} StackTrace: {1}", ex.Message, ex.StackTrace)); } ThisApplication.AddLogMessage(4, "<< SVGFile"); }
public override void Draw() { Polyline poly = new Polyline(); for (int i = 0; i < this.Points.Count; i++) { PathPoint point = this.Points[i]; switch (point.PType) { case PointType.M: case PointType.L: poly.Add(point.P); break; } } poly.Closed = this.Closed; ThisApplication.AddLogMessage(3, string.Format("Add new path (Number of points={0}, Closed={1})", this.Points.Count, this.Closed)); CamBam.UI.CamBamUI.MainUI.InsertEntity(poly); }
static public void err(string s, params object[] args) { ThisApplication.AddLogMessage("Trocho error: " + s, args); }
static public void warn(string s, params object[] args) { ThisApplication.AddLogMessage("Trocho warning: " + s, args); }
static public void log(string s, params object[] args) { ThisApplication.AddLogMessage(4, s, args); }