Browse Source

Add ExtUI Flow Rate method (#16048)

InsanityAutomation 5 years ago
parent
commit
b24b0f385f
2 changed files with 7 additions and 0 deletions
  1. 5
    0
      Marlin/src/lcd/extensible_ui/ui_api.cpp
  2. 2
    0
      Marlin/src/lcd/extensible_ui/ui_api.h

+ 5
- 0
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

@@ -683,12 +683,17 @@ namespace ExtUI {
683 683
   #endif
684 684
 
685 685
   feedRate_t getFeedrate_mm_s()                       { return feedrate_mm_s; }
686
+  int16_t getFlowPercentage(const extruder_t extr)    { return planner.flow_percentage[extr]; }
686 687
   feedRate_t getMinFeedrate_mm_s()                    { return planner.settings.min_feedrate_mm_s; }
687 688
   feedRate_t getMinTravelFeedrate_mm_s()              { return planner.settings.min_travel_feedrate_mm_s; }
688 689
   float getPrintingAcceleration_mm_s2()               { return planner.settings.acceleration; }
689 690
   float getRetractAcceleration_mm_s2()                { return planner.settings.retract_acceleration; }
690 691
   float getTravelAcceleration_mm_s2()                 { return planner.settings.travel_acceleration; }
691 692
   void setFeedrate_mm_s(const feedRate_t fr)          { feedrate_mm_s = fr; }
693
+  void setFlow_percent(const int16_t flow, const extruder_t extr) {
694
+    planner.flow_percentage[extr] = flow;
695
+    planner.refresh_e_factor(extr);
696
+  }
692 697
   void setMinFeedrate_mm_s(const feedRate_t fr)       { planner.settings.min_feedrate_mm_s = fr; }
693 698
   void setMinTravelFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_travel_feedrate_mm_s = fr; }
694 699
   void setPrintingAcceleration_mm_s2(const float acc) { planner.settings.acceleration = acc; }

+ 2
- 0
Marlin/src/lcd/extensible_ui/ui_api.h View File

@@ -126,6 +126,7 @@ namespace ExtUI {
126 126
   float getRetractAcceleration_mm_s2();
127 127
   float getTravelAcceleration_mm_s2();
128 128
   float getFeedrate_percent();
129
+  int16_t getFlowPercentage(const extruder_t);
129 130
   uint8_t getProgress_percent();
130 131
   uint32_t getProgress_seconds_elapsed();
131 132
 
@@ -172,6 +173,7 @@ namespace ExtUI {
172 173
   void setRetractAcceleration_mm_s2(const float);
173 174
   void setTravelAcceleration_mm_s2(const float);
174 175
   void setFeedrate_percent(const float);
176
+  void setFlow_percent(const int16_t, const extruder_t);
175 177
   void setUserConfirmed();
176 178
 
177 179
   #if ENABLED(LIN_ADVANCE)

Loading…
Cancel
Save