Browse Source

Added support for 2nd extruder temperature to UltraLCD

Daid 12 years ago
parent
commit
8503b78876
3 changed files with 126 additions and 24 deletions
  1. 5
    1
      Marlin/language.h
  2. 4
    0
      Marlin/temperature.h
  3. 117
    23
      Marlin/ultralcd.pde

+ 5
- 1
Marlin/language.h View File

@@ -29,6 +29,8 @@
29 29
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
30 30
 	#define MSG_SPEED " Speed:"
31 31
 	#define MSG_NOZZLE " \002Nozzle:"
32
+	#define MSG_NOZZLE1 " \002Nozzle2:"
33
+	#define MSG_NOZZLE2 " \002Nozzle3:"
32 34
 	#define MSG_BED " \002Bed:"
33 35
 	#define MSG_FAN_SPEED " Fan speed:"
34 36
 	#define MSG_FLOW " Flow:"
@@ -174,6 +176,8 @@
174 176
         #define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
175 177
 	#define MSG_SPEED " Geschw:"
176 178
 	#define MSG_NOZZLE " \002Duese:"
179
+	#define MSG_NOZZLE1 " \002Duese2:"
180
+	#define MSG_NOZZLE2 " \002Duese3:"
177 181
 	#define MSG_BED " \002Bett:"
178 182
 	#define MSG_FAN_SPEED " Luefter geschw.:"
179 183
 	#define MSG_FLOW " Fluss:"
@@ -296,4 +300,4 @@
296 300
 	#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
297 301
 
298 302
 #endif
299
-#endif // ifndef LANGUAGE_H
303
+#endif // ifndef LANGUAGE_H

+ 4
- 0
Marlin/temperature.h View File

@@ -129,6 +129,8 @@ FORCE_INLINE bool isCoolingBed() {
129 129
 #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
130 130
 #define isHeatingHotend1() isHeatingHotend(1)
131 131
 #define isCoolingHotend1() isCoolingHotend(1)
132
+#else
133
+#define setTargetHotend1(_celsius) do{}while(0)
132 134
 #endif
133 135
 #if EXTRUDERS > 2
134 136
 #define degHotend2() degHotend(2)
@@ -136,6 +138,8 @@ FORCE_INLINE bool isCoolingBed() {
136 138
 #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
137 139
 #define isHeatingHotend2() isHeatingHotend(2)
138 140
 #define isCoolingHotend2() isCoolingHotend(2)
141
+#else
142
+#define setTargetHotend2(_celsius) do{}while(0)
139 143
 #endif
140 144
 #if EXTRUDERS > 3
141 145
 #error Invalid number of extruders

+ 117
- 23
Marlin/ultralcd.pde View File

@@ -323,6 +323,8 @@ void MainMenu::showStatus()
323 323
     lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
324 324
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
325 325
       lcd.setCursor(10,0);lcdprintPGM("B---/---\001 ");
326
+    #elif EXTRUDERS > 1
327
+      lcd.setCursor(10,0);lcdprintPGM("\002---/---\001 ");
326 328
     #endif
327 329
   }
328 330
     
@@ -357,6 +359,23 @@ void MainMenu::showStatus()
357 359
       lcd.print(ftostr3(targetBed));
358 360
       oldtargetBed=targetBed;
359 361
     }
362
+  #elif EXTRUDERS > 1
363
+    static int olddegHotEnd1=-1;
364
+    static int oldtargetHotEnd1=-1;
365
+    int tHotEnd1=intround(degHotend1());
366
+    if((tHotEnd1!=olddegHotEnd1)||force_lcd_update)
367
+    {
368
+      lcd.setCursor(11,0);
369
+      lcd.print(ftostr3(tHotEnd0));
370
+      olddegHotEnd0=tHotEnd0;
371
+    }
372
+    int ttHotEnd1=intround(degTargetHotend1());
373
+    if((ttHotEnd1!=oldtargetHotEnd0)||force_lcd_update)
374
+    {
375
+      lcd.setCursor(15,0);
376
+      lcd.print(ftostr3(ttHotEnd1));
377
+      oldtargetHotEnd0=ttHotEnd1;
378
+    }
360 379
   #endif
361 380
   //starttime=2;
