Esempio n. 1
0
        // This event handler is where the actual, potentially time-consuming work is done.
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            switch (type)
            {
            case Graphic.SourceTypes.SVG:
            { GCodeFromSVG.ConvertFromFile(source, worker, e); break; }

            case Graphic.SourceTypes.DXF:
            { GCodeFromDXF.ConvertFromFile(source, worker, e); break; }

            case Graphic.SourceTypes.HPGL:
            { GCodeFromHPGL.ConvertFromFile(source, worker, e); break; }

            case Graphic.SourceTypes.CSV:
            { GCodeFromCSV.ConvertFromFile(source, worker, e); break; }

            case Graphic.SourceTypes.Drill:
            { GCodeFromDrill.ConvertFromFile(source, worker, e); break; }

            case Graphic.SourceTypes.Gerber:
            { GCodeFromGerber.ConvertFromFile(source, worker, e); break; }
            }
//            VisuGCode.xyzSize.addDimensionXY(Graphic.actualDimension);
//            VisuGCode.calcDrawingArea();                                // calc ruler dimension
        }
Esempio n. 2
0
        private void startConvertDrill(string source)
        {
            lastSource  = source;                       // store current file-path/name
            this.Cursor = Cursors.WaitCursor;
            string gcode = GCodeFromDrill.ConvertFile(source);

            if (gcode.Length > 2)
            {
                fCTBCode.Text = gcode;
                fCTBCode.UnbookmarkLine(fCTBCodeClickedLineLast);
                redrawGCodePath();
                SaveRecentFile(source);
                this.Text = appName + " | Source: " + source;
            }
            this.Cursor = Cursors.Default;
            updateControls();
        }