Make sure we don't have a stale gcode file after re-slice

This commit is contained in:
Lars Brubaker 2021-02-24 16:57:14 -08:00
parent 59fbb34b60
commit acc72177d3

View file

@ -47,9 +47,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
private double lastSeenFeedRate;
private Vector3 preSwitchPosition;
private readonly IGCodeLineReader gcodeLineReader;
private readonly GCodeMemoryFile gCodeMemoryFile;
private readonly QueuedCommandsStream queuedCommandsStream;
private GCodeMemoryFile gCodeMemoryFile => gcodeLineReader?.GCodeFile as GCodeMemoryFile;
public int RequestedTool { get; set; }
private enum SendStates
@ -78,10 +79,6 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
: base(printer, internalStream)
{
this.gcodeLineReader = gcodeLineReader;
if (gcodeLineReader != null)
{
this.gCodeMemoryFile = gcodeLineReader.GCodeFile as GCodeMemoryFile;
}
this.queuedCommandsStream = queuedCommandsStream;
extruderCount = printer.Settings.GetValue<int>(SettingsKey.extruder_count);