Exemplo n.º 1
0
        private void SliceEv(Slicer.eSliceEvent ev, int layer, int totallayers, SliceFile sf)
        {
            try
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new MethodInvoker(delegate() { SliceEv(ev, layer, totallayers, sf); }));
                }
                else
                {
                    switch (ev)
                    {
                    case Slicer.eSliceEvent.eSliceStarted:
                        SetMainMessage("Slicing Started");
                        break;

                    case Slicer.eSliceEvent.eLayerSliced:
                        break;

                    case Slicer.eSliceEvent.eSliceCompleted:
                        //show the gcode
                        ctlGcodeView1.Text = UVDLPApp.Instance().m_gcode.RawGCode;
                        ctl3DView1.SetNumLayers(totallayers);
                        ctlSliceView1.SetNumLayers(totallayers);
                        SetMainMessage("Slicing Completed");
                        String timeest = BuildManager.EstimateBuildTime(UVDLPApp.Instance().m_gcode);
                        SetTimeMessage("Estimated Build Time: " + timeest);
                        //show the slice in the slice view
                        ViewLayer(0, null, BuildManager.SLICE_NORMAL);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogError(ex.Message);
            }
        }