aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-07-12 19:46:47 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-07-18 10:50:04 -0400
commitbf2330291835f8583fc9b393d07a15c15d0ae272 (patch)
treeb2f485469c5ff4f246b9923ffe0850f9245a06c5 /klippy
parente3c5638147c1e3136e0299d2c8e4b9924e61d40d (diff)
downloadkutter-bf2330291835f8583fc9b393d07a15c15d0ae272.tar.gz
kutter-bf2330291835f8583fc9b393d07a15c15d0ae272.tar.xz
kutter-bf2330291835f8583fc9b393d07a15c15d0ae272.zip
toolhead: No need to build entire look-ahead queue before homing
It's not necessary to fully build up the look-ahead queue prior to starting a "drip move" homing operation. Instead, allow the look-ahead queue to flush normally. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/toolhead.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index d6665bbf..d739e919 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -244,7 +244,6 @@ class ToolHead:
self.idle_flush_print_time = 0.
self.print_stall = 0
self.drip_completion = None
- self.drip_need_calc_print_time = False
# Setup iterative solver
ffi_main, ffi_lib = chelper.get_ffi()
self.cmove = ffi_main.gc(ffi_lib.move_alloc(), ffi_lib.free)
@@ -293,9 +292,6 @@ class ToolHead:
return self.print_time
if self.special_queuing_state == "Drip":
# In "Drip" state - wait until ready to send next move
- if self.drip_need_calc_print_time:
- self.drip_need_calc_print_time = False
- self._calc_print_time()
while 1:
if self.drip_completion.test():
raise DripModeEndSignal()
@@ -436,21 +432,19 @@ class ToolHead:
self.special_queuing_state = "Drip"
self.need_check_stall = self.reactor.NEVER
self.reactor.update_timer(self.flush_timer, self.reactor.NEVER)
- self.move_queue.set_flush_time(self.reactor.NEVER)
self.drip_completion = self.reactor.completion()
- self.drip_need_calc_print_time = True
# Split move into many tiny moves and queue them
num_moves = max(1, int(math.ceil(move.min_move_t / DRIP_SEGMENT_TIME)))
inv_num_moves = 1. / float(num_moves)
submove_d = [d * inv_num_moves for d in move.axes_d]
prev_pos = move.start_pos
- for i in range(num_moves-1):
- next_pos = [p + d for p, d in zip(prev_pos, submove_d)]
- self.move_queue.add_move(Move(self, prev_pos, next_pos, speed))
- prev_pos = next_pos
- self.move_queue.add_move(Move(self, prev_pos, move.end_pos, speed))
- # Transmit moves
+ self._calc_print_time()
try:
+ for i in range(num_moves-1):
+ next_pos = [p + d for p, d in zip(prev_pos, submove_d)]
+ self.move_queue.add_move(Move(self, prev_pos, next_pos, speed))
+ prev_pos = next_pos
+ self.move_queue.add_move(Move(self, prev_pos, move.end_pos, speed))
self.move_queue.flush()
except DripModeEndSignal as e:
self.move_queue.reset()