set_position => set_position_mm

This commit is contained in:
Scott Lahteine 2016-05-31 15:39:37 -07:00
parent 663d2463dc
commit 381bc6f0b0
4 changed files with 14 additions and 14 deletions

View file

@ -552,7 +552,7 @@ static void report_current_position();
if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_delta", current_position); if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_delta", current_position);
#endif #endif
calculate_delta(current_position); calculate_delta(current_position);
planner.set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); planner.set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
} }
#endif #endif
@ -1448,9 +1448,9 @@ inline void sync_plan_position() {
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position);
#endif #endif
planner.set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
} }
inline void sync_plan_position_e() { planner.set_e_position(current_position[E_AXIS]); } inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); }
inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); } inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
@ -1607,7 +1607,7 @@ static void setup_for_endstop_move() {
// Tell the planner where we ended up - Get this from the stepper handler // Tell the planner where we ended up - Get this from the stepper handler
zPosition = stepper.get_axis_position_mm(Z_AXIS); zPosition = stepper.get_axis_position_mm(Z_AXIS);
planner.set_position( planner.set_position_mm(
current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[X_AXIS], current_position[Y_AXIS], zPosition,
current_position[E_AXIS] current_position[E_AXIS]
); );
@ -3593,7 +3593,7 @@ inline void gcode_G28() {
* Get the current Z position and send it to the planner. * Get the current Z position and send it to the planner.
* *
* >> (z_tmp - real_z) : The rotated current Z minus the uncorrected Z * >> (z_tmp - real_z) : The rotated current Z minus the uncorrected Z
* (most recent planner.set_position/sync_plan_position) * (most recent planner.set_position_mm/sync_plan_position)
* *
* >> zprobe_zoffset : Z distance from nozzle to Z probe * >> zprobe_zoffset : Z distance from nozzle to Z probe
* (set by default, M851, EEPROM, or Menu) * (set by default, M851, EEPROM, or Menu)
@ -7436,7 +7436,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
if (active_extruder_parked) { if (active_extruder_parked) {
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) { if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
// move duplicate extruder into correct duplication position. // move duplicate extruder into correct duplication position.
planner.set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset,
current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[X_AXIS], 1); current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[X_AXIS], 1);
sync_plan_position(); sync_plan_position();
@ -7989,7 +7989,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
(EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS], active_extruder); (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS], active_extruder);
current_position[E_AXIS] = oldepos; current_position[E_AXIS] = oldepos;
destination[E_AXIS] = oldedes; destination[E_AXIS] = oldedes;
planner.set_e_position(oldepos); planner.set_e_position_mm(oldepos);
previous_cmd_ms = ms; // refresh_cmd_timeout() previous_cmd_ms = ms; // refresh_cmd_timeout()
stepper.synchronize(); stepper.synchronize();
switch (active_extruder) { switch (active_extruder) {

View file

@ -1114,9 +1114,9 @@ void Planner::check_axes_activity() {
* On CORE machines stepper ABC will be translated from the given XYZ. * On CORE machines stepper ABC will be translated from the given XYZ.
*/ */
#if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING) #if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING)
void Planner::set_position(float x, float y, float z, const float& e) void Planner::set_position_mm(float x, float y, float z, const float& e)
#else #else
void Planner::set_position(const float& x, const float& y, const float& z, const float& e) void Planner::set_position_mm(const float& x, const float& y, const float& z, const float& e)
#endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING
{ {
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
@ -1138,7 +1138,7 @@ void Planner::check_axes_activity() {
/** /**
* Directly set the planner E position (hence the stepper E position). * Directly set the planner E position (hence the stepper E position).
*/ */
void Planner::set_e_position(const float& e) { void Planner::set_e_position_mm(const float& e) {
position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]); position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]);
stepper.set_e_position(position[E_AXIS]); stepper.set_e_position(position[E_AXIS]);
} }

View file

@ -216,19 +216,19 @@ class Planner {
* *
* Clears previous speed values. * Clears previous speed values.
*/ */
static void set_position(float x, float y, float z, const float& e); static void set_position_mm(float x, float y, float z, const float& e);
#else #else
static void buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder); static void buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder);
static void set_position(const float& x, const float& y, const float& z, const float& e); static void set_position_mm(const float& x, const float& y, const float& z, const float& e);
#endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING
/** /**
* Set the E position (mm) of the planner (and the E stepper) * Set the E position (mm) of the planner (and the E stepper)
*/ */
static void set_e_position(const float& e); static void set_e_position_mm(const float& e);
/** /**
* Does the buffer have any blocks queued? * Does the buffer have any blocks queued?

View file

@ -1037,7 +1037,7 @@ void lcd_cooldown() {
if (LCD_CLICKED) { if (LCD_CLICKED) {
_lcd_level_bed_position = 0; _lcd_level_bed_position = 0;
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
planner.set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
lcd_goto_menu(_lcd_level_goto_next_point, true); lcd_goto_menu(_lcd_level_goto_next_point, true);
} }
} }