예제 #1
0
        private void Message(string message)
        {
            string m = message + Path.GetFileName(_sendingFileName);

            GRBLMachinePlugin.Log("\n" + m);
            ThisApplication.AddLogMessage(m);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public void DrawSVGFile()
        {
            ThisApplication.AddLogMessage(4, ">> DrawSVGFile()");

            this.Groups.ForEach(g =>
            {
                g.Draw();
            });

            ThisApplication.AddLogMessage(4, "<< DrawSVGFile");
        }
예제 #5
0
        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);
        }
예제 #6
0
        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");
        }
예제 #7
0
        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");
        }
예제 #8
0
        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();
        }
예제 #9
0
        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");
        }
예제 #10
0
        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");
        }
예제 #11
0
        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");
        }
예제 #12
0
        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);
        }
예제 #13
0
파일: plug.cs 프로젝트: robgrz/matmill
 static public void err(string s, params object[] args)
 {
     ThisApplication.AddLogMessage("Trocho error: " + s, args);
 }
예제 #14
0
파일: plug.cs 프로젝트: robgrz/matmill
 static public void warn(string s, params object[] args)
 {
     ThisApplication.AddLogMessage("Trocho warning: " + s, args);
 }
예제 #15
0
파일: plug.cs 프로젝트: robgrz/matmill
 static public void log(string s, params object[] args)
 {
     ThisApplication.AddLogMessage(4, s, args);
 }