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); }
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); }
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); }
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); }
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); }
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); }