Only send M105/M27 during sd printing when not currently heating up

master
Gina Häußge 2013-06-09 17:08:12 +02:00
parent 90a1edbbcf
commit 5b15d42881
1 changed files with 11 additions and 6 deletions

View File

@ -560,6 +560,7 @@ class MachineCom(object):
tempRequestTimeout = timeout tempRequestTimeout = timeout
sdStatusRequestTimeout = timeout sdStatusRequestTimeout = timeout
startSeen = not settings().getBoolean(["feature", "waitForStartOnConnect"]) startSeen = not settings().getBoolean(["feature", "waitForStartOnConnect"])
heatingUp = False
while True: while True:
line = self._readline() line = self._readline()
if line == None: if line == None:
@ -606,10 +607,14 @@ class MachineCom(object):
pass pass
#If we are waiting for an M109 or M190 then measure the time we lost during heatup, so we can remove that time from our printing time estimate. #If we are waiting for an M109 or M190 then measure the time we lost during heatup, so we can remove that time from our printing time estimate.
if not 'ok' in line and self._heatupWaitStartTime != 0: if not 'ok' in line:
heatingUp = True
if self._heatupWaitStartTime != 0:
t = time.time() t = time.time()
self._heatupWaitTimeLost = t - self._heatupWaitStartTime self._heatupWaitTimeLost = t - self._heatupWaitStartTime
self._heatupWaitStartTime = t self._heatupWaitStartTime = t
else:
heatingUp = False
##~~ SD Card handling ##~~ SD Card handling
elif 'SD init fail' in line: elif 'SD init fail' in line:
@ -733,11 +738,11 @@ class MachineCom(object):
line = 'ok' line = 'ok'
if self.isSdPrinting(): if self.isSdPrinting():
if time.time() > tempRequestTimeout: if time.time() > tempRequestTimeout and not heatingUp:
self._sendCommand("M105") self._sendCommand("M105")
tempRequestTimeout = time.time() + 5 tempRequestTimeout = time.time() + 5
if time.time() > sdStatusRequestTimeout: if time.time() > sdStatusRequestTimeout and not heatingUp:
self._sendCommand("M27") self._sendCommand("M27")
sdStatusRequestTimeout = time.time() + 1 sdStatusRequestTimeout = time.time() + 1