Merge pull request #2875 from wavexx/raise_while_preheating

Raise Z while preheating when auto/[un]loading the filament
This commit is contained in:
DRracer 2021-01-11 07:45:54 +01:00 committed by GitHub
commit 4728bf2182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 26 deletions

View File

@ -552,7 +552,7 @@ enum CalibrationStatus
// Try to maintain a minimum distance from the bed even when Z is // Try to maintain a minimum distance from the bed even when Z is
// unknown when doing the following operations // unknown when doing the following operations
#define MIN_Z_FOR_LOAD 50 #define MIN_Z_FOR_LOAD 50
#define MIN_Z_FOR_UNLOAD 20 #define MIN_Z_FOR_UNLOAD 50
#define MIN_Z_FOR_PREHEAT 10 #define MIN_Z_FOR_PREHEAT 10
#include "Configuration_adv.h" #include "Configuration_adv.h"

View File

@ -2418,7 +2418,7 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
case FilamentAction::None: case FilamentAction::None:
case FilamentAction::Preheat: case FilamentAction::Preheat:
case FilamentAction::Lay1Cal: case FilamentAction::Lay1Cal:
// handled earlier
break; break;
} }
if (bFilamentWaitingFlag) Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); if (bFilamentWaitingFlag) Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
@ -2426,34 +2426,45 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
} }
else else
{ {
bFilamentWaitingFlag = true;
lcd_set_cursor(0, 0); lcd_set_cursor(0, 0);
lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0));
lcd_set_cursor(0, 1);
switch (eFilamentAction) if (!bFilamentWaitingFlag)
{ {
case FilamentAction::Load: // First run after the filament preheat selection:
case FilamentAction::AutoLoad: // setup the fixed LCD parts and raise Z as we wait
case FilamentAction::MmuLoad: bFilamentWaitingFlag = true;
lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20
break; lcd_set_cursor(0, 1);
case FilamentAction::UnLoad: switch (eFilamentAction)
case FilamentAction::MmuUnLoad: {
lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 case FilamentAction::Load:
break; case FilamentAction::AutoLoad:
case FilamentAction::MmuEject: case FilamentAction::MmuLoad:
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20
break; raise_z_above(MIN_Z_FOR_LOAD);
case FilamentAction::MmuCut: break;
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 case FilamentAction::UnLoad:
break; case FilamentAction::MmuUnLoad:
case FilamentAction::None: lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20
case FilamentAction::Preheat: raise_z_above(MIN_Z_FOR_UNLOAD);
case FilamentAction::Lay1Cal: break;
break; case FilamentAction::MmuEject:
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20
break;
case FilamentAction::MmuCut:
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20
break;
case FilamentAction::None:
case FilamentAction::Preheat:
case FilamentAction::Lay1Cal:
// handled earlier
break;
}
lcd_set_cursor(0, 3);
lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
} }
lcd_set_cursor(0, 3);
lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
if (lcd_clicked()) if (lcd_clicked())
{ {
bFilamentWaitingFlag = false; bFilamentWaitingFlag = false;