Преглед изворни кода

Realized it's not a bug, but cleanup code anyway

Scott Lahteine пре 10 година
родитељ
комит
bca884bf72
1 измењених фајлова са 17 додато и 19 уклоњено
  1. 17
    19
      Marlin/Marlin_main.cpp

+ 17
- 19
Marlin/Marlin_main.cpp Прегледај датотеку

@@ -2893,26 +2893,24 @@ Sigma_Exit:
2893 2893
 
2894 2894
         float area = .0;
2895 2895
         if(code_seen('D')) {
2896
-          float diameter = (float)code_value();
2897
-          if (diameter == 0.0) {
2898
-            // setting any extruder filament size disables volumetric on the assumption that
2899
-            // slicers either generate in extruder values as cubic mm or as as filament feeds
2900
-            // for all extruders
2901
-            volumetric_enabled = false;
2902
-          } else {
2903
-            filament_size[tmp_extruder] = (float)code_value();
2896
+          float diameter = code_value();
2897
+          // setting any extruder filament size disables volumetric on the assumption that
2898
+          // slicers either generate in extruder values as cubic mm or as as filament feeds
2899
+          // for all extruders
2900
+          volumetric_enabled = (diameter != 0.0);
2901
+          if (volumetric_enabled) {
2902
+            filament_size[tmp_extruder] = diameter;
2904 2903
             // make sure all extruders have some sane value for the filament size
2905
-            filament_size[0] = (filament_size[0] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : filament_size[0]);
2906
-#if EXTRUDERS > 1
2907
-            filament_size[1] = (filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : filament_size[1]);
2908
-#if EXTRUDERS > 2
2909
-            filament_size[2] = (filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : filament_size[2]);
2910
-#if EXTRUDERS > 3
2911
-            filament_size[3] = (filament_size[3] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : filament_size[3]);
2912
-#endif //EXTRUDERS > 3
2913
-#endif //EXTRUDERS > 2
2914
-#endif //EXTRUDERS > 1
2915
-            volumetric_enabled = true;
2904
+            if (! filament_size[0]) filament_size[0] = DEFAULT_NOMINAL_FILAMENT_DIA;
2905
+            #if EXTRUDERS > 1
2906
+              if (! filament_size[1]) filament_size[1] = DEFAULT_NOMINAL_FILAMENT_DIA;
2907
+              #if EXTRUDERS > 2
2908
+                if (! filament_size[2]) filament_size[2] = DEFAULT_NOMINAL_FILAMENT_DIA;
2909
+                #if EXTRUDERS > 3
2910
+                  if (! filament_size[3]) filament_size[3] = DEFAULT_NOMINAL_FILAMENT_DIA;
2911
+                #endif
2912
+              #endif
2913
+            #endif
2916 2914
           }
2917 2915
         } else {
2918 2916
           //reserved for setting filament diameter via UFID or filament measuring device

Loading…
Откажи
Сачувај