From b24b0f385fc145cd6648d8dbdd47e555d52eca9b Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 30 Nov 2019 08:23:53 -0500 Subject: [PATCH] Add ExtUI Flow Rate method (#16048) --- Marlin/src/lcd/extensible_ui/ui_api.cpp | 5 +++++ Marlin/src/lcd/extensible_ui/ui_api.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index d4c92c7d2..42e807b8b 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 8d7c98fc3..ea5eaa8b7 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)