MaxLengthStream don't interpolate any position until we know the destination completely

Only build a movement string for the values we know the position of
initialize unknown positions to Unknown (rather than Zero)
Added get to check for fully known position
issue: MatterHackers/MCCentral#4681
Export making M114 assumptions about Z
This commit is contained in:
Lars Brubaker 2018-12-06 15:09:09 -08:00
parent 4a454a95ad
commit 4494ac8251
10 changed files with 103 additions and 50 deletions

View file

@ -38,7 +38,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
{
public class ProcessWriteRegexStream : GCodeStreamProxy
{
private PrinterMove currentMove = new PrinterMove();
private PrinterMove currentMove = PrinterMove.Unknown;
private static Regex getQuotedParts = new Regex(@"([""'])(\\?.)*?\1", RegexOptions.Compiled);
@ -97,7 +97,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
GCodeFile.GetFirstNumberAfter("Z", lineToSend, ref this.currentMove.position.Z);
GCodeFile.GetFirstNumberAfter("E", lineToSend, ref this.currentMove.extrusion);
// tell the steam pipeline what the actual printer position is
// tell the stream pipeline what the actual printer position is
this.SetPrinterPosition(this.currentMove);
}
@ -159,7 +159,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
public override void SetPrinterPosition(PrinterMove position)
{
currentMove = position;
this.currentMove.CopyKnowSettings(position);
internalStream.SetPrinterPosition(currentMove);
}
}