|
|
|
@ -450,7 +450,7 @@ void DGUSScreenHandler::Level_Ctrl_MKS(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
|
a_first_level = 0;
|
|
|
|
|
queue.enqueue_now_P(G28_STR);
|
|
|
|
|
}
|
|
|
|
|
queue.enqueue_now_P(PSTR("G29"));
|
|
|
|
|
queue.enqueue_now(F("G29"));
|
|
|
|
|
|
|
|
|
|
#elif ENABLED(MESH_BED_LEVELING)
|
|
|
|
|
|
|
|
|
@ -512,10 +512,10 @@ void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
|
Deci2 = offset * 100;
|
|
|
|
|
Deci2 = Deci2 % 10;
|
|
|
|
|
soft_endstop._enabled = false;
|
|
|
|
|
queue.enqueue_now_P(PSTR("G91"));
|
|
|
|
|
queue.enqueue_now(F("G91"));
|
|
|
|
|
snprintf_P(cmd_buf, 30, PSTR("G1 Z%d.%d%d"), integer, Deci, Deci2);
|
|
|
|
|
queue.enqueue_one_now(cmd_buf);
|
|
|
|
|
queue.enqueue_now_P(PSTR("G90"));
|
|
|
|
|
queue.enqueue_now(F("G90"));
|
|
|
|
|
//soft_endstop._enabled = true;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -527,17 +527,17 @@ void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
|
Deci2 = offset * 100;
|
|
|
|
|
Deci2 = Deci2 % 10;
|
|
|
|
|
soft_endstop._enabled = false;
|
|
|
|
|
queue.enqueue_now_P(PSTR("G91"));
|
|
|
|
|
queue.enqueue_now(F("G91"));
|
|
|
|
|
snprintf_P(cmd_buf, 30, PSTR("G1 Z-%d.%d%d"), integer, Deci, Deci2);
|
|
|
|
|
queue.enqueue_one_now(cmd_buf);
|
|
|
|
|
queue.enqueue_now_P(PSTR("G90"));
|
|
|
|
|
queue.enqueue_now(F("G90"));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
if (mesh_point_count == GRID_MAX_POINTS) { // The first point
|
|
|
|
|
|
|
|
|
|
queue.enqueue_now_P(PSTR("G28"));
|
|
|
|
|
queue.enqueue_now_P(PSTR("G29S1"));
|
|
|
|
|
queue.enqueue_now(F("G28"));
|
|
|
|
|
queue.enqueue_now(F("G29S1"));
|
|
|
|
|
mesh_point_count--;
|
|
|
|
|
|
|
|
|
|
if (mks_language_index == MKS_English) {
|
|
|
|
@ -550,7 +550,7 @@ void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (mesh_point_count > 1) { // 倒数第二个点
|
|
|
|
|
queue.enqueue_now_P(PSTR("G29S2"));
|
|
|
|
|
queue.enqueue_now(F("G29S2"));
|
|
|
|
|
mesh_point_count--;
|
|
|
|
|
if (mks_language_index == MKS_English) {
|
|
|
|
|
const char level_buf_en2[] = "Next Point";
|
|
|
|
@ -562,7 +562,7 @@ void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (mesh_point_count == 1) {
|
|
|
|
|
queue.enqueue_now_P(PSTR("G29S2"));
|
|
|
|
|
queue.enqueue_now(F("G29S2"));
|
|
|
|
|
mesh_point_count--;
|
|
|
|
|
if (mks_language_index == MKS_English) {
|
|
|
|
|
const char level_buf_en2[] = "Level Finsh";
|
|
|
|
@ -620,13 +620,13 @@ void DGUSScreenHandler::ManualAssistLeveling(DGUS_VP_Variable &var, void *val_pt
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (WITHIN(point_value, 0x0001, 0x0005))
|
|
|
|
|
queue.enqueue_now_P(PSTR("G1Z10"));
|
|
|
|
|
queue.enqueue_now(F("G1Z10"));
|
|
|
|
|
|
|
|
|
|
switch (point_value) {
|
|
|
|
|
case 0x0001:
|
|
|
|
|
enqueue_corner_move(X_MIN_POS + ABS(mks_corner_offsets[0].x),
|
|
|
|
|
Y_MIN_POS + ABS(mks_corner_offsets[0].y), level_speed);
|
|
|
|
|
queue.enqueue_now_P(PSTR("G28Z"));
|
|
|
|
|
queue.enqueue_now(F("G28Z"));
|
|
|
|
|
break;
|
|
|
|
|
case 0x0002:
|
|
|
|
|
enqueue_corner_move(X_MAX_POS - ABS(mks_corner_offsets[1].x),
|
|
|
|
@ -647,8 +647,8 @@ void DGUSScreenHandler::ManualAssistLeveling(DGUS_VP_Variable &var, void *val_pt
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (WITHIN(point_value, 0x0002, 0x0005)) {
|
|
|
|
|
//queue.enqueue_now_P(PSTR("G28Z"));
|
|
|
|
|
queue.enqueue_now_P(PSTR("G1Z-10"));
|
|
|
|
|
//queue.enqueue_now(F("G28Z"));
|
|
|
|
|
queue.enqueue_now(F("G1Z-10"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -856,7 +856,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
|
|
|
|
|
|
if (!relative_mode) {
|
|
|
|
|
//DEBUG_ECHOPGM(" G91");
|
|
|
|
|
queue.enqueue_now_P(PSTR("G91"));
|
|
|
|
|
queue.enqueue_now(F("G91"));
|
|
|
|
|
//DEBUG_ECHOPGM(" ✓ ");
|
|
|
|
|
}
|
|
|
|
|
char buf[32]; // G1 X9999.99 F12345
|
|
|
|
@ -878,8 +878,8 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
|
//DEBUG_ECHOLNPGM(" ✓ ");
|
|
|
|
|
if (!old_relative_mode) {
|
|
|
|
|
//DEBUG_ECHOPGM("G90");
|
|
|
|
|
//queue.enqueue_now_P(PSTR("G90"));
|
|
|
|
|
queue.enqueue_now_P(PSTR("G90"));
|
|
|
|
|
//queue.enqueue_now(F("G90"));
|
|
|
|
|
queue.enqueue_now(F("G90"));
|
|
|
|
|
//DEBUG_ECHOPGM(" ✓ ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1133,30 +1133,30 @@ void DGUSScreenHandler::HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr
|
|
|
|
|
switch (flag) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (step == 0.01)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z-0.01"));
|
|
|
|
|
queue.inject(F("M290 Z-0.01"));
|
|
|
|
|
else if (step == 0.1)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z-0.1"));
|
|
|
|
|
queue.inject(F("M290 Z-0.1"));
|
|
|
|
|
else if (step == 0.5)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z-0.5"));
|
|
|
|
|
queue.inject(F("M290 Z-0.5"));
|
|
|
|
|
else if (step == 1)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z-1"));
|
|
|
|
|
queue.inject(F("M290 Z-1"));
|
|
|
|
|
else
|
|
|
|
|
queue.inject_P(PSTR("M290 Z-0.01"));
|
|
|
|
|
queue.inject(F("M290 Z-0.01"));
|
|
|
|
|
|
|
|
|
|
z_offset_add = z_offset_add - ZOffset_distance;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
if (step == 0.01)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z0.01"));
|
|
|
|
|
queue.inject(F("M290 Z0.01"));
|
|
|
|
|
else if (step == 0.1)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z0.1"));
|
|
|
|
|
queue.inject(F("M290 Z0.1"));
|
|
|
|
|
else if (step == 0.5)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z0.5"));
|
|
|
|
|
queue.inject(F("M290 Z0.5"));
|
|
|
|
|
else if (step == 1)
|
|
|
|
|
queue.inject_P(PSTR("M290 Z1"));
|
|
|
|
|
queue.inject(F("M290 Z1"));
|
|
|
|
|
else
|
|
|
|
|
queue.inject_P(PSTR("M290 Z-0.01"));
|
|
|
|
|
queue.inject(F("M290 Z-0.01"));
|
|
|
|
|
|
|
|
|
|
z_offset_add = z_offset_add + ZOffset_distance;
|
|
|
|
|
break;
|
|
|
|
@ -1486,7 +1486,7 @@ void DGUSScreenHandler::DGUS_Runout_Idle(void) {
|
|
|
|
|
|
|
|
|
|
case RUNOUT_STATUS:
|
|
|
|
|
runout_mks.runout_status = RUNOUT_BEGIN_STATUS;
|
|
|
|
|
queue.inject_P(PSTR("M25"));
|
|
|
|
|
queue.inject(F("M25"));
|
|
|
|
|
GotoScreen(MKSLCD_SCREEN_PAUSE);
|
|
|
|
|
|
|
|
|
|
sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please change filament!"), nullptr, true, true, true, true);
|
|
|
|
|