Ejemplo n.º 1
0
 // This method will be called when the thread is started.
 public void DoWork()
 {
     RepetierEditor ed = Main.main.editor;
     
     Stopwatch sw = new Stopwatch();
     sw.Start();
     visual = new GCodeVisual();
     switch (ed.ShowMode)
     {
         case 0:
             visual.minLayer = 0;
             visual.maxLayer = 999999;
             break;
         case 1:
             visual.minLayer = visual.maxLayer = ed.ShowMinLayer;
             break;
         case 2:
             visual.minLayer = ed.ShowMinLayer;
             visual.maxLayer = ed.ShowMaxLayer;
             break;
     }
     visual.parseGCodeShortArray(Main.main.previewArray, true);
     Main.main.previewArray = null;
     visual.Reduce();
     //visual.stats();
     Main.main.newVisual = visual;
     Main.main.jobPreviewThreadFinished = true;
     Main.main.previewThread = null;
     sw.Stop();
     //Main.conn.log("Update time:" + sw.ElapsedMilliseconds, false, 3);
 }
Ejemplo n.º 2
0
        private void RedrawCurrentCheckpoint()
        {
            if (checkpoints.GetCurrent() != null && checkBoxPreviewCheckpoint.Checked)
            {
                Stopwatch sw = new Stopwatch();
                sw.Start();

                GCodeVisual gcodeVisual = new GCodeVisual();
                gcodeVisual.showSelection = true;
                gcodeVisual.minLayer = 0;
                gcodeVisual.maxLayer = 999999;
                Main.main.checkpointsView = new ThreeDView();
                Main.main.checkpointsView.editor = false;
                Main.main.checkpointsView.models.AddLast(gcodeVisual);
                Main.main.assign3DView();

                gcodeVisual.parseGCodeShortArray(ToGCodeShortArray(checkpoints.GetCurrent().GetCodeAlreadyExecuted()), false, 0);

                gcodeVisual.Reduce();

                sw.Stop();
            }
        }