Merge pull request #1505 from MRprusa3d/PFW-210

preHeat @ filament load / unload / autoLoad
This commit is contained in:
PavelSindler 2019-02-06 09:14:03 +01:00 committed by GitHub
commit fcb7dd90cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 25 deletions

View File

@ -7468,7 +7468,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
#ifdef FILAMENT_SENSOR
if (mmu_enabled == false)
{
if (mcode_in_progress != 600) //M600 not in progress
if ((mcode_in_progress != 600) && (!bFilamentAutoloadFlag)) //M600 not in progress, preHeat @ autoLoad menu not active
{
if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL) && !wizard_active)
{
@ -7486,10 +7486,20 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
}
else
{
lcd_update_enable(false);
show_preheat_nozzle_warning();
lcd_update_enable(true);
}
bFilamentLoad=true; // i.e. filament loading mode
bFilamentFirstRun=false;
bFilamentAutoloadFlag=true;
if(target_temperature[0]>=EXTRUDE_MINTEMP)
{
bFilamentPreheatState=true;
mFilamentItem(target_temperature[0]);
}
else
{
menu_submenu(mFilamentMenu);
lcd_timeoutToStatus.start();
}
}
}
}
else

View File

@ -1781,6 +1781,7 @@ void lcd_return_to_status()
lcd_refresh(); // to maybe revive the LCD if static electricity killed it.
menu_goto(lcd_status_screen, 0, false, true);
menu_depth = 0;
bFilamentAutoloadFlag=false;
}
//! @brief Pause print, disable nozzle heater, move to park position
@ -2299,6 +2300,7 @@ void lcd_set_filament_oq_meass()
bool bFilamentFirstRun;
bool bFilamentLoad;
bool bFilamentPreheatState;
bool bFilamentAutoloadFlag;
static void mFilamentPrompt()
{
@ -2326,9 +2328,11 @@ if(lcd_clicked())
}
else enquecommand_P(PSTR("M702")); // unload filament
}
if(bFilamentLoad) // i.e. not necessary for preHeat @ unload
bFilamentAutoloadFlag=false;
}
static void mFilamentItem(uint16_t nTemp)
void mFilamentItem(uint16_t nTemp)
{
static int nTargetOld;
@ -2353,6 +2357,8 @@ if(lcd_clicked())
}
else setTargetHotend0((float)nTargetOld);
menu_back();
if(bFilamentLoad) // i.e. not necessary for preHeat @ unload
bFilamentAutoloadFlag=false;
}
else if(!isHeatingHotend0())
{
@ -2398,10 +2404,17 @@ mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP);
}
static void mFilamentMenu()
void mFilamentBack()
{
menu_back();
if(bFilamentLoad) // i.e. not necessary for preHeat @ unload
bFilamentAutoloadFlag=false;
}
void mFilamentMenu()
{
MENU_BEGIN();
MENU_ITEM_BACK_P(_T(MSG_MAIN));
MENU_ITEM_FUNCTION_P(_T(MSG_MAIN),mFilamentBack);
MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP)),mFilamentItem_PLA);
MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP)),mFilamentItem_PET);
MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP)),mFilamentItem_ABS);
@ -2634,23 +2647,9 @@ void lcd_load_filament_color_check()
#ifdef FILAMENT_SENSOR
static void lcd_menu_AutoLoadFilament()
{
if (degHotend0() > EXTRUDE_MINTEMP)
{
uint8_t nlines;
lcd_display_message_fullscreen_nonBlocking_P(_i("Autoloading filament is active, just press the knob and insert filament..."),nlines);////MSG_AUTOLOADING_ENABLED c=20 r=4
}
else
{
static_assert(sizeof(menu_data)>=sizeof(ShortTimer), "ShortTimer doesn't fit into menu_data");
ShortTimer* ptimer = (ShortTimer*)&(menu_data[0]);
if (!ptimer->running()) ptimer->start();
lcd_set_cursor(0, 0);
lcd_puts_P(_T(MSG_ERROR));
lcd_set_cursor(0, 2);
lcd_puts_P(_T(MSG_PREHEAT_NOZZLE));
if (ptimer->expired(2000ul)) menu_back();
}
menu_back_if_clicked();
uint8_t nlines;
lcd_display_message_fullscreen_nonBlocking_P(_i("Autoloading filament is active, just press the knob and insert filament..."),nlines);////MSG_AUTOLOADING_ENABLED c=20 r=4
menu_back_if_clicked();
}
#endif //FILAMENT_SENSOR

View File

@ -133,6 +133,12 @@ void extr_unload_used();
#endif //SNMM
void extr_unload();
extern bool bFilamentFirstRun;
extern bool bFilamentLoad;
extern bool bFilamentPreheatState;
extern bool bFilamentAutoloadFlag;
void mFilamentItem(uint16_t nTemp);
void mFilamentMenu();
void unload_filament();
void stack_error();