示例#1
0
        public override void Stop()
        {
            JobBeginTimer.Stop();
            if (m_oGCodeReader != null)
            {
                m_oGCodeReader.Close();
            }

            aborted = true;
        }
示例#2
0
        public override bool Start(out List <string> start_gcode)
        {
            m_oGCodeReader = new GCodeBufferedFileReader(GCodeFilename, m_ulFastForward, out var fEStartingLocation);
            start_gcode    = null;
            if (!m_oGCodeReader.IsOpen)
            {
                return(false);
            }

            try
            {
                MaxLines = m_oGCodeReader.MaxLines;
                if (m_bSDOnly)
                {
                    Details.jobParams.estimatedTime = MaxLines / 50f;
                }
            }
            catch (NotImplementedException ex)
            {
                MaxLines = 0L;
            }
            JobBeginTimer.Stop();
            JobBeginTimer.Reset();
            Status            = JobStatus.Printing;
            CurrentLineNumber = m_ulFastForward;
            start_gcode       = new List <string>()
            {
                string.Format("N{0} M110", CurrentLineNumber % 65536UL)
            };
            if (m_ulFastForward != 0UL)
            {
                start_gcode.Insert(0, string.Format("G92 E{0}", fEStartingLocation));
            }

            return(true);
        }