manage response update

This commit is contained in:
PavelSindler 2018-08-03 18:37:52 +02:00
parent 5824da8310
commit a1f69e0924
3 changed files with 48 additions and 40 deletions

View file

@ -467,7 +467,7 @@ void gcode_M701();
void proc_commands(); void proc_commands();
void manage_response(); void manage_response(bool move_axes, bool turn_off_nozzle);
bool mmu_get_response(bool timeout, bool clear); bool mmu_get_response(bool timeout, bool clear);
void mmu_not_responding(); void mmu_not_responding();
void mmu_load_to_nozzle(); void mmu_load_to_nozzle();

View file

@ -6834,7 +6834,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
printf_P(PSTR("T code: %d \n"), tmp_extruder); printf_P(PSTR("T code: %d \n"), tmp_extruder);
fprintf_P(uart2io, PSTR("T%d\n"), tmp_extruder); fprintf_P(uart2io, PSTR("T%d\n"), tmp_extruder);
manage_response(); manage_response(true, true);
snmm_extruder = tmp_extruder; //filament change is finished snmm_extruder = tmp_extruder; //filament change is finished
@ -8890,7 +8890,7 @@ bool mmu_get_response(bool timeout, bool clear) {
} }
void manage_response() { void manage_response(bool move_axes, bool turn_off_nozzle) {
bool response = false; bool response = false;
mmu_print_saved = false; mmu_print_saved = false;
@ -8911,31 +8911,34 @@ void manage_response() {
mmu_print_saved = true; mmu_print_saved = true;
hotend_temp_bckp = degTargetHotend(active_extruder); hotend_temp_bckp = degTargetHotend(active_extruder);
z_position_bckp = current_position[Z_AXIS]; if (move_axes) {
x_position_bckp = current_position[X_AXIS]; z_position_bckp = current_position[Z_AXIS];
y_position_bckp = current_position[Y_AXIS]; x_position_bckp = current_position[X_AXIS];
y_position_bckp = current_position[Y_AXIS];
//lift z
current_position[Z_AXIS] += Z_PAUSE_LIFT; //lift z
if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS; current_position[Z_AXIS] += Z_PAUSE_LIFT;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 15, active_extruder); if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
st_synchronize(); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 15, active_extruder);
//set nozzle target temperature to 0 st_synchronize();
setAllTargetHotends(0);
//Move XY to side
//Move XY to side current_position[X_AXIS] = X_PAUSE_POS;
current_position[X_AXIS] = X_PAUSE_POS; current_position[Y_AXIS] = Y_PAUSE_POS;
current_position[Y_AXIS] = Y_PAUSE_POS; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 50, active_extruder);
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 50, active_extruder); st_synchronize();
st_synchronize(); }
if (turn_off_nozzle) {
printf_P(PSTR("MMU not responding\n")); //set nozzle target temperature to 0
lcd_show_fullscreen_message_and_wait_P(_i("MMU needs user attention. Please press knob to resume nozzle target temperature.")); setAllTargetHotends(0);
setTargetHotend(hotend_temp_bckp, active_extruder); printf_P(PSTR("MMU not responding\n"));
while ((degTargetHotend(active_extruder) - degHotend(active_extruder)) > 5) { lcd_show_fullscreen_message_and_wait_P(_i("MMU needs user attention. Please press knob to resume nozzle target temperature."));
delay_keep_alive(1000); setTargetHotend(hotend_temp_bckp, active_extruder);
lcd_wait_for_heater(); while ((degTargetHotend(active_extruder) - degHotend(active_extruder)) > 5) {
} delay_keep_alive(1000);
lcd_wait_for_heater();
}
}
} }
lcd_display_message_fullscreen_P(_i("Check MMU. Fix the issue and then press button on MMU unit.")); lcd_display_message_fullscreen_P(_i("Check MMU. Fix the issue and then press button on MMU unit."));
} }
@ -8943,13 +8946,18 @@ void manage_response() {
printf_P(PSTR("MMU start responding\n")); printf_P(PSTR("MMU start responding\n"));
lcd_clear(); lcd_clear();
lcd_display_message_fullscreen_P(_i("MMU OK. Resuming...")); lcd_display_message_fullscreen_P(_i("MMU OK. Resuming..."));
current_position[X_AXIS] = x_position_bckp; if (move_axes) {
current_position[Y_AXIS] = y_position_bckp; current_position[X_AXIS] = x_position_bckp;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 50, active_extruder); current_position[Y_AXIS] = y_position_bckp;
st_synchronize(); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 50, active_extruder);
current_position[Z_AXIS] = z_position_bckp; st_synchronize();
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 15, active_extruder); current_position[Z_AXIS] = z_position_bckp;
st_synchronize(); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 15, active_extruder);
st_synchronize();
}
else {
delay_keep_alive(1000); //delay just for showing MMU OK message for a while in case that there are no xyz movements
}
} }
} }
if (lcd_update_was_enabled) lcd_update_enable(true); if (lcd_update_was_enabled) lcd_update_enable(true);
@ -9121,7 +9129,7 @@ void mmu_M600_load_filament(bool automatic) {
printf_P(PSTR("T code: %d \n"), tmp_extruder); printf_P(PSTR("T code: %d \n"), tmp_extruder);
fprintf_P(uart2io, PSTR("T%d\n"), tmp_extruder); fprintf_P(uart2io, PSTR("T%d\n"), tmp_extruder);
manage_response(); manage_response(false, true);
snmm_extruder = tmp_extruder; //filament change is finished snmm_extruder = tmp_extruder; //filament change is finished
mmu_load_to_nozzle(); mmu_load_to_nozzle();

View file

@ -3069,8 +3069,8 @@ bool lcd_wait_for_pinda(float temp) {
} }
void lcd_wait_for_heater() { void lcd_wait_for_heater() {
lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING));
lcd_set_degree();
lcd_set_cursor(0, 4); lcd_set_cursor(0, 4);
lcd_print(LCD_STR_THERMOMETER[0]); lcd_print(LCD_STR_THERMOMETER[0]);
lcd_print(ftostr3(degHotend(active_extruder))); lcd_print(ftostr3(degHotend(active_extruder)));
@ -5228,7 +5228,7 @@ void extr_adj(int extruder) //loading filament for SNMM
lcd_print(snmm_extruder + 1); lcd_print(snmm_extruder + 1);
// get response // get response
manage_response(); manage_response(false, false);
lcd_update_enable(true); lcd_update_enable(true);
@ -5301,7 +5301,7 @@ void extr_unload() { //unload just current filament for multimaterial printers
fprintf_P(uart2io, PSTR("U0\n")); fprintf_P(uart2io, PSTR("U0\n"));
// get response // get response
manage_response(); manage_response(false, true);
lcd_update_enable(true); lcd_update_enable(true);
#else //SNMM_V2 #else //SNMM_V2