Fixed code related to position reads
Make sure we don't send a 105 while waiting for position Make sure we send a M114 immediately after G28, G29, G30 Better error timing for sending commands (less resend issues)
This commit is contained in:
parent
fb925df5c4
commit
b2515aa2ac
3 changed files with 71 additions and 56 deletions
|
|
@ -59,12 +59,19 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
{
|
||||
}
|
||||
|
||||
public void Add(string line)
|
||||
public void Add(string line, bool forceTopOfQueue = false)
|
||||
{
|
||||
// lock queue
|
||||
lock (locker)
|
||||
{
|
||||
commandQueue.Add(line);
|
||||
if (forceTopOfQueue)
|
||||
{
|
||||
commandQueue.Insert(0, line);
|
||||
}
|
||||
else
|
||||
{
|
||||
commandQueue.Add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,10 +44,11 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
|
||||
public override string ReadLine()
|
||||
{
|
||||
if (nextReadTimeMs < UiThread.CurrentTimerMs
|
||||
if (!PrinterConnectionAndCommunication.Instance.WatingForPositionRead
|
||||
&& nextReadTimeMs < UiThread.CurrentTimerMs
|
||||
&& PrinterConnectionAndCommunication.Instance.PrinterIsConnected)
|
||||
{
|
||||
nextReadTimeMs = UiThread.CurrentTimerMs + 1000;
|
||||
nextReadTimeMs = UiThread.CurrentTimerMs + 5000;
|
||||
return "M105";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue