Browse Source

Added support for 2nd extruder temperature to UltraLCD

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

+ 4
- 0
Marlin/temperature.h View File

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

+ 117
- 23
Marlin/ultralcd.pde View File

323
     lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
323
     lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
324
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
324
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
325
       lcd.setCursor(10,0);lcdprintPGM("B---/---\001 ");
325
       lcd.setCursor(10,0);lcdprintPGM("B---/---\001 ");
326
+    #elif EXTRUDERS > 1
327
+      lcd.setCursor(10,0);lcdprintPGM("\002---/---\001 ");
326
     #endif
328
     #endif
327
   }
329
   }
328
     
330
     
357
       lcd.print(ftostr3(targetBed));
359
       lcd.print(ftostr3(targetBed));
358
       oldtargetBed=targetBed;
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
   #endif
379
   #endif
361
   //starttime=2;
380
   //starttime=2;
362
   static uint16_t oldtime=0;
381
   static uint16_t oldtime=0;
431
   if(force_lcd_update)  //initial display of content
450
   if(force_lcd_update)  //initial display of content
432
   {
451
   {
433
     encoderpos=feedmultiply;
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
   int tHotEnd0=intround(degHotend0());
456
   int tHotEnd0=intround(degHotend0());
521
       beepshort(); );
537
       beepshort(); );
522
       break;
538
       break;
523
     case ItemP_cooldown:
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
       break;
541
       break;
526
 //    case ItemP_extrude:
542
 //    case ItemP_extrude:
527
   //    MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
543
   //    MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
924
 //   
940
 //   
925
 
941
 
926
 enum {
942
 enum {
927
-  ItemCT_exit,ItemCT_nozzle,
943
+  ItemCT_exit,ItemCT_nozzle0,
928
 #ifdef AUTOTEMP
944
 #ifdef AUTOTEMP
929
   ItemCT_autotempactive,
945
   ItemCT_autotempactive,
930
   ItemCT_autotempmin,ItemCT_autotempmax,ItemCT_autotempfact,
946
   ItemCT_autotempmin,ItemCT_autotempmax,ItemCT_autotempfact,
931
 #endif
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
 ItemCT_bed,
955
 ItemCT_bed,
934
 #endif  
956
 #endif  
935
   ItemCT_fan,
957
   ItemCT_fan,
947
     case ItemCT_exit:
969
     case ItemCT_exit:
948
       MENUITEM(  lcdprintPGM(MSG_CONTROL)  ,  BLOCK;status=Main_Control;beepshort(); ) ;
970
       MENUITEM(  lcdprintPGM(MSG_CONTROL)  ,  BLOCK;status=Main_Control;beepshort(); ) ;
949
       break;
971
       break;
950
-    case ItemCT_nozzle:
972
+    case ItemCT_nozzle0:
951
       {
973
       {
952
         if(force_lcd_update)
974
         if(force_lcd_update)
953
         {
975
         {
981
         }
1003
         }
982
         
1004
         
983
       }break;
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
         if(force_lcd_update)
1081
         if(force_lcd_update)
988
         {
1082
         {
1016
         }
1110
         }
1017
         
1111
         
1018
       }break;  
1112
       }break;  
1019
-      case ItemCT_autotempmax:
1113
+    case ItemCT_autotempmax:
1020
       {
1114
       {
1021
         if(force_lcd_update)
1115
         if(force_lcd_update)
1022
         {
1116
         {
1050
         }
1144
         }
1051
         
1145
         
1052
       }break;  
1146
       }break;  
1053
-      case ItemCT_autotempfact:
1147
+    case ItemCT_autotempfact:
1054
       {
1148
       {
1055
         if(force_lcd_update)
1149
         if(force_lcd_update)
1056
         {
1150
         {
1084
         }
1178
         }
1085
         
1179
         
1086
       }break;
1180
       }break;
1087
-      case ItemCT_autotempactive:
1181
+    case ItemCT_autotempactive:
1088
       {
1182
       {
1089
         if(force_lcd_update)
1183
         if(force_lcd_update)
1090
         {
1184
         {
1111
         }
1205
         }
1112
         
1206
         
1113
       }break;  
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
         if(force_lcd_update)
1212
         if(force_lcd_update)
1119
         {
1213
         {
1146
           lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1240
           lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1147
         }
1241
         }
1148
       }break;
1242
       }break;
1149
-      #endif
1150
-      case ItemCT_fan:
1243
+    #endif
1244
+    case ItemCT_fan:
1151
       {
1245
       {
1152
         if(force_lcd_update)
1246
         if(force_lcd_update)
1153
         {
1247
         {
1182
         }
1276
         }
1183
         
1277
         
1184
       }break;
1278
       }break;
1185
-      	#ifdef PIDTEMP
1186
-      case ItemCT_PID_P: 
1279
+    #ifdef PIDTEMP
1280
+    case ItemCT_PID_P: 
1187
       {
1281
       {
1188
       if(force_lcd_update)
1282
       if(force_lcd_update)
1189
         {
1283
         {
1253
         }
1347
         }
1254
         
1348
         
1255
       }break;
1349
       }break;
1256
-      case ItemCT_PID_D: 
1350
+    case ItemCT_PID_D: 
1257
       {
1351
       {
1258
       if(force_lcd_update)
1352
       if(force_lcd_update)
1259
         {
1353
         {
1325
         }
1419
         }
1326
         
1420
         
1327
       }
1421
       }
1328
-      	#endif
1329
       #endif
1422
       #endif
1423
+    #endif
1330
       break;
1424
       break;
1331
     default:   
1425
     default:   
1332
       break;
1426
       break;
2284
 
2378
 
2285
 #endif //ULTRA_LCD
2379
 #endif //ULTRA_LCD
2286
 
2380
 
2287
-
2381
+

Loading…
Cancel
Save