Skip to content

Commit

Permalink
Misc. LCD cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 19, 2021
1 parent ac0048d commit 3ce5470
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 24 deletions.
16 changes: 5 additions & 11 deletions Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,9 @@ void DGUSRxHandler::Flowrate(DGUS_VP &vp, void *data_ptr) {
switch (vp.addr) {
default: return;
case DGUS_Addr::ADJUST_SetFlowrate_CUR:
#if EXTRUDERS > 1
ExtUI::setFlow_percent(flowrate, ExtUI::getActiveTool());
#else
ExtUI::setFlow_percent(flowrate, ExtUI::E0);
#endif
ExtUI::setFlow_percent(flowrate, TERN(HAS_MULTI_EXTRUDER, ExtUI::getActiveTool(), ExtUI::E0));
break;
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
case DGUS_Addr::ADJUST_SetFlowrate_E0:
ExtUI::setFlow_percent(flowrate, ExtUI::E0);
break;
Expand Down Expand Up @@ -558,9 +554,7 @@ void DGUSRxHandler::FilamentSelect(DGUS_VP &vp, void *data_ptr) {
default: return;
case DGUS_Data::Extruder::CURRENT:
case DGUS_Data::Extruder::E0:
#if EXTRUDERS > 1
case DGUS_Data::Extruder::E1:
#endif
TERN_(HAS_MULTI_EXTRUDER, case DGUS_Data::Extruder::E1:)
dgus_screen_handler.filament_extruder = extruder;
break;
}
Expand Down Expand Up @@ -591,14 +585,14 @@ void DGUSRxHandler::FilamentMove(DGUS_VP &vp, void *data_ptr) {
switch (dgus_screen_handler.filament_extruder) {
default: return;
case DGUS_Data::Extruder::CURRENT:
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
extruder = ExtUI::getActiveTool();
break;
#endif
case DGUS_Data::Extruder::E0:
extruder = ExtUI::E0;
break;
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
case DGUS_Data::Extruder::E1:
extruder = ExtUI::E1;
break;
Expand Down
10 changes: 3 additions & 7 deletions Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,9 @@ void DGUSTxHandler::Flowrate(DGUS_VP &vp) {
switch (vp.addr) {
default: return;
case DGUS_Addr::ADJUST_Flowrate_CUR:
#if EXTRUDERS > 1
flowrate = ExtUI::getFlow_percent(ExtUI::getActiveTool());
#else
flowrate = ExtUI::getFlow_percent(ExtUI::E0);
#endif
flowrate = ExtUI::getFlow_percent(TERN(HAS_MULTI_EXTRUDER, ExtUI::getActiveTool(), ExtUI::E0));
break;
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
case DGUS_Addr::ADJUST_Flowrate_E0:
flowrate = ExtUI::getFlow_percent(ExtUI::E0);
break;
Expand Down Expand Up @@ -363,7 +359,7 @@ void DGUSTxHandler::FilamentIcons(DGUS_VP &vp) {
switch (dgus_screen_handler.filament_extruder) {
default: return;
case DGUS_Data::Extruder::CURRENT:
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
switch (ExtUI::getActiveTool()) {
default: break;
case ExtUI::E0:
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ enum class DGUS_Addr : uint16_t {
STATUS_Resume = 0x2009, // Popup / Data: DGUS_Data::Popup
ADJUST_SetFeedrate = 0x200A, // Type: Integer (16 bits signed)
ADJUST_SetFlowrate_CUR = 0x200B, // Type: Integer (16 bits signed)
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
ADJUST_SetFlowrate_E0 = 0x200C, // Type: Integer (16 bits signed)
ADJUST_SetFlowrate_E1 = 0x200D, // Type: Integer (16 bits signed)
#endif
Expand Down Expand Up @@ -113,7 +113,7 @@ enum class DGUS_Addr : uint16_t {
STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon
ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed)
ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed)
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
ADJUST_Flowrate_E0 = 0x30FA, // Type: Integer (16 bits signed)
ADJUST_Flowrate_E1 = 0x30FB, // Type: Integer (16 bits signed)
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {

VP_HELPER_RX(DGUS_Addr::ADJUST_SetFeedrate, &DGUSRxHandler::Feedrate),
VP_HELPER_RX(DGUS_Addr::ADJUST_SetFlowrate_CUR, &DGUSRxHandler::Flowrate),
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
VP_HELPER_RX(DGUS_Addr::ADJUST_SetFlowrate_E0, &DGUSRxHandler::Flowrate),
VP_HELPER_RX(DGUS_Addr::ADJUST_SetFlowrate_E1, &DGUSRxHandler::Flowrate),
#endif
Expand Down Expand Up @@ -194,7 +194,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
VP_HELPER_TX_AUTO(DGUS_Addr::ADJUST_Flowrate_CUR,
nullptr,
&DGUSTxHandler::Flowrate),
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
VP_HELPER_TX_AUTO(DGUS_Addr::ADJUST_Flowrate_E0,
nullptr,
&DGUSTxHandler::Flowrate),
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,11 +987,11 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
if (card.isFileOpen()) {
//saved_feedrate_percentage = feedrate_percentage;
feedrate_percentage = 100;
#if EXTRUDERS
#if HAS_EXTRUDERS
planner.flow_percentage[0] = 100;
planner.e_factor[0] = planner.flow_percentage[0] * 0.01f;
#endif
#if EXTRUDERS == 2
#if HAS_MULTI_EXTRUDER
planner.flow_percentage[1] = 100;
planner.e_factor[1] = planner.flow_percentage[1] * 0.01f;
#endif
Expand Down

0 comments on commit 3ce5470

Please sign in to comment.