Browse Source

Merge pull request #1526 from thinkyhead/cleanup_ultralcd

Cleanup and fix ultralcd.cpp
Scott Lahteine 9 years ago
parent
commit
e6af82ba2f
3 changed files with 743 additions and 892 deletions
  1. 4
    13
      Marlin/Marlin_main.cpp
  2. 43
    1
      Marlin/language_en.h
  3. 696
    878
      Marlin/ultralcd.cpp

+ 4
- 13
Marlin/Marlin_main.cpp View File

@@ -4695,21 +4695,12 @@ bool setTargetedHotend(int code){
4695 4695
 
4696 4696
 
4697 4697
 float calculate_volumetric_multiplier(float diameter) {
4698
-	float area = .0;
4699
-	float radius = .0;
4700
-
4701
-	radius = diameter * .5;
4702
-	if (! volumetric_enabled || radius == 0) {
4703
-		area = 1;
4704
-	}
4705
-	else {
4706
-		area = M_PI * pow(radius, 2);
4707
-	}
4708
-
4709
-	return 1.0 / area;
4698
+  if (!volumetric_enabled || diameter == 0) return 1.0;
4699
+  float d2 = diameter * 0.5;
4700
+  return 1.0 / (M_PI * d2 * d2);
4710 4701
 }
4711 4702
 
4712 4703
 void calculate_volumetric_multipliers() {
4713 4704
   for (int i=0; i<EXTRUDERS; i++)
4714
-  	volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
4705
+    volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
4715 4706
 }

+ 43
- 1
Marlin/language_en.h View File

@@ -65,6 +65,18 @@
65 65
 #ifndef MSG_PREHEAT_ABS_SETTINGS
66 66
 #define MSG_PREHEAT_ABS_SETTINGS            MSG_PREHEAT_ABS " conf"
67 67
 #endif
68
+#ifndef MSG_H1
69
+#define MSG_H1                              "1"
70
+#endif
71
+#ifndef MSG_H2
72
+#define MSG_H2                              "2"
73
+#endif
74
+#ifndef MSG_H3
75
+#define MSG_H3                              "3"
76
+#endif
77
+#ifndef MSG_H4
78
+#define MSG_H4                              "4"
79
+#endif
68 80
 #ifndef MSG_COOLDOWN
69 81
 #define MSG_COOLDOWN                        "Cooldown"
70 82
 #endif
@@ -110,6 +122,15 @@
110 122
 #ifndef MSG_NOZZLE
111 123
 #define MSG_NOZZLE                          "Nozzle"
112 124
 #endif
125
+#ifndef MSG_N2
126
+#define MSG_N2                              " 2"
127
+#endif
128
+#ifndef MSG_N3
129
+#define MSG_N3                              " 3"
130
+#endif
131
+#ifndef MSG_N4
132
+#define MSG_N4                              " 4"
133
+#endif
113 134
 #ifndef MSG_BED
114 135
 #define MSG_BED                             "Bed"
115 136
 #endif
@@ -119,6 +140,18 @@
119 140
 #ifndef MSG_FLOW
120 141
 #define MSG_FLOW                            "Flow"
121 142
 #endif
143
+#ifndef MSG_F0
144
+#define MSG_F0                              " 0"
145
+#endif
146
+#ifndef MSG_F1
147
+#define MSG_F1                              " 1"
148
+#endif
149
+#ifndef MSG_F2
150
+#define MSG_F2                              " 2"
151
+#endif
152
+#ifndef MSG_F3
153
+#define MSG_F3                              " 3"
154
+#endif
122 155
 #ifndef MSG_CONTROL
123 156
 #define MSG_CONTROL                         "Control"
124 157
 #endif
@@ -152,6 +185,15 @@
152 185
 #ifndef MSG_PID_C
153 186
 #define MSG_PID_C                           "PID-C"
154 187
 #endif
188
+#ifndef MSG_E2
189
+#define MSG_E2                              " E2"
190
+#endif
191
+#ifndef MSG_E3
192
+#define MSG_E3                              " E3"
193
+#endif
194
+#ifndef MSG_E4
195
+#define MSG_E4                              " E4"
196
+#endif
155 197
 #ifndef MSG_ACC
156 198
 #define MSG_ACC                             "Accel"
157 199
 #endif
@@ -213,7 +255,7 @@
213 255
 #define MSG_VOLUMETRIC                      "Filament"
214 256
 #endif
215 257
 #ifndef MSG_VOLUMETRIC_ENABLED
216
-#define MSG_VOLUMETRIC_ENABLED		          "E in mm" STR_h3
258
+#define MSG_VOLUMETRIC_ENABLED		        "E in mm" STR_h3
217 259
 #endif
218 260
 #ifndef MSG_FILAMENT_SIZE_EXTRUDER_0
219 261
 #define MSG_FILAMENT_SIZE_EXTRUDER_0        "Fil. Dia. 1"

+ 696
- 878
Marlin/ultralcd.cpp
File diff suppressed because it is too large
View File


Loading…
Cancel
Save