|
|
|
@ -257,7 +257,7 @@ uint16_t max_display_update_time = 0;
|
|
|
|
|
_skipStatic = false; \
|
|
|
|
|
_MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \
|
|
|
|
|
_MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \
|
|
|
|
|
} while(0)
|
|
|
|
|
}while(0)
|
|
|
|
|
|
|
|
|
|
#define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
|
|
|
|
|
|
|
|
|
@ -289,13 +289,13 @@ uint16_t max_display_update_time = 0;
|
|
|
|
|
encoderRateMultiplierEnabled = true; \
|
|
|
|
|
lastEncoderMovementMillis = 0; \
|
|
|
|
|
_MENU_ITEM_PART_2(type, label, ## __VA_ARGS__); \
|
|
|
|
|
} while(0)
|
|
|
|
|
}while(0)
|
|
|
|
|
|
|
|
|
|
#else // !ENCODER_RATE_MULTIPLIER
|
|
|
|
|
#define ENCODER_RATE_MULTIPLY(F) NOOP
|
|
|
|
|
#endif // !ENCODER_RATE_MULTIPLIER
|
|
|
|
|
|
|
|
|
|
#define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0)
|
|
|
|
|
#define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0)
|
|
|
|
|
#define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
|
|
|
|
#define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
|
|
|
|
#if ENABLED(ENCODER_RATE_MULTIPLIER)
|
|
|
|
@ -1098,9 +1098,11 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
#endif // HOTENDS > 1
|
|
|
|
|
#endif // HAS_TEMP_HOTEND
|
|
|
|
|
|
|
|
|
|
void watch_temp_callback_bed() {
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
void watch_temp_callback_bed() { thermalManager.start_watching_bed(); }
|
|
|
|
|
thermalManager.start_watching_bed();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
|
|
|
|
|
|
|
@ -1162,7 +1164,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
//
|
|
|
|
|
// Bed:
|
|
|
|
|
//
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
|
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -1810,7 +1812,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
void _lcd_ubl_build_custom_mesh() {
|
|
|
|
|
char UBL_LCD_GCODE[20];
|
|
|
|
|
enqueue_and_echo_commands_P(PSTR("G28"));
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
|
sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp);
|
|
|
|
|
enqueue_and_echo_command(UBL_LCD_GCODE);
|
|
|
|
|
#endif
|
|
|
|
@ -1826,7 +1828,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
START_MENU();
|
|
|
|
|
MENU_BACK(MSG_UBL_BUILD_MESH_MENU);
|
|
|
|
|
MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_HOTEND_TEMP, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10));
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
|
MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 5));
|
|
|
|
|
#endif
|
|
|
|
|
MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh);
|
|
|
|
@ -1875,7 +1877,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
void _lcd_ubl_validate_custom_mesh() {
|
|
|
|
|
char UBL_LCD_GCODE[24];
|
|
|
|
|
const int temp =
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
|
custom_bed_temp
|
|
|
|
|
#else
|
|
|
|
|
0
|
|
|
|
@ -1891,7 +1893,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
void _lcd_ubl_validate_mesh() {
|
|
|
|
|
START_MENU();
|
|
|
|
|
MENU_BACK(MSG_UBL_TOOLS);
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
|
MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P"));
|
|
|
|
|
MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P"));
|
|
|
|
|
#else
|
|
|
|
@ -1978,7 +1980,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
void _lcd_ubl_build_mesh() {
|
|
|
|
|
START_MENU();
|
|
|
|
|
MENU_BACK(MSG_UBL_TOOLS);
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
|
MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR(
|
|
|
|
|
"G28\n"
|
|
|
|
|
"M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n"
|
|
|
|
@ -2075,7 +2077,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
enqueue_and_echo_command(ubl_lcd_gcode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DOGLCD
|
|
|
|
|
#if ENABLED(DOGLCD)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* UBL LCD "radar" map data
|
|
|
|
@ -2086,8 +2088,8 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
#define MAP_MAX_PIXELS_Y 49
|
|
|
|
|
|
|
|
|
|
void _lcd_ubl_plot_drawing_prep() {
|
|
|
|
|
uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels;
|
|
|
|
|
uint8_t pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y;
|
|
|
|
|
uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels,
|
|
|
|
|
pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y;
|
|
|
|
|
|
|
|
|
|
/*********************************************************/
|
|
|
|
|
/************ Scale the box pixels appropriately *********/
|
|
|
|
@ -2098,15 +2100,15 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
pixels_per_X_mesh_pnt = x_map_pixels / GRID_MAX_POINTS_X;
|
|
|
|
|
pixels_per_Y_mesh_pnt = y_map_pixels / GRID_MAX_POINTS_Y;
|
|
|
|
|
|
|
|
|
|
x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X-x_map_pixels-2)/2;
|
|
|
|
|
y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y-y_map_pixels-2)/2;
|
|
|
|
|
x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2;
|
|
|
|
|
y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
|
|
|
|
|
|
|
|
|
|
/*********************************************************/
|
|
|
|
|
/************ Clear the Mesh Map Box**********************/
|
|
|
|
|
/*********************************************************/
|
|
|
|
|
|
|
|
|
|
u8g.setColorIndex(1); // First draw the bigger box in White so we have a border around the mesh map box
|
|
|
|
|
u8g.drawBox(x_offset-2, y_offset-2, x_map_pixels+4, y_map_pixels+4);
|
|
|
|
|
u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4);
|
|
|
|
|
|
|
|
|
|
u8g.setColorIndex(0); // Now actually clear the mesh map box
|
|
|
|
|
u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels);
|
|
|
|
@ -2118,8 +2120,8 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
u8g.setColorIndex(1);
|
|
|
|
|
for (i = 0; i < GRID_MAX_POINTS_X; i++) {
|
|
|
|
|
for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
|
|
|
|
|
u8g.drawBox(x_offset+i*pixels_per_X_mesh_pnt+pixels_per_X_mesh_pnt/2,
|
|
|
|
|
y_offset+j*pixels_per_Y_mesh_pnt+pixels_per_Y_mesh_pnt/2, 1, 1);
|
|
|
|
|
u8g.drawBox(x_offset + i * pixels_per_X_mesh_pnt + pixels_per_X_mesh_pnt / 2,
|
|
|
|
|
y_offset + j * pixels_per_Y_mesh_pnt + pixels_per_Y_mesh_pnt / 2, 1, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2129,7 +2131,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
|
|
|
|
|
inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to
|
|
|
|
|
// invert the Y to get it to plot in the right location.
|
|
|
|
|
u8g.drawBox(x_offset+x_plot*pixels_per_X_mesh_pnt, y_offset+inverted_y*pixels_per_Y_mesh_pnt,
|
|
|
|
|
u8g.drawBox(x_offset + x_plot * pixels_per_X_mesh_pnt, y_offset + inverted_y * pixels_per_Y_mesh_pnt,
|
|
|
|
|
pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt);
|
|
|
|
|
|
|
|
|
|
/*********************************************************/
|
|
|
|
@ -2147,11 +2149,11 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
|
|
|
|
|
// Print plot position
|
|
|
|
|
u8g.setPrintPos(5, 64);
|
|
|
|
|
lcd_print("(");
|
|
|
|
|
lcd_print('(');
|
|
|
|
|
u8g.print(x_plot);
|
|
|
|
|
lcd_print(",");
|
|
|
|
|
lcd_print(',');
|
|
|
|
|
u8g.print(y_plot);
|
|
|
|
|
lcd_print(")");
|
|
|
|
|
lcd_print(')');
|
|
|
|
|
|
|
|
|
|
// Show the location value
|
|
|
|
|
u8g.setPrintPos(74, 64);
|
|
|
|
@ -2968,7 +2970,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
//
|
|
|
|
|
// Bed:
|
|
|
|
|
//
|
|
|
|
|
#if WATCH_THE_BED
|
|
|
|
|
#if HAS_TEMP_BED
|
|
|
|
|
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -3624,7 +3626,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
|
|
|
|
|
} \
|
|
|
|
|
++_thisItemNr; \
|
|
|
|
|
} while(0)
|
|
|
|
|
}while(0)
|
|
|
|
|
|
|
|
|
|
void lcd_advanced_pause_toocold_menu() {
|
|
|
|
|
START_MENU();
|
|
|
|
|