Browse Source

Print/display ABL current probe point (#14788)

pull/1/head
InsanityAutomation 5 years ago
committed by Scott Lahteine
parent
commit
f59a7e8b07
  1. 18
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  2. 30
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  3. 2
      Marlin/src/lcd/language/language_de.h
  4. 6
      Marlin/src/lcd/language/language_en.h
  5. 2
      Marlin/src/lcd/language/language_fr.h
  6. 2
      Marlin/src/lcd/language/language_it.h
  7. 2
      Marlin/src/lcd/language/language_sk.h

18
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

@ -752,17 +752,19 @@
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
DEPLOY_PROBE(); DEPLOY_PROBE();
uint16_t count = GRID_MAX_POINTS, current = 1; uint8_t count = GRID_MAX_POINTS, current = 1;
do { do {
current = (GRID_MAX_POINTS) - count + 1; current = (GRID_MAX_POINTS) - count + 1;
if (do_ubl_mesh_map) display_map(g29_map_type); if (do_ubl_mesh_map) display_map(g29_map_type);
SERIAL_ECHOLNPAIR("\nProbing mesh point ", current, "/", GRID_MAX_POINTS, ".\n"); SERIAL_ECHOLNPAIR("\nProbing mesh point ", int(current), "/", int(GRID_MAX_POINTS), ".\n");
#if HAS_LCD_MENU #if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_PROBING_MESH " %i/%i"), current, int(GRID_MAX_POINTS)); ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), int(current), int(GRID_MAX_POINTS));
#endif
#if HAS_LCD_MENU
if (ui.button_pressed()) { if (ui.button_pressed()) {
ui.quick_feedback(false); // Preserve button state for click-and-hold ui.quick_feedback(false); // Preserve button state for click-and-hold
SERIAL_ECHOLNPGM("\nMesh only partially populated.\n"); SERIAL_ECHOLNPGM("\nMesh only partially populated.\n");
@ -1405,7 +1407,7 @@
if (do_3_pt_leveling) { if (do_3_pt_leveling) {
SERIAL_ECHOLNPGM("Tilting mesh (1/3)"); SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
#if HAS_LCD_MENU #if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3")); ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3"));
#endif #endif
@ -1424,7 +1426,7 @@
if (!abort_flag) { if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (2/3)"); SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
#if HAS_LCD_MENU #if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3")); ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3"));
#endif #endif
@ -1444,7 +1446,7 @@
if (!abort_flag) { if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (3/3)"); SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
#if HAS_LCD_MENU #if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3")); ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3"));
#endif #endif
@ -1485,7 +1487,7 @@
if (!abort_flag) { if (!abort_flag) {
SERIAL_ECHOLNPAIR("Tilting mesh point ", current, "/", total_points, "\n"); SERIAL_ECHOLNPAIR("Tilting mesh point ", current, "/", total_points, "\n");
#if HAS_LCD_MENU #if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), current, total_points); ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), current, total_points);
#endif #endif

30
Marlin/src/gcode/bedlevel/abl/G29.cpp

@ -36,7 +36,7 @@
#include "../../../module/probe.h" #include "../../../module/probe.h"
#include "../../queue.h" #include "../../queue.h"
#if BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) #if HAS_DISPLAY
#include "../../../lcd/ultralcd.h" #include "../../../lcd/ultralcd.h"
#endif #endif
@ -254,8 +254,8 @@ G29_TYPE GcodeSuite::G29() {
ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
ABL_VAR float eqnAMatrix[GRID_MAX_POINTS * 3], // "A" matrix of the linear system of equations ABL_VAR float eqnAMatrix[(GRID_MAX_POINTS) * 3], // "A" matrix of the linear system of equations
eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points
mean; mean;
#endif #endif
@ -311,8 +311,7 @@ G29_TYPE GcodeSuite::G29() {
const float rx = RAW_X_POSITION(parser.linearval('X', NAN)), const float rx = RAW_X_POSITION(parser.linearval('X', NAN)),
ry = RAW_Y_POSITION(parser.linearval('Y', NAN)); ry = RAW_Y_POSITION(parser.linearval('Y', NAN));
int8_t i = parser.byteval('I', -1), int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1);
j = parser.byteval('J', -1);
if (!isnan(rx) && !isnan(ry)) { if (!isnan(rx) && !isnan(ry)) {
// Get nearest i / j from rx / ry // Get nearest i / j from rx / ry
@ -689,8 +688,11 @@ G29_TYPE GcodeSuite::G29() {
zig ^= true; // zag zig ^= true; // zag
// An index to print current state
uint8_t pt_index = (PR_OUTER_VAR) * (PR_INNER_END) + 1;
// Inner loop is Y with PROBE_Y_FIRST enabled // Inner loop is Y with PROBE_Y_FIRST enabled
for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) { for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) {
const float xBase = left_probe_bed_position + xGridSpacing * xCount, const float xBase = left_probe_bed_position + xGridSpacing * xCount,
yBase = front_probe_bed_position + yGridSpacing * yCount; yBase = front_probe_bed_position + yGridSpacing * yCount;
@ -707,11 +709,16 @@ G29_TYPE GcodeSuite::G29() {
if (!position_is_reachable_by_probe(xProbe, yProbe)) continue; if (!position_is_reachable_by_probe(xProbe, yProbe)) continue;
#endif #endif
if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", int(GRID_MAX_POINTS), ".");
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), int(pt_index), int(GRID_MAX_POINTS));
#endif
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
if (isnan(measured_z)) { if (isnan(measured_z)) {
set_bed_leveling_enabled(abl_should_enable); set_bed_leveling_enabled(abl_should_enable);
break; break; // Breaks out of both loops
} }
#if ENABLED(AUTO_BED_LEVELING_LINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR)
@ -744,6 +751,11 @@ G29_TYPE GcodeSuite::G29() {
// Probe at 3 arbitrary points // Probe at 3 arbitrary points
for (uint8_t i = 0; i < 3; ++i) { for (uint8_t i = 0; i < 3; ++i) {
if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", int(i), "/3.");
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/3"), int(i));
#endif
// Retain the last probe position // Retain the last probe position
xProbe = points[i].x; xProbe = points[i].x;
yProbe = points[i].y; yProbe = points[i].y;
@ -770,6 +782,10 @@ G29_TYPE GcodeSuite::G29() {
#endif // AUTO_BED_LEVELING_3POINT #endif // AUTO_BED_LEVELING_3POINT
#if HAS_DISPLAY
ui.reset_status();
#endif
// Stow the probe. No raise for FIX_MOUNTED_PROBE. // Stow the probe. No raise for FIX_MOUNTED_PROBE.
if (STOW_PROBE()) { if (STOW_PROBE()) {
set_bed_leveling_enabled(abl_should_enable); set_bed_leveling_enabled(abl_should_enable);

2
Marlin/src/lcd/language/language_de.h

@ -95,6 +95,7 @@
#define MSG_LEVEL_CORNERS _UxGT("Ecken nivellieren") #define MSG_LEVEL_CORNERS _UxGT("Ecken nivellieren")
#define MSG_NEXT_CORNER _UxGT("Nächste Ecke") #define MSG_NEXT_CORNER _UxGT("Nächste Ecke")
#define MSG_EDITING_STOPPED _UxGT("Netzbearb. angeh.") #define MSG_EDITING_STOPPED _UxGT("Netzbearb. angeh.")
#define MSG_PROBING_MESH _UxGT("Messpunkt")
#define MSG_MESH_X _UxGT("Index X") #define MSG_MESH_X _UxGT("Index X")
#define MSG_MESH_Y _UxGT("Index Y") #define MSG_MESH_Y _UxGT("Index Y")
#define MSG_MESH_EDIT_Z _UxGT("Z-Wert") #define MSG_MESH_EDIT_Z _UxGT("Z-Wert")
@ -103,7 +104,6 @@
#define MSG_UBL_UNHOMED _UxGT("Home XYZ zuerst") #define MSG_UBL_UNHOMED _UxGT("Home XYZ zuerst")
#define MSG_UBL_TOOLS _UxGT("UBL-Werkzeuge") #define MSG_UBL_TOOLS _UxGT("UBL-Werkzeuge")
#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling")
#define MSG_LCD_PROBING_MESH _UxGT("Messpunkt")
#define MSG_LCD_TILTING_MESH _UxGT("Berührungspunkt") #define MSG_LCD_TILTING_MESH _UxGT("Berührungspunkt")
#define MSG_IDEX_MENU _UxGT("IDEX-Modus") #define MSG_IDEX_MENU _UxGT("IDEX-Modus")
#define MSG_OFFSETS_MENU _UxGT("Werkzeugversätze") #define MSG_OFFSETS_MENU _UxGT("Werkzeugversätze")

6
Marlin/src/lcd/language/language_en.h

@ -235,6 +235,9 @@
#ifndef MSG_EDITING_STOPPED #ifndef MSG_EDITING_STOPPED
#define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped") #define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped")
#endif #endif
#ifndef MSG_PROBING_MESH
#define MSG_PROBING_MESH _UxGT("Probing point")
#endif
#ifndef MSG_MESH_X #ifndef MSG_MESH_X
#define MSG_MESH_X _UxGT("Index X") #define MSG_MESH_X _UxGT("Index X")
#endif #endif
@ -259,9 +262,6 @@
#ifndef MSG_UBL_LEVEL_BED #ifndef MSG_UBL_LEVEL_BED
#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling")
#endif #endif
#ifndef MSG_LCD_PROBING_MESH
#define MSG_LCD_PROBING_MESH _UxGT("Probing point")
#endif
#ifndef MSG_LCD_TILTING_MESH #ifndef MSG_LCD_TILTING_MESH
#define MSG_LCD_TILTING_MESH _UxGT("Tilting point") #define MSG_LCD_TILTING_MESH _UxGT("Tilting point")
#endif #endif

2
Marlin/src/lcd/language/language_fr.h

@ -90,6 +90,7 @@
#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") #define MSG_LEVEL_CORNERS _UxGT("Niveau coins")
#define MSG_NEXT_CORNER _UxGT("Coin suivant") #define MSG_NEXT_CORNER _UxGT("Coin suivant")
#define MSG_EDITING_STOPPED _UxGT("Arrêt édit. maillage") #define MSG_EDITING_STOPPED _UxGT("Arrêt édit. maillage")
#define MSG_PROBING_MESH _UxGT("Mesure point")
#define MSG_MESH_X _UxGT("Index X") #define MSG_MESH_X _UxGT("Index X")
#define MSG_MESH_Y _UxGT("Index Y") #define MSG_MESH_Y _UxGT("Index Y")
#define MSG_MESH_EDIT_Z _UxGT("Valeur Z") #define MSG_MESH_EDIT_Z _UxGT("Valeur Z")
@ -99,7 +100,6 @@
#define MSG_UBL_UNHOMED _UxGT("Origine XYZ requise") #define MSG_UBL_UNHOMED _UxGT("Origine XYZ requise")
#define MSG_UBL_TOOLS _UxGT("Outils UBL") #define MSG_UBL_TOOLS _UxGT("Outils UBL")
#define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifié") #define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifié")
#define MSG_LCD_PROBING_MESH _UxGT("Mesure point")
#define MSG_LCD_TILTING_MESH _UxGT("Touche point") #define MSG_LCD_TILTING_MESH _UxGT("Touche point")
#define MSG_M48_TEST _UxGT("Ecart sonde Z M48") #define MSG_M48_TEST _UxGT("Ecart sonde Z M48")
#define MSG_M48_DEVIATION _UxGT("Ecart") #define MSG_M48_DEVIATION _UxGT("Ecart")

2
Marlin/src/lcd/language/language_it.h

@ -93,6 +93,7 @@
#define MSG_LEVEL_CORNERS _UxGT("Livella spigoli") #define MSG_LEVEL_CORNERS _UxGT("Livella spigoli")
#define MSG_NEXT_CORNER _UxGT("Prossimo spigolo") #define MSG_NEXT_CORNER _UxGT("Prossimo spigolo")
#define MSG_EDITING_STOPPED _UxGT("Modif. Mesh Fermata") #define MSG_EDITING_STOPPED _UxGT("Modif. Mesh Fermata")
#define MSG_PROBING_MESH _UxGT("Punto sondato")
#define MSG_MESH_X _UxGT("Indice X") #define MSG_MESH_X _UxGT("Indice X")
#define MSG_MESH_Y _UxGT("Indice Y") #define MSG_MESH_Y _UxGT("Indice Y")
#define MSG_MESH_EDIT_Z _UxGT("Valore di Z") #define MSG_MESH_EDIT_Z _UxGT("Valore di Z")
@ -101,7 +102,6 @@
#define MSG_UBL_UNHOMED _UxGT("Home XYZ prima") #define MSG_UBL_UNHOMED _UxGT("Home XYZ prima")
#define MSG_UBL_TOOLS _UxGT("Strumenti UBL") #define MSG_UBL_TOOLS _UxGT("Strumenti UBL")
#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling")
#define MSG_LCD_PROBING_MESH _UxGT("Punto sondato")
#define MSG_LCD_TILTING_MESH _UxGT("Punto inclinaz.") #define MSG_LCD_TILTING_MESH _UxGT("Punto inclinaz.")
#define MSG_M48_TEST _UxGT("Test sonda M48") #define MSG_M48_TEST _UxGT("Test sonda M48")
#define MSG_M48_DEVIATION _UxGT("Deviazione") #define MSG_M48_DEVIATION _UxGT("Deviazione")

2
Marlin/src/lcd/language/language_sk.h

@ -101,6 +101,7 @@
#define MSG_LEVEL_CORNERS _UxGT("Vyrovnať rohy") #define MSG_LEVEL_CORNERS _UxGT("Vyrovnať rohy")
#define MSG_NEXT_CORNER _UxGT("Ďalší roh") #define MSG_NEXT_CORNER _UxGT("Ďalší roh")
#define MSG_EDITING_STOPPED _UxGT("Koniec úprav siete") #define MSG_EDITING_STOPPED _UxGT("Koniec úprav siete")
#define MSG_PROBING_MESH _UxGT("Skúšam bod")
#define MSG_MESH_X _UxGT("Index X") #define MSG_MESH_X _UxGT("Index X")
#define MSG_MESH_Y _UxGT("Index Y") #define MSG_MESH_Y _UxGT("Index Y")
#define MSG_MESH_EDIT_Z _UxGT("Hodnota Z") #define MSG_MESH_EDIT_Z _UxGT("Hodnota Z")
@ -110,7 +111,6 @@
#define MSG_UBL_UNHOMED _UxGT("Prejdite domov") #define MSG_UBL_UNHOMED _UxGT("Prejdite domov")
#define MSG_UBL_TOOLS _UxGT("Nástroje UBL") #define MSG_UBL_TOOLS _UxGT("Nástroje UBL")
#define MSG_UBL_LEVEL_BED _UxGT("UBL rovnanie") #define MSG_UBL_LEVEL_BED _UxGT("UBL rovnanie")
#define MSG_LCD_PROBING_MESH _UxGT("Skúšam bod")
#define MSG_LCD_TILTING_MESH _UxGT("Vyrovnávam bod") #define MSG_LCD_TILTING_MESH _UxGT("Vyrovnávam bod")
#define MSG_IDEX_MENU _UxGT("IDEX režim") #define MSG_IDEX_MENU _UxGT("IDEX režim")
#define MSG_OFFSETS_MENU _UxGT("Ofset nástrojov") #define MSG_OFFSETS_MENU _UxGT("Ofset nástrojov")

Loading…
Cancel
Save