Bläddra i källkod

Enable hotend / bed PID separately in ExtUI (#16827)

proferabg 4 år sedan
förälder
incheckning
3f87f912c5
Inget konto är kopplat till bidragsgivarens mejladress
2 ändrade filer med 27 tillägg och 15 borttagningar
  1. 21
    12
      Marlin/src/lcd/extensible_ui/ui_api.cpp
  2. 6
    3
      Marlin/src/lcd/extensible_ui/ui_api.h

+ 21
- 12
Marlin/src/lcd/extensible_ui/ui_api.cpp Visa fil

@@ -894,42 +894,51 @@ namespace ExtUI {
894 894
 
895 895
   float getFeedrate_percent() { return feedrate_percentage; }
896 896
 
897
-  #if HAS_PID_HEATING
897
+  #if ENABLED(PIDTEMP)
898 898
     float getPIDValues_Kp(const extruder_t tool) {
899 899
       return PID_PARAM(Kp, tool);
900 900
     }
901
+    
901 902
     float getPIDValues_Ki(const extruder_t tool) {
902 903
       return unscalePID_i(PID_PARAM(Ki, tool));
903 904
     }
905
+    
904 906
     float getPIDValues_Kd(const extruder_t tool) {
905 907
       return unscalePID_d(PID_PARAM(Kd, tool));
906 908
     }
909
+
910
+    void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
911
+      thermalManager.temp_hotend[tool].pid.Kp = p;
912
+      thermalManager.temp_hotend[tool].pid.Ki = scalePID_i(i);
913
+      thermalManager.temp_hotend[tool].pid.Kd = scalePID_d(d);
914
+      thermalManager.updatePID();
915
+    }
916
+
917
+    void startPIDTune(const float temp, extruder_t tool){
918
+      thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
919
+    }
920
+  #endif
921
+  
922
+  #if ENABLED(PIDTEMPBED)
907 923
     float getBedPIDValues_Kp() {
908 924
       return thermalManager.temp_bed.pid.Kp;
909 925
     }
926
+    
910 927
     float getBedPIDValues_Ki() {
911 928
       return unscalePID_i(thermalManager.temp_bed.pid.Ki);
912 929
     }
930
+    
913 931
     float getBedPIDValues_Kd() {
914 932
       return unscalePID_d(thermalManager.temp_bed.pid.Kd);
915 933
     }
916
-
917
-    void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
918
-      thermalManager.temp_hotend[tool].pid.Kp = p;
919
-      thermalManager.temp_hotend[tool].pid.Ki = scalePID_i(i);
920
-      thermalManager.temp_hotend[tool].pid.Kd = scalePID_d(d);
921
-      thermalManager.updatePID();
922
-    }
934
+    
923 935
     void setBedPIDValues(const float p, const float i, const float d) {
924 936
       thermalManager.temp_bed.pid.Kp = p;
925 937
       thermalManager.temp_bed.pid.Ki = scalePID_i(i);
926 938
       thermalManager.temp_bed.pid.Kd = scalePID_d(d);
927 939
       thermalManager.updatePID();
928 940
     }
929
-
930
-    void startPIDTune(const float temp, extruder_t tool){
931
-      thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
932
-    }
941
+    
933 942
     void startBedPIDTune(const float temp) {
934 943
       thermalManager.PID_autotune(temp, H_BED, 4, true);
935 944
     }

+ 6
- 3
Marlin/src/lcd/extensible_ui/ui_api.h Visa fil

@@ -249,16 +249,19 @@ namespace ExtUI {
249 249
     #endif
250 250
   #endif
251 251
 
252
-  #if HAS_PID_HEATING
252
+  #if ENABLED(PIDTEMP)
253 253
     float getPIDValues_Kp(const extruder_t);
254 254
     float getPIDValues_Ki(const extruder_t);
255 255
     float getPIDValues_Kd(const extruder_t);
256
+    void setPIDValues(const float, const float, const float, extruder_t);
257
+    void startPIDTune(const float, extruder_t);
258
+  #endif
259
+  
260
+  #if ENABLED(PIDTEMPBED)
256 261
     float getBedPIDValues_Kp();
257 262
     float getBedPIDValues_Ki();
258 263
     float getBedPIDValues_Kd();
259
-    void setPIDValues(const float, const float, const float, extruder_t);
260 264
     void setBedPIDValues(const float, const float, const float);
261
-    void startPIDTune(const float, extruder_t);
262 265
     void startBedPIDTune(const float);
263 266
   #endif
264 267
 

Laddar…
Avbryt
Spara