diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index d4c92c7d20..42e807b8bb 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -683,12 +683,17 @@ namespace ExtUI { #endif feedRate_t getFeedrate_mm_s() { return feedrate_mm_s; } + int16_t getFlowPercentage(const extruder_t extr) { return planner.flow_percentage[extr]; } feedRate_t getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; } feedRate_t getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; } float getPrintingAcceleration_mm_s2() { return planner.settings.acceleration; } float getRetractAcceleration_mm_s2() { return planner.settings.retract_acceleration; } float getTravelAcceleration_mm_s2() { return planner.settings.travel_acceleration; } void setFeedrate_mm_s(const feedRate_t fr) { feedrate_mm_s = fr; } + void setFlow_percent(const int16_t flow, const extruder_t extr) { + planner.flow_percentage[extr] = flow; + planner.refresh_e_factor(extr); + } void setMinFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_feedrate_mm_s = fr; } void setMinTravelFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_travel_feedrate_mm_s = fr; } void setPrintingAcceleration_mm_s2(const float acc) { planner.settings.acceleration = acc; } diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index 8d7c98fc3c..ea5eaa8b74 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -126,6 +126,7 @@ namespace ExtUI { float getRetractAcceleration_mm_s2(); float getTravelAcceleration_mm_s2(); float getFeedrate_percent(); + int16_t getFlowPercentage(const extruder_t); uint8_t getProgress_percent(); uint32_t getProgress_seconds_elapsed(); @@ -172,6 +173,7 @@ namespace ExtUI { void setRetractAcceleration_mm_s2(const float); void setTravelAcceleration_mm_s2(const float); void setFeedrate_percent(const float); + void setFlow_percent(const int16_t, const extruder_t); void setUserConfirmed(); #if ENABLED(LIN_ADVANCE)