/// <summary> /// Notify the firmware that the file print has been stopped /// </summary> /// <param name="stopReason">Reason why the print has stopped</param> public static void SetPrintStopped(PrintStoppedReason stopReason) { _printStoppedReason = stopReason; using (_channels[CodeChannel.File].Lock()) { _channels[CodeChannel.File].InvalidateBuffer(false); } }
/// <summary> /// Notify the firmware that a print has been stopped /// </summary> /// <param name="to">Destination</param> /// <param name="reason">Reason why the print has been stopped</param> /// <returns>Number of bytes written</returns> public static int WritePrintStopped(Span <byte> to, PrintStoppedReason reason) { PrintStopped header = new PrintStopped { Reason = reason }; MemoryMarshal.Write(to, ref header); return(Marshal.SizeOf(header)); }
/// <summary> /// Notify the firmware that the file print has been stopped /// </summary> /// <param name="stopReason">Reason why the print has stopped</param> /// <returns>Asynchronous task</returns> public static async Task SetPrintStopped(PrintStoppedReason stopReason) { using (await _printStopppedReasonLock.LockAsync()) { _printStoppedReason = stopReason; } using (await _channels[CodeChannel.File].LockAsync()) { _channels[CodeChannel.File].InvalidateBuffer(false); } }
/// <summary> /// Notify the firmware that the file print has been stopped /// </summary> /// <param name="stopReason">Reason why the print has stopped</param> /// <returns>Asynchronous task</returns> public static async Task SetPrintStopped(PrintStoppedReason stopReason) { using (await _printStopppedReasonLock.LockAsync(Program.CancellationToken)) { _printStoppedReason = stopReason; } using (await _channels[CodeChannel.File].LockAsync()) { await _channels[CodeChannel.File].AbortFile(true, true); } }
/// <summary> /// Notify the firmware that the file print has been stopped /// </summary> /// <param name="stopReason">Reason why the print has stopped</param> public static void SetPrintStopped(PrintStoppedReason stopReason) { _printStoppedReason = stopReason; }