Make sure we don't have the printer waiting for position before it is connected.

This commit is contained in:
Lars Brubaker 2017-02-14 11:42:48 -08:00
parent 3c571b562a
commit a206586736

View file

@ -2692,7 +2692,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication
else
{
int waitTimeInMs = 60000; // 60 seconds
if (waitingForPosition.IsRunning && waitingForPosition.ElapsedMilliseconds < waitTimeInMs)
if (waitingForPosition.IsRunning
&& waitingForPosition.ElapsedMilliseconds < waitTimeInMs
&& PrinterIsConnected)
{
// we are waiting for a position response don't print more
return;
@ -2706,7 +2708,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication
string[] splitOnSemicolon = currentSentLine.Split(';');
string trimedLine = splitOnSemicolon[0].Trim().ToUpper();
if (currentSentLine.Contains("M114"))
if (currentSentLine.Contains("M114")
&& PrinterIsConnected)
{
waitingForPosition.Restart();
}