Browse Source

Menu item to preheat only the hotend

Scott Lahteine 7 years ago
parent
commit
6c5312559c
2 changed files with 108 additions and 35 deletions
  1. 3
    0
      Marlin/language_en.h
  2. 105
    35
      Marlin/ultralcd.cpp

+ 3
- 0
Marlin/language_en.h View File

129
 #ifndef MSG_COOLDOWN
129
 #ifndef MSG_COOLDOWN
130
   #define MSG_COOLDOWN                        _UxGT("Cooldown")
130
   #define MSG_COOLDOWN                        _UxGT("Cooldown")
131
 #endif
131
 #endif
132
+#ifndef MSG_HOTEND
133
+  #define MSG_HOTEND                          _UxGT("Hotend")
134
+#endif
132
 #ifndef MSG_SWITCH_PS_ON
135
 #ifndef MSG_SWITCH_PS_ON
133
   #define MSG_SWITCH_PS_ON                    _UxGT("Switch power on")
136
   #define MSG_SWITCH_PS_ON                    _UxGT("Switch power on")
134
 #endif
137
 #endif

+ 105
- 35
Marlin/ultralcd.cpp View File

1009
   void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) {
1009
   void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) {
1010
     if (temph > 0) thermalManager.setTargetHotend(min(heater_maxtemp[endnum], temph), endnum);
1010
     if (temph > 0) thermalManager.setTargetHotend(min(heater_maxtemp[endnum], temph), endnum);
1011
     #if TEMP_SENSOR_BED != 0
1011
     #if TEMP_SENSOR_BED != 0
1012
-      thermalManager.setTargetBed(tempb);
1012
+      if (tempb >= 0) thermalManager.setTargetBed(tempb);
1013
     #else
1013
     #else
1014
       UNUSED(tempb);
1014
       UNUSED(tempb);
1015
     #endif
1015
     #endif
1026
   }
1026
   }
1027
 
1027
 
1028
   #if TEMP_SENSOR_0 != 0
1028
   #if TEMP_SENSOR_0 != 0
1029
-    void lcd_preheat_material1_hotend0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1030
-    void lcd_preheat_material2_hotend0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1029
+    void lcd_preheat_m1_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1030
+    void lcd_preheat_m2_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1031
+    #if TEMP_SENSOR_BED != 0
1032
+      void lcd_preheat_m1_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1033
+      void lcd_preheat_m2_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1034
+    #endif
1031
   #endif
1035
   #endif
1032
 
1036
 
1033
   #if HOTENDS > 1
1037
   #if HOTENDS > 1
1034
-    void lcd_preheat_material1_hotend1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1035
-    void lcd_preheat_material2_hotend1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1038
+    void lcd_preheat_m1_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1039
+    void lcd_preheat_m2_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1040
+    #if TEMP_SENSOR_BED != 0
1041
+      void lcd_preheat_m1_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1042
+      void lcd_preheat_m2_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1043
+    #endif
1036
     #if HOTENDS > 2
1044
     #if HOTENDS > 2
1037
-      void lcd_preheat_material1_hotend2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1038
-      void lcd_preheat_material2_hotend2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1045
+      void lcd_preheat_m1_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1046
+      void lcd_preheat_m2_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1047
+      #if TEMP_SENSOR_BED != 0
1048
+        void lcd_preheat_m1_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1049
+        void lcd_preheat_m2_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1050
+      #endif
1039
       #if HOTENDS > 3
1051
       #if HOTENDS > 3
1040
-        void lcd_preheat_material1_hotend3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1041
-        void lcd_preheat_material2_hotend3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1052
+        void lcd_preheat_m1_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1053
+        void lcd_preheat_m2_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1054
+        #if TEMP_SENSOR_BED != 0
1055
+          void lcd_preheat_m1_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1056
+          void lcd_preheat_m2_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1057
+        #endif
1042
       #endif
1058
       #endif
1043
     #endif
1059
     #endif
1044
 
1060
 
1045
-    void lcd_preheat_material1_hotend0123() {
1061
+    void lcd_preheat_m1_all() {
1046
       #if HOTENDS > 1
1062
       #if HOTENDS > 1
1047
         thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1);
1063
         thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1);
1048
         #if HOTENDS > 2
1064
         #if HOTENDS > 2
1052
           #endif
1068
           #endif
1053
         #endif
1069
         #endif
1054
       #endif
1070
       #endif
1055
-      lcd_preheat_material1_hotend0();
1071
+      #if TEMP_SENSOR_BED != 0
1072
+        lcd_preheat_m1_e0();
1073
+      #else
1074
+        lcd_preheat_m1_e0_only();
1075
+      #endif
1056
     }
1076
     }
1057
-    void lcd_preheat_material2_hotend0123() {
1077
+    void lcd_preheat_m2_all() {
1058
       #if HOTENDS > 1
1078
       #if HOTENDS > 1
1059
         thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1);
1079
         thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1);
1060
         #if HOTENDS > 2
1080
         #if HOTENDS > 2
1064
           #endif
1084
           #endif
1065
         #endif
1085
         #endif
1066
       #endif
1086
       #endif
1067
-      lcd_preheat_material2_hotend0();
1087
+      #if TEMP_SENSOR_BED != 0
1088
+        lcd_preheat_m1_e0();
1089
+      #else
1090
+        lcd_preheat_m1_e0_only();
1091
+      #endif
1068
     }
1092
     }
1069
 
1093
 
1070
   #endif // HOTENDS > 1
1094
   #endif // HOTENDS > 1
1071
 
1095
 
1072
   #if TEMP_SENSOR_BED != 0
1096
   #if TEMP_SENSOR_BED != 0
1073
-    void lcd_preheat_material1_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1074
-    void lcd_preheat_material2_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1097
+    void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1098
+    void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1075
   #endif
