itersolve: Rename scan_pre/_post to gen_steps_pre/post_active

Rename the variables to make it a little more clear what they do.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-12-10 15:53:50 -05:00
parent cff24b0220
commit 04b3603a1e
3 changed files with 10 additions and 9 deletions

View File

@ -152,7 +152,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time)
struct move *m = list_first_entry(&sk->tq->moves, struct move, node); struct move *m = list_first_entry(&sk->tq->moves, struct move, node);
while (last_flush_time >= m->print_time + m->move_t) while (last_flush_time >= m->print_time + m->move_t)
m = list_next_entry(m, node); m = list_next_entry(m, node);
double force_steps_time = sk->last_move_time + sk->scan_past; double force_steps_time = sk->last_move_time + sk->gen_steps_post_active;
for (;;) { for (;;) {
if (last_flush_time >= flush_time) if (last_flush_time >= flush_time)
return 0; return 0;
@ -162,11 +162,11 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time)
if (end > flush_time) if (end > flush_time)
end = flush_time; end = flush_time;
if (check_active(sk, m)) { if (check_active(sk, m)) {
if (sk->scan_future && start > last_flush_time) { if (sk->gen_steps_pre_active && start > last_flush_time) {
// Must generate steps leading up to stepper activity // Must generate steps leading up to stepper activity
force_steps_time = start; force_steps_time = start;
if (last_flush_time < start - sk->scan_future) if (last_flush_time < start - sk->gen_steps_pre_active)
last_flush_time = start - sk->scan_future; last_flush_time = start - sk->gen_steps_pre_active;
while (m->print_time > last_flush_time) while (m->print_time > last_flush_time)
m = list_prev_entry(m, node); m = list_prev_entry(m, node);
continue; continue;
@ -176,7 +176,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time)
if (ret) if (ret)
return ret; return ret;
sk->last_move_time = last_flush_time = end; sk->last_move_time = last_flush_time = end;
force_steps_time = end + sk->scan_past; force_steps_time = end + sk->gen_steps_post_active;
} else if (start < force_steps_time) { } else if (start < force_steps_time) {
// Must generates steps just past stepper activity // Must generates steps just past stepper activity
if (end > force_steps_time) if (end > force_steps_time)
@ -186,7 +186,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time)
return ret; return ret;
last_flush_time = end; last_flush_time = end;
} }
if (flush_time + sk->scan_future <= m->print_time + m->move_t) if (flush_time + sk->gen_steps_pre_active <= m->print_time + m->move_t)
return 0; return 0;
m = list_next_entry(m, node); m = list_next_entry(m, node);
} }

View File

@ -4,7 +4,7 @@
#include <stdint.h> // int32_t #include <stdint.h> // int32_t
enum { enum {
AF_X = 1 << 0, AF_Y = 1 << 1, AF_Z = 1 <<2, AF_X = 1 << 0, AF_Y = 1 << 1, AF_Z = 1 << 2,
}; };
struct stepper_kinematics; struct stepper_kinematics;
@ -17,9 +17,9 @@ struct stepper_kinematics {
struct stepcompress *sc; struct stepcompress *sc;
double last_flush_time, last_move_time; double last_flush_time, last_move_time;
double scan_past, scan_future;
struct trapq *tq; struct trapq *tq;
int active_flags; int active_flags;
double gen_steps_pre_active, gen_steps_post_active;
sk_calc_callback calc_position_cb; sk_calc_callback calc_position_cb;
sk_post_callback post_cb; sk_post_callback post_cb;

View File

@ -82,7 +82,8 @@ extruder_set_smooth_time(struct stepper_kinematics *sk, double smooth_time)
{ {
struct extruder_stepper *es = container_of(sk, struct extruder_stepper, sk); struct extruder_stepper *es = container_of(sk, struct extruder_stepper, sk);
double hst = smooth_time * .5; double hst = smooth_time * .5;
es->sk.scan_past = es->sk.scan_future = es->half_smooth_time = hst; es->half_smooth_time = hst;
es->sk.gen_steps_pre_active = es->sk.gen_steps_post_active = hst;
if (! hst) if (! hst)
return; return;
es->inv_smooth_time = 1. / smooth_time; es->inv_smooth_time = 1. / smooth_time;