362 381
   static uint16_t oldtime=0;
@@ -431,10 +450,7 @@ void MainMenu::showStatus()
431 450
   if(force_lcd_update)  //initial display of content
432 451
   {
433 452
     encoderpos=feedmultiply;
434
-    lcd.setCursor(0,0);lcdprintPGM("\002123/567\001 ");
435
-    #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
436
-    lcd.setCursor(10,0);lcdprintPGM("B123/567\001 ");
437
-    #endif
453
+    lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
438 454
   }
439 455
     
440 456
   int tHotEnd0=intround(degHotend0());
@@ -521,7 +537,7 @@ void MainMenu::showPrepare()
521 537
       beepshort(); );
522 538
       break;
523 539
     case ItemP_cooldown:
524
-      MENUITEM(  lcdprintPGM(MSG_COOLDOWN)  ,  BLOCK;setTargetHotend0(0);setTargetBed(0);beepshort(); ) ;
540
+      MENUITEM(  lcdprintPGM(MSG_COOLDOWN)  ,  BLOCK;setTargetHotend0(0);setTargetHotend1(0);setTargetHotend2(0);setTargetBed(0);beepshort(); ) ;
525 541
       break;
526 542
 //    case ItemP_extrude:
527 543
   //    MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
@@ -924,12 +940,18 @@ void MainMenu::showTune()
924 940
 //   
925 941
 
926 942
 enum {
927
-  ItemCT_exit,ItemCT_nozzle,
943
+  ItemCT_exit,ItemCT_nozzle0,
928 944
 #ifdef AUTOTEMP
929 945
   ItemCT_autotempactive,
930 946
   ItemCT_autotempmin,ItemCT_autotempmax,ItemCT_autotempfact,
931 947
 #endif
932
-#if (HEATER_BED_PIN > -1)
948
+#if EXTRUDERS > 1
949
+  ItemCT_nozzle1,
950
+#endif
951
+#if EXTRUDERS > 2
952
+  ItemCT_nozzle2,
953
+#endif
954
+#if defined BED_USES_THERMISTOR || BED_USES_AD595
933 955
 ItemCT_bed,
934 956
 #endif  
935 957
   ItemCT_fan,
@@ -947,7 +969,7 @@ void MainMenu::showControlTemp()
947 969
     case ItemCT_exit:
948 970
       MENUITEM(  lcdprintPGM(MSG_CONTROL)  ,  BLOCK;status=Main_Control;beepshort(); ) ;
949 971
       break;
950
-    case ItemCT_nozzle:
972
+    case ItemCT_nozzle0:
951 973
       {
952 974
         if(force_lcd_update)
953 975
         {
@@ -981,8 +1003,80 @@ void MainMenu::showControlTemp()
981 1003
         }
982 1004
         
983 1005
       }break;
984
-      #ifdef AUTOTEMP
985
-      case ItemCT_autotempmin:
1006
+    #if EXTRUDERS > 1
1007
+    case ItemCT_nozzle1:
1008
+      {
1009
+        if(force_lcd_update)
1010
+        {
1011
+          lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE1);
1012
+          lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend1())));
1013
+        }
1014
+        
1015
+        if((activeline!=line) )
1016
+          break;
1017
+        
1018
+        if(CLICKED)
1019
+        {
1020
+          linechanging=!linechanging;
1021
+          if(linechanging)
1022
+          {
1023
+              encoderpos=intround(degTargetHotend1());
1024
+          }
1025
+          else
1026
+          {
1027
+            setTargetHotend1(encoderpos);
1028
+            encoderpos=activeline*lcdslow;
1029
+            beepshort();
1030
+          }
1031
+          BLOCK;
1032
+        }
1033
+        if(linechanging)
1034
+        {
1035
+          if(encoderpos<0) encoderpos=0;
1036
+          if(encoderpos>260) encoderpos=260;
1037
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1038
+        }
1039
+        
1040
+      }break;
1041
+    #endif
1042
+    #if EXTRUDERS > 2
1043
+    case ItemCT_nozzle2:
1044
+      {
1045
+        if(force_lcd_update)
1046
+        {
1047
+          lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE2);
1048
+          lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend2())));
1049
+        }
1050
+        
1051
+        if((activeline!=line) )
1052
+          break;
1053
+        
1054
+        if(CLICKED)
1055
+        {
1056
+          linechanging=!linechanging;
1057
+          if(linechanging)
1058
+          {
1059
+              encoderpos=intround(degTargetHotend2());
1060
+          }
1061
+          else
1062
+          {
1063
+            setTargetHotend1(encoderpos);
1064
+            encoderpos=activeline*lcdslow;
1065
+            beepshort();
1066
+          }
1067
+          BLOCK;
1068
+        }
1069
+        if(linechanging)
1070
+        {
1071
+          if(encoderpos<0) encoderpos=0;
1072
+          if(encoderpos>260) encoderpos=260;
1073
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1074
+        }
1075
+        
1076
+      }break;
1077
+    #endif
1078
+    #ifdef AUTOTEMP
1079
+    case ItemCT_autotempmin:
986 1080
       {
987 1081
         if(force_lcd_update)
988 1082
         {
@@ -1016,7 +1110,7 @@ void MainMenu::showControlTemp()
1016 1110
         }
1017 1111
         
1018 1112
       }break;  
