Use first letter capital camel case for enum class members. Change underlying type to uint_least8_t.

This commit is contained in:
Marek Bel 2019-06-12 19:11:41 +02:00
parent 5fcf760954
commit 1390d4e5b9
4 changed files with 62 additions and 61 deletions

View File

@ -7693,7 +7693,7 @@ bool bInhibitFlag;
#ifdef IR_SENSOR #ifdef IR_SENSOR
bInhibitFlag=(menu_menu==lcd_menu_show_sensors_state); // Support::SensorInfo menu active bInhibitFlag=(menu_menu==lcd_menu_show_sensors_state); // Support::SensorInfo menu active
#endif // IR_SENSOR #endif // IR_SENSOR
if ((mcode_in_progress != 600) && (eFilamentAction != eFILAMENT_ACTION::autoLoad) && (!bInhibitFlag)) //M600 not in progress, preHeat @ autoLoad menu not active, Support::ExtruderInfo/SensorInfo menu not active if ((mcode_in_progress != 600) && (eFilamentAction != FilamentAction::AutoLoad) && (!bInhibitFlag)) //M600 not in progress, preHeat @ autoLoad menu not active, Support::ExtruderInfo/SensorInfo menu not active
{ {
if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal) && !wizard_active) if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal) && !wizard_active)
{ {
@ -7719,7 +7719,7 @@ if(0)
show_preheat_nozzle_warning(); show_preheat_nozzle_warning();
lcd_update_enable(true); lcd_update_enable(true);
*/ */
eFilamentAction=eFILAMENT_ACTION::autoLoad; eFilamentAction=FilamentAction::AutoLoad;
bFilamentFirstRun=false; bFilamentFirstRun=false;
if(target_temperature[0]>=EXTRUDE_MINTEMP) if(target_temperature[0]>=EXTRUDE_MINTEMP)
{ {

View File

@ -1076,7 +1076,7 @@ if(0)
extr_unload(); extr_unload();
} }
else { else {
eFilamentAction=eFILAMENT_ACTION::mmuUnLoad; eFilamentAction=FilamentAction::MmuUnLoad;
bFilamentFirstRun=false; bFilamentFirstRun=false;
if(target_temperature[0]>=EXTRUDE_MINTEMP) if(target_temperature[0]>=EXTRUDE_MINTEMP)
{ {

View File

@ -1640,7 +1640,7 @@ void lcd_return_to_status()
lcd_refresh(); // to maybe revive the LCD if static electricity killed it. lcd_refresh(); // to maybe revive the LCD if static electricity killed it.
menu_goto(lcd_status_screen, 0, false, true); menu_goto(lcd_status_screen, 0, false, true);
menu_depth = 0; menu_depth = 0;
eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
} }
//! @brief Pause print, disable nozzle heater, move to park position //! @brief Pause print, disable nozzle heater, move to park position
@ -2179,7 +2179,7 @@ void lcd_set_filament_oq_meass()
} }
eFILAMENT_ACTION eFilamentAction=eFILAMENT_ACTION::none; // must be initialized as 'non-autoLoad' FilamentAction eFilamentAction=FilamentAction::None; // must be initialized as 'non-autoLoad'
bool bFilamentFirstRun; bool bFilamentFirstRun;
bool bFilamentPreheatState; bool bFilamentPreheatState;
bool bFilamentAction=false; bool bFilamentAction=false;
@ -2196,18 +2196,18 @@ lcd_puts_P(_i("Press the knob")); ////MSG_ c=20 r=1
lcd_set_cursor(0,3); lcd_set_cursor(0,3);
switch(eFilamentAction) switch(eFilamentAction)
{ {
case eFILAMENT_ACTION::load: case FilamentAction::Load:
case eFILAMENT_ACTION::autoLoad: case FilamentAction::AutoLoad:
case eFILAMENT_ACTION::mmuLoad: case FilamentAction::MmuLoad:
lcd_puts_P(_i("to load filament")); ////MSG_ c=20 r=1 lcd_puts_P(_i("to load filament")); ////MSG_ c=20 r=1
break; break;
case eFILAMENT_ACTION::unLoad: case FilamentAction::UnLoad:
case eFILAMENT_ACTION::mmuUnLoad: case FilamentAction::MmuUnLoad:
lcd_puts_P(_i("to unload filament")); ////MSG_ c=20 r=1 lcd_puts_P(_i("to unload filament")); ////MSG_ c=20 r=1
break; break;
case eFILAMENT_ACTION::mmuEject: case FilamentAction::MmuEject:
case eFILAMENT_ACTION::mmuCut: case FilamentAction::MmuCut:
case eFILAMENT_ACTION::none: case FilamentAction::None:
break; break;
} }
if(lcd_clicked()) if(lcd_clicked())
@ -2221,21 +2221,21 @@ if(lcd_clicked())
menu_back(nLevel); menu_back(nLevel);
switch(eFilamentAction) switch(eFilamentAction)
{ {
case eFILAMENT_ACTION::autoLoad: case FilamentAction::AutoLoad:
eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
// no break // no break
case eFILAMENT_ACTION::load: case FilamentAction::Load:
loading_flag=true; loading_flag=true;
enquecommand_P(PSTR("M701")); // load filament enquecommand_P(PSTR("M701")); // load filament
break; break;
case eFILAMENT_ACTION::unLoad: case FilamentAction::UnLoad:
enquecommand_P(PSTR("M702")); // unload filament enquecommand_P(PSTR("M702")); // unload filament
break; break;
case eFILAMENT_ACTION::mmuLoad: case FilamentAction::MmuLoad:
case eFILAMENT_ACTION::mmuUnLoad: case FilamentAction::MmuUnLoad:
case eFILAMENT_ACTION::mmuEject: case FilamentAction::MmuEject:
case eFILAMENT_ACTION::mmuCut: case FilamentAction::MmuCut:
case eFILAMENT_ACTION::none: case FilamentAction::None:
break; break;
} }
} }
@ -2360,44 +2360,44 @@ if(current_temperature[0]>(target_temperature[0]*0.95))
{ {
switch(eFilamentAction) switch(eFilamentAction)
{ {
case eFILAMENT_ACTION::load: case FilamentAction::Load:
case eFILAMENT_ACTION::autoLoad: case FilamentAction::AutoLoad:
case eFILAMENT_ACTION::unLoad: case FilamentAction::UnLoad:
if(bFilamentWaitingFlag) if(bFilamentWaitingFlag)
menu_submenu(mFilamentPrompt); menu_submenu(mFilamentPrompt);
else { else {
nLevel=bFilamentPreheatState?1:2; nLevel=bFilamentPreheatState?1:2;
menu_back(nLevel); menu_back(nLevel);
if((eFilamentAction==eFILAMENT_ACTION::load)||(eFilamentAction==eFILAMENT_ACTION::autoLoad)) if((eFilamentAction==FilamentAction::Load)||(eFilamentAction==FilamentAction::AutoLoad))
{ {
loading_flag=true; loading_flag=true;
enquecommand_P(PSTR("M701")); // load filament enquecommand_P(PSTR("M701")); // load filament
if(eFilamentAction==eFILAMENT_ACTION::autoLoad) if(eFilamentAction==FilamentAction::AutoLoad)
eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
} }
if(eFilamentAction==eFILAMENT_ACTION::unLoad) if(eFilamentAction==FilamentAction::UnLoad)
enquecommand_P(PSTR("M702")); // unload filament enquecommand_P(PSTR("M702")); // unload filament
} }
break; break;
case eFILAMENT_ACTION::mmuLoad: case FilamentAction::MmuLoad:
nLevel=bFilamentPreheatState?1:2; nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true; bFilamentAction=true;
menu_back(nLevel); menu_back(nLevel);
menu_submenu(mmu_load_to_nozzle_menu); menu_submenu(mmu_load_to_nozzle_menu);
break; break;
case eFILAMENT_ACTION::mmuUnLoad: case FilamentAction::MmuUnLoad:
nLevel=bFilamentPreheatState?1:2; nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true; bFilamentAction=true;
menu_back(nLevel); menu_back(nLevel);
extr_unload(); extr_unload();
break; break;
case eFILAMENT_ACTION::mmuEject: case FilamentAction::MmuEject:
nLevel=bFilamentPreheatState?1:2; nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true; bFilamentAction=true;
menu_back(nLevel); menu_back(nLevel);
menu_submenu(mmu_fil_eject_menu); menu_submenu(mmu_fil_eject_menu);
break; break;
case eFILAMENT_ACTION::mmuCut: case FilamentAction::MmuCut:
#ifdef MMU_HAS_CUTTER #ifdef MMU_HAS_CUTTER
nLevel=bFilamentPreheatState?1:2; nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true; bFilamentAction=true;
@ -2405,7 +2405,7 @@ if(current_temperature[0]>(target_temperature[0]*0.95))
menu_submenu(mmu_cut_filament_menu); menu_submenu(mmu_cut_filament_menu);
#endif //MMU_HAS_CUTTER #endif //MMU_HAS_CUTTER
break; break;
case eFILAMENT_ACTION::none: case FilamentAction::None:
break; break;
} }
if(bFilamentWaitingFlag) if(bFilamentWaitingFlag)
@ -2419,22 +2419,22 @@ else {
lcd_set_cursor(0,1); lcd_set_cursor(0,1);
switch(eFilamentAction) switch(eFilamentAction)
{ {
case eFILAMENT_ACTION::load: case FilamentAction::Load:
case eFILAMENT_ACTION::autoLoad: case FilamentAction::AutoLoad:
case eFILAMENT_ACTION::mmuLoad: case FilamentAction::MmuLoad:
lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1 lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
break; break;
case eFILAMENT_ACTION::unLoad: case FilamentAction::UnLoad:
case eFILAMENT_ACTION::mmuUnLoad: case FilamentAction::MmuUnLoad:
lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1 lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
break; break;
case eFILAMENT_ACTION::mmuEject: case FilamentAction::MmuEject:
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1 lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
break; break;
case eFILAMENT_ACTION::mmuCut: case FilamentAction::MmuCut:
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1 lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
break; break;
case eFILAMENT_ACTION::none: case FilamentAction::None:
break; break;
} }
lcd_set_cursor(0,3); lcd_set_cursor(0,3);
@ -2453,8 +2453,8 @@ else {
setTargetBed((float)nTargetBedOld); setTargetBed((float)nTargetBedOld);
} }
menu_back(); menu_back();
if(eFilamentAction==eFILAMENT_ACTION::autoLoad) if(eFilamentAction==FilamentAction::AutoLoad)
eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
} }
} }
} }
@ -2499,8 +2499,8 @@ mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP,FLEX_PREHEAT_HPB_TEMP);
void mFilamentBack() void mFilamentBack()
{ {
menu_back(); menu_back();
if(eFilamentAction==eFILAMENT_ACTION::autoLoad) if(eFilamentAction==FilamentAction::AutoLoad)
eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
} }
void mFilamentMenu() void mFilamentMenu()
@ -2531,7 +2531,7 @@ if(0)
enquecommand_P(PSTR("M702")); // unload filament enquecommand_P(PSTR("M702")); // unload filament
} }
else { else {
eFilamentAction=eFILAMENT_ACTION::unLoad; eFilamentAction=FilamentAction::UnLoad;
bFilamentFirstRun=false; bFilamentFirstRun=false;
if(target_temperature[0]>=EXTRUDE_MINTEMP) if(target_temperature[0]>=EXTRUDE_MINTEMP)
{ {
@ -2766,7 +2766,7 @@ if(0)
} }
else else
{ {
eFilamentAction=eFILAMENT_ACTION::load; eFilamentAction=FilamentAction::Load;
bFilamentFirstRun=false; bFilamentFirstRun=false;
if(target_temperature[0]>=EXTRUDE_MINTEMP) if(target_temperature[0]>=EXTRUDE_MINTEMP)
{ {
@ -5795,7 +5795,7 @@ static void mmu_load_to_nozzle_menu()
} }
else else
{ {
eFilamentAction = eFILAMENT_ACTION::mmuLoad; eFilamentAction = FilamentAction::MmuLoad;
bFilamentFirstRun = false; bFilamentFirstRun = false;
if (target_temperature[0] >= EXTRUDE_MINTEMP) if (target_temperature[0] >= EXTRUDE_MINTEMP)
{ {
@ -5827,7 +5827,7 @@ static void mmu_fil_eject_menu()
} }
else else
{ {
eFilamentAction = eFILAMENT_ACTION::mmuEject; eFilamentAction = FilamentAction::MmuEject;
bFilamentFirstRun = false; bFilamentFirstRun = false;
if (target_temperature[0] >= EXTRUDE_MINTEMP) if (target_temperature[0] >= EXTRUDE_MINTEMP)
{ {
@ -5855,7 +5855,7 @@ static void mmu_cut_filament_menu()
} }
else else
{ {
eFilamentAction=eFILAMENT_ACTION::mmuCut; eFilamentAction=FilamentAction::MmuCut;
bFilamentFirstRun=false; bFilamentFirstRun=false;
if(target_temperature[0]>=EXTRUDE_MINTEMP) if(target_temperature[0]>=EXTRUDE_MINTEMP)
{ {

View File

@ -151,18 +151,19 @@ void extr_unload_used();
#endif //SNMM #endif //SNMM
void extr_unload(); void extr_unload();
enum class eFILAMENT_ACTION : uint8_t { enum class FilamentAction : uint_least8_t
none, //!< 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state) {
load, None, //!< 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state)
autoLoad, Load,
unLoad, AutoLoad,
mmuLoad, UnLoad,
mmuUnLoad, MmuLoad,
mmuEject, MmuUnLoad,
mmuCut, MmuEject,
MmuCut,
}; };
extern eFILAMENT_ACTION eFilamentAction; extern FilamentAction eFilamentAction;
extern bool bFilamentFirstRun; extern bool bFilamentFirstRun;
extern bool bFilamentPreheatState; extern bool bFilamentPreheatState;
extern bool bFilamentAction; extern bool bFilamentAction;