Merge pull request #8234 from thinkyhead/bf2_native_operation

[2.0.x] Operate in Native Machine Space
This commit is contained in:
Scott Lahteine
2017-11-04 14:31:44 -05:00
committed by GitHub
36 changed files with 449 additions and 489 deletions

View File

@ -1672,7 +1672,7 @@ void kill_screen(const char* lcd_msg) {
*/
static int8_t bed_corner;
void _lcd_goto_next_corner() {
line_to_z(LOGICAL_Z_POSITION(4.0));
line_to_z(4.0);
switch (bed_corner) {
case 0:
current_position[X_AXIS] = X_MIN_BED + 10;
@ -1689,7 +1689,7 @@ void kill_screen(const char* lcd_msg) {
break;
}
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder);
line_to_z(LOGICAL_Z_POSITION(0.0));
line_to_z(0.0);
if (++bed_corner > 3) bed_corner = 0;
}
@ -1735,7 +1735,7 @@ void kill_screen(const char* lcd_msg) {
//
void _lcd_after_probing() {
#if MANUAL_PROBE_HEIGHT > 0
line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
line_to_z(Z_MIN_POS + MANUAL_PROBE_HEIGHT);
#endif
// Display "Done" screen and wait for moves to complete
#if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
@ -1750,13 +1750,13 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(MESH_BED_LEVELING)
// Utility to go to the next mesh point
inline void _manual_probe_goto_xy(float x, float y) {
inline void _manual_probe_goto_xy(const float &rx, const float &ry) {
#if MANUAL_PROBE_HEIGHT > 0
const float prev_z = current_position[Z_AXIS];
line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
line_to_z(Z_MIN_POS + MANUAL_PROBE_HEIGHT);
#endif
current_position[X_AXIS] = LOGICAL_X_POSITION(x);
current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
current_position[X_AXIS] = rx;
current_position[Y_AXIS] = ry;
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
#if MANUAL_PROBE_HEIGHT > 0
line_to_z(prev_z);
@ -1886,10 +1886,7 @@ void kill_screen(const char* lcd_msg) {
mbl.zigzag(manual_probe_index, px, py);
// Controls the loop until the move is done
_manual_probe_goto_xy(
LOGICAL_X_POSITION(mbl.index_to_xpos[px]),
LOGICAL_Y_POSITION(mbl.index_to_ypos[py])
);
_manual_probe_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
// After the blocking function returns, change menus
lcd_goto_screen(_lcd_level_bed_get_z);
@ -2370,8 +2367,8 @@ void kill_screen(const char* lcd_msg) {
* UBL LCD Map Movement
*/
void ubl_map_move_to_xy() {
current_position[X_AXIS] = LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]));
current_position[Y_AXIS] = LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]));
current_position[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]);
current_position[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]);
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
}
@ -2705,17 +2702,17 @@ void kill_screen(const char* lcd_msg) {
lcd_goto_screen(_lcd_calibrate_homing);
}
void _man_probe_pt(const float &lx, const float &ly) {
void _man_probe_pt(const float &rx, const float &ry) {
#if HAS_LEVELING
reset_bed_level(); // After calibration bed-level data is no longer valid
#endif
float z_dest = LOGICAL_Z_POSITION((Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5);
float z_dest = (Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
line_to_z(z_dest);
current_position[X_AXIS] = LOGICAL_X_POSITION(lx);
current_position[Y_AXIS] = LOGICAL_Y_POSITION(ly);
current_position[X_AXIS] = rx;
current_position[Y_AXIS] = ry;
line_to_current_z();
z_dest = LOGICAL_Z_POSITION(Z_CLEARANCE_BETWEEN_PROBES);
z_dest = Z_CLEARANCE_BETWEEN_PROBES;
line_to_z(z_dest);
lcd_synchronize();
@ -2723,8 +2720,8 @@ void kill_screen(const char* lcd_msg) {
lcd_goto_screen(lcd_move_z);
}
float lcd_probe_pt(const float &lx, const float &ly) {
_man_probe_pt(lx, ly);
float lcd_probe_pt(const float &rx, const float &ry) {
_man_probe_pt(rx, ry);
KEEPALIVE_STATE(PAUSED_FOR_USER);
defer_return_to_status = true;
wait_for_user = true;

View File

@ -119,7 +119,7 @@
#endif
#if ENABLED(DELTA_CALIBRATION_MENU)
float lcd_probe_pt(const float &lx, const float &ly);
float lcd_probe_pt(const float &rx, const float &ry);
#endif
#else

View File

@ -646,9 +646,9 @@ static void lcd_implementation_status_screen() {
// At the first page, regenerate the XYZ strings
if (page.page == 0) {
strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
strcpy(ystring, ftostr4sign(current_position[Y_AXIS]));
strcpy(zstring, ftostr52sp(FIXFLOAT(current_position[Z_AXIS])));
strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])));
strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])));
strcpy(zstring, ftostr52sp(FIXFLOAT(LOGICAL_Z_POSITION(current_position[Z_AXIS]))));
#if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
strcpy(wstring, ftostr12ns(filament_width_meas));
strcpy(mstring, itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));

View File

@ -621,7 +621,9 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co
lcd.print(itostr3(t1 + 0.5));
lcd.write('/');
#if HEATER_IDLE_HANDLER
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
#if HAS_TEMP_BED
thermalManager.is_bed_idle()
@ -779,12 +781,12 @@ static void lcd_implementation_status_screen() {
// When everything is ok you see a constant 'X'.
_draw_axis_label(X_AXIS, PSTR(MSG_X), blink);
lcd.print(ftostr4sign(current_position[X_AXIS]));
lcd.print(ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])));
lcd.write(' ');
_draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink);
lcd.print(ftostr4sign(current_position[Y_AXIS]));
lcd.print(ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])));
#endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0
@ -842,11 +844,11 @@ static void lcd_implementation_status_screen() {
#if ENABLED(LCD_PROGRESS_BAR)
// Draw the progress bar if the message has shown long enough
// or if there is no message set.
#if DISABLED(LCD_SET_PROGRESS_MANUALLY)
const uint8_t progress_bar_percent = card.percentDone();
#endif
// Draw the progress bar if the message has shown long enough
// or if there is no message set.
if (progress_bar_percent > 2 && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0]))
return lcd_draw_progress_bar(progress_bar_percent);
@ -1168,9 +1170,9 @@ static void lcd_implementation_status_screen() {
return ret_val;
}
coordinate pixel_location(uint8_t x, uint8_t y) { return pixel_location((int16_t)x, (int16_t)y); }
inline coordinate pixel_location(const uint8_t x, const uint8_t y) { return pixel_location((int16_t)x, (int16_t)y); }
void lcd_implementation_ubl_plot(uint8_t x, uint8_t inverted_y) {
void lcd_implementation_ubl_plot(const uint8_t x, const uint8_t inverted_y) {
#if LCD_WIDTH >= 20
#define _LCD_W_POS 12