1019
-      case ItemCT_autotempmax:
1113
+    case ItemCT_autotempmax:
1020 1114
       {
1021 1115
         if(force_lcd_update)
1022 1116
         {
@@ -1050,7 +1144,7 @@ void MainMenu::showControlTemp()
1050 1144
         }
1051 1145
         
1052 1146
       }break;  
1053
-      case ItemCT_autotempfact:
1147
+    case ItemCT_autotempfact:
1054 1148
       {
1055 1149
         if(force_lcd_update)
1056 1150
         {
@@ -1084,7 +1178,7 @@ void MainMenu::showControlTemp()
1084 1178
         }
1085 1179
         
1086 1180
       }break;
1087
-      case ItemCT_autotempactive:
1181
+    case ItemCT_autotempactive:
1088 1182
       {
1089 1183
         if(force_lcd_update)
1090 1184
         {
@@ -1111,9 +1205,9 @@ void MainMenu::showControlTemp()
1111 1205
         }
1112 1206
         
1113 1207
       }break;  
1114
-      #endif //autotemp
1115
-      #if (HEATER_BED_PIN > -1)
1116
-      case ItemCT_bed:
1208
+    #endif //autotemp
1209
+    #if defined BED_USES_THERMISTOR || BED_USES_AD595
1210
+    case ItemCT_bed:
1117 1211
       {
1118 1212
         if(force_lcd_update)
1119 1213
         {
@@ -1146,8 +1240,8 @@ void MainMenu::showControlTemp()
1146 1240
           lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1147 1241
         }
1148 1242
       }break;
1149
-      #endif
1150
-      case ItemCT_fan:
1243
+    #endif
1244
+    case ItemCT_fan:
1151 1245
       {
1152 1246
         if(force_lcd_update)
1153 1247
         {
@@ -1182,8 +1276,8 @@ void MainMenu::showControlTemp()
1182 1276
         }
1183 1277
         
1184 1278
       }break;
1185
-      	#ifdef PIDTEMP
1186
-      case ItemCT_PID_P: 
1279
+    #ifdef PIDTEMP
1280
+    case ItemCT_PID_P: 
1187 1281
       {
1188 1282
       if(force_lcd_update)
1189 1283
         {
@@ -1253,7 +1347,7 @@ void MainMenu::showControlTemp()
1253 1347
         }
1254 1348
         
1255 1349
       }break;
1256
-      case ItemCT_PID_D: 
1350
+    case ItemCT_PID_D: 
1257 1351
       {
1258 1352
       if(force_lcd_update)
1259 1353
         {
@@ -1325,8 +1419,8 @@ void MainMenu::showControlTemp()
1325 1419
         }
1326 1420
         
1327 1421
       }
1328
-      	#endif
1329 1422
       #endif
1423
+    #endif
1330 1424
       break;
1331 1425
     default:   
1332 1426
       break;
@@ -2284,4 +2378,4 @@ char *ftostr52(const float &x)
2284 2378
 
2285 2379
 #endif //ULTRA_LCD
2286 2380
 
2287
-
2381
+

Loading…
Cancel
Save