1099
   #endif
1076
 
1100
 
1077
   #if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0)
1101
   #if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0)
1078
 
1102
 
1079
-    void lcd_preheat_material1_menu() {
1103
+    void lcd_preheat_m1_menu() {
1080
       START_MENU();
1104
       START_MENU();
1081
       MENU_BACK(MSG_PREPARE);
1105
       MENU_BACK(MSG_PREPARE);
1082
       #if HOTENDS == 1
1106
       #if HOTENDS == 1
1083
-        MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_material1_hotend0);
1107
+        #if TEMP_SENSOR_BED != 0
1108
+          MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0);
1109
+          MENU_ITEM(function, MSG_PREHEAT_1 MSG_HOTEND, lcd_preheat_m1_e0_only);
1110
+        #else
1111
+          MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only);
1112
+        #endif
1084
       #else
1113
       #else
1085
-        MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_material1_hotend0);
1086
-        MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_material1_hotend1);
1114
+        #if TEMP_SENSOR_BED != 0
1115
+          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0);
1116
+          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E1, lcd_preheat_m1_e0_only);
1117
+          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1);
1118
+          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E2, lcd_preheat_m1_e1_only);
1119
+        #else
1120
+          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only);
1121
+          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only);
1122
+        #endif
1087
         #if HOTENDS > 2
1123
         #if HOTENDS > 2
1088
-          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_material1_hotend2);
1124
+          MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only);
1125
+          #if TEMP_SENSOR_BED != 0
1126
+            MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2);
1127
+            MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E3, lcd_preheat_m1_e2_only);
1128
+          #else
1129
+            MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only);
1130
+          #endif
1089
           #if HOTENDS > 3
1131
           #if HOTENDS > 3
1090
-            MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_material1_hotend3);
1132
+            #if TEMP_SENSOR_BED != 0
1133
+              MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3);
1134
+              MENU_ITEM(function, MSG_PREHEAT_1_N MSG_HOTEND " " MSG_E4, lcd_preheat_m1_e3_only);
1135
+            #else
1136
+              MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only);
1137
+            #endif
1091
           #endif
1138
           #endif
1092
         #endif
1139
         #endif
1093
-        MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_material1_hotend0123);
1140
+        MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all);
1094
       #endif
1141
       #endif
1095
       #if TEMP_SENSOR_BED != 0
1142
       #if TEMP_SENSOR_BED != 0
1096
-        MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_material1_bedonly);
1143
+        MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly);
1097
       #endif
1144
       #endif
1098
       END_MENU();
1145
       END_MENU();
1099
     }
1146
     }
1100
 
1147
 
1101
-    void lcd_preheat_material2_menu() {
1148
+    void lcd_preheat_m2_menu() {
1102
       START_MENU();
1149
       START_MENU();
1103
       MENU_BACK(MSG_PREPARE);
1150
       MENU_BACK(MSG_PREPARE);
1104
       #if HOTENDS == 1
1151
       #if HOTENDS == 1
1105
-        MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_material2_hotend0);
1152
+        #if TEMP_SENSOR_BED != 0
1153
+          MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0);
1154
+          MENU_ITEM(function, MSG_PREHEAT_2 MSG_HOTEND, lcd_preheat_m2_e0_only);
1155
+        #else
1156
+          MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only);
1157
+        #endif
1106
       #else
1158
       #else
1107
-        MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_material2_hotend0);
1108
-        MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_material2_hotend1);
1159
+        #if TEMP_SENSOR_BED != 0
1160
+          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0);
1161
+          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E1, lcd_preheat_m2_e0_only);
1162
+          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1);
1163
+          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E2, lcd_preheat_m2_e1_only);
1164
+        #else
1165
+          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only);
1166
+          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only);
1167
+        #endif
1109
         #if HOTENDS > 2
1168
         #if HOTENDS > 2
1110
-          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_material2_hotend2);
1169
+          MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only);
1170
+          #if TEMP_SENSOR_BED != 0
1171
+            MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2);
1172
+            MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E3, lcd_preheat_m2_e2_only);
1173
+          #else
1174
+            MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only);
1175
+          #endif
1111
           #if HOTENDS > 3
1176
           #if HOTENDS > 3
1112
-            MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_material2_hotend3);
1177
+            #if TEMP_SENSOR_BED != 0
1178
+              MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3);
1179
+              MENU_ITEM(function, MSG_PREHEAT_2_N MSG_HOTEND " " MSG_E4, lcd_preheat_m2_e3_only);
1180
+            #else
1181
+              MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only);
1182
+            #endif
1113
           #endif
1183
           #endif
1114
         #endif
1184
         #endif
1115
-        MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_material2_hotend0123);
1185
+        MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all);
1116
       #endif
1186
       #endif
1117
       #if TEMP_SENSOR_BED != 0
1187
       #if TEMP_SENSOR_BED != 0
1118
-        MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_material2_bedonly);
1188
+        MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly);
1119
       #endif
1189
       #endif
1120
       END_MENU();
1190
       END_MENU();
1121
     }
1191
     }
1396
       // Preheat for Material 1 and 2
1466
       // Preheat for Material 1 and 2
1397
       //
1467
       //
1398
       #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
1468
       #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
1399
-        MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_material1_menu);
1400
-        MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_material2_menu);
1469
+        MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_m1_menu);
1470
+        MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_m2_menu);
1401
       #else
1471
       #else
1402
-        MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_material1_hotend0);
1403
-        MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_material2_hotend0);
1472
+        MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only);
1473
+        MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only);
1404
       #endif
1474
       #endif
1405
 
1475
 
1406
     #endif // TEMP_SENSOR_0 != 0
1476
     #endif // TEMP_SENSOR_0 != 0

Loading…
Cancel
Save