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:
parent
cff24b0220
commit
04b3603a1e
|
@ -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);
|
||||
while (last_flush_time >= m->print_time + m->move_t)
|
||||
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 (;;) {
|
||||
if (last_flush_time >= flush_time)
|
||||
return 0;
|
||||
|
@ -162,11 +162,11 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time)
|
|||
if (end > flush_time)
|
||||
end = flush_time;
|
||||
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
|
||||
force_steps_time = start;
|
||||
if (last_flush_time < start - sk->scan_future)
|
||||
last_flush_time = start - sk->scan_future;
|
||||
if (last_flush_time < start - sk->gen_steps_pre_active)
|
||||
last_flush_time = start - sk->gen_steps_pre_active;
|
||||
while (m->print_time > last_flush_time)
|
||||
m = list_prev_entry(m, node);
|
||||
continue;
|
||||
|
@ -176,7 +176,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time)
|
|||
if (ret)
|
||||
return ret;
|
||||
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) {
|
||||
// Must generates steps just past stepper activity
|
||||
if (end > force_steps_time)
|
||||
|
@ -186,7 +186,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time)
|
|||
return ret;
|
||||
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;
|
||||
m = list_next_entry(m, node);
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ struct stepper_kinematics {
|
|||
struct stepcompress *sc;
|
||||
|
||||
double last_flush_time, last_move_time;
|
||||
double scan_past, scan_future;
|
||||
struct trapq *tq;
|
||||
int active_flags;
|
||||
double gen_steps_pre_active, gen_steps_post_active;
|
||||
|
||||
sk_calc_callback calc_position_cb;
|
||||
sk_post_callback post_cb;
|
||||
|
|
|
@ -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);
|
||||
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)
|
||||
return;
|
||||
es->inv_smooth_time = 1. / smooth_time;
|
||||
|
|
Loading…
Reference in New Issue