aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/trapq.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-07-23 12:46:14 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-07-29 16:35:30 -0400
commit07f0ecb4d059f653322db54064b36c9fc79bbb95 (patch)
treef3e3771e1713821a017a9d805831a70fb4fb6360 /klippy/chelper/trapq.c
parent45c232b2c724136aa9ef54b2858712640baacb3d (diff)
downloadkutter-07f0ecb4d059f653322db54064b36c9fc79bbb95.tar.gz
kutter-07f0ecb4d059f653322db54064b36c9fc79bbb95.tar.xz
kutter-07f0ecb4d059f653322db54064b36c9fc79bbb95.zip
trapq: Store toolhead.set_position() updates in trapq history
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/trapq.c')
-rw-r--r--klippy/chelper/trapq.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/klippy/chelper/trapq.c b/klippy/chelper/trapq.c
index eaeb5949..2d4c2093 100644
--- a/klippy/chelper/trapq.c
+++ b/klippy/chelper/trapq.c
@@ -197,6 +197,23 @@ trapq_finalize_moves(struct trapq *tq, double print_time)
}
}
+// Note a position change in the trapq history
+void __visible
+trapq_set_position(struct trapq *tq, double print_time
+ , double pos_x, double pos_y, double pos_z)
+{
+ // Flush all moves from trapq
+ trapq_finalize_moves(tq, NEVER_TIME);
+
+ // Add a marker to the trapq history
+ struct move *m = move_alloc();
+ m->print_time = print_time;
+ m->start_pos.x = pos_x;
+ m->start_pos.y = pos_y;
+ m->start_pos.z = pos_z;
+ list_add_head(&m->node, &tq->history);
+}
+
// Return history of movement queue
int __visible
trapq_extract_old(struct trapq *tq, struct pull_move *p, int max