Got one of the dual extruder switching tests passing

Tool change stream tracking requested temps
Made printer use settings for settings rather than keeping a copy
Moved getting a line without checksum to GCodeFile so it can be re-used
This commit is contained in:
Lars Brubaker 2019-03-25 17:55:52 -07:00 committed by LarsBrubaker
parent e7fe7bb8da
commit cae6a7679b
8 changed files with 112 additions and 156 deletions

View file

@ -131,6 +131,25 @@ namespace MatterControl.Printing
return GetFirstNumberAfter(stringToCheckAfter, stringWithNumber, ref readValue, out _, startIndex, stopCheckingString);
}
public static string GetLineWithoutChecksum(string inLine)
{
if (inLine.StartsWith("N"))
{
int lineNumber = 0;
if (GCodeFile.GetFirstNumberAfter("N", inLine, ref lineNumber, out int numberEnd))
{
var outLine = inLine.Substring(numberEnd).Trim();
int checksumStart = outLine.IndexOf('*');
if (checksumStart != -1)
{
return outLine.Substring(0, checksumStart);
}
}
}
return inLine;
}
public static bool GetFirstNumberAfter(string stringToCheckAfter, string stringWithNumber, ref int readValue, out int numberEnd, int startIndex = 0, string stopCheckingString = ";")
{
double doubleValue = readValue;