예제 #1
0
파일: Migo.cs 프로젝트: amzak/migolib
        public async Task <GCodeResultModel> ExecuteGCode(string[] lines)
        {
            var buffer = await CommandChain
                         .Start()
                         .ExecuteGCode(lines)
                         .ExecuteAsync()
                         .ConfigureAwait(false);

            await _readerWriter.Write(buffer)
            .ConfigureAwait(false);

            var result = await _readerWriter.Get(Parsers.GetGCodeResult)
                         .ConfigureAwait(false);

            return(result);
        }
예제 #2
0
파일: Migo.cs 프로젝트: amzak/migolib
        public async Task <ZOffsetModel> GetZOffset()
        {
            var buffer = await CommandChain
                         .Start()
                         .GetZOffset()
                         .ExecuteAsync()
                         .ConfigureAwait(false);

            await _readerWriter.Write(buffer)
            .ConfigureAwait(false);

            var result = await _readerWriter.Get(Parsers.GetZOffset)
                         .ConfigureAwait(false);

            return(result);
        }
예제 #3
0
파일: Migo.cs 프로젝트: amzak/migolib
        public async Task <ZOffsetModel> SetZOffset(double zOffset)
        {
            var chunks = CommandChain
                         .Start()
                         .SetZOffset(zOffset)
                         .GetZOffset()
                         .AsChunks();

            await _readerWriter.Write(chunks)
            .ConfigureAwait(false);

            var result = await _readerWriter.Get(Parsers.GetZOffset)
                         .ConfigureAwait(false);

            return(result);
        }
예제 #4
0
파일: Migo.cs 프로젝트: amzak/migolib
        public async Task <CurrentPositionResult> SetCurrentPosition(double x, double y, double z)
        {
            var buffer = await CommandChain
                         .Start()
                         .SetCurrentPosition(x, y, z)
                         .ExecuteAsync()
                         .ConfigureAwait(false);

            await _readerWriter.Write(buffer)
            .ConfigureAwait(false);

            var result = await _readerWriter.Get(Parsers.GetCurrentPosition)
                         .ConfigureAwait(false);

            return(result);
        }
예제 #5
0
파일: Migo.cs 프로젝트: amzak/migolib
        public async Task <PrinterInfoResult> GetPrinterInfo()
        {
            var buffer = await CommandChain
                         .Start()
                         .GetPrinterInfo()
                         .ExecuteAsync()
                         .ConfigureAwait(false);

            await _readerWriter.Write(buffer)
            .ConfigureAwait(false);

            var result = await _readerWriter.Get(Parsers.GetPrinterInfo)
                         .ConfigureAwait(false);

            return(result);
        }
예제 #6
0
파일: Migo.cs 프로젝트: amzak/migolib
        public async Task <StartPrintResult> StartPrint(string fileName)
        {
            var buffer = await CommandChain
                         .Start()
                         .StartPrint(fileName)
                         .ExecuteAsync()
                         .ConfigureAwait(false);

            await _readerWriter.Write(buffer)
            .ConfigureAwait(false);

            var result = await _readerWriter.Get(Parsers.StartPrintResult)
                         .ConfigureAwait(false);

            return(result);
        }