Scott Lahteine 8 yıl önce
ebeveyn
işleme
754b13d8fe
1 değiştirilmiş dosya ile 49 ekleme ve 68 silme
  1. 49
    68
      Marlin/ultralcd.cpp

+ 49
- 68
Marlin/ultralcd.cpp Dosyayı Görüntüle

@@ -475,53 +475,51 @@ void lcd_set_home_offsets() {
475 475
 #endif //BABYSTEPPING
476 476
 
477 477
 /**
478
- *
479
- * "Tune" submenu
480
- *
478
+ * Watch temperature callbacks
481 479
  */
480
+#if TEMP_SENSOR_0 != 0
481
+  void watch_temp_callback_E0() { start_watching_heater(0); }
482
+#endif
483
+#if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
484
+  void watch_temp_callback_E1() { start_watching_heater(1); }
485
+  #if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0
486
+    void watch_temp_callback_E2() { start_watching_heater(2); }
487
+    #if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
488
+      void watch_temp_callback_E3() { start_watching_heater(3); }
489
+    #endif // EXTRUDERS > 3
490
+  #endif // EXTRUDERS > 2
491
+#endif // EXTRUDERS > 1
482 492
 
483
-static void lcd_tune_menu() {
484
-  START_MENU();
485
-
486
-  //
487
-  // ^ Main
488
-  //
489
-  MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
490
-
491
-  //
492
-  // Speed:
493
-  //
494
-  MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999);
495
-
493
+/**
494
+ * Items shared between Tune and Temperature menus
495
+ */
496
+static void nozzle_bed_fan_menu_items(uint8_t &encoderLine, uint8_t &_lineNr, uint8_t &_drawLineNr, uint8_t &_menuItemNr, bool &wasClicked, bool &itemSelected) {
496 497
   //
497 498
   // Nozzle:
498
-  // Nozzle 1:
499
-  // Nozzle 2:
500
-  // Nozzle 3:
501
-  // Nozzle 4:
499
+  // Nozzle [1-4]:
502 500
   //
503 501
   #if EXTRUDERS == 1
504 502
     #if TEMP_SENSOR_0 != 0
505
-      MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
503
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
506 504
     #endif
507 505
   #else //EXTRUDERS > 1
508 506
     #if TEMP_SENSOR_0 != 0
509
-      MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N1, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
507
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
510 508
     #endif
511 509
     #if TEMP_SENSOR_1 != 0
512
-      MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N2, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
510
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
513 511
     #endif
514 512
     #if EXTRUDERS > 2
515 513
       #if TEMP_SENSOR_2 != 0
516
-        MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N3, &target_temperature[2], 0, HEATER_2_MAXTEMP - 15);
514
+        MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
517 515
       #endif
518 516
       #if EXTRUDERS > 3
519 517
         #if TEMP_SENSOR_3 != 0
520
-          MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N4, &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
518
+          MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
521 519
         #endif
522
-      #endif //EXTRUDERS > 3
523
-    #endif //EXTRUDERS > 2
524
-  #endif //EXTRUDERS > 1
520
+      #endif // EXTRUDERS > 3
521
+    #endif // EXTRUDERS > 2
522
+  #endif // EXTRUDERS > 1
525 523
 
526 524
   //
527 525
   // Bed:
@@ -534,11 +532,29 @@ static void lcd_tune_menu() {
534 532
   // Fan Speed:
535 533
   //
536 534
   MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
535
+}
536
+
537
+
538
+/**
539
+ *
540
+ * "Tune" submenu
541
+ *
542
+ */
543
+static void lcd_tune_menu() {
544
+  START_MENU();
537 545
 
538 546
   //
539
-  // Flow:
547
+  // ^ Main
548
+  //
549
+  MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
550
+
551
+  //
552
+  // Speed:
540 553
   //
541
-  MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[active_extruder], 10, 999);
554
+  MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999);
555
+
556
+  // Nozzle, Bed, and Fan Control
557
+  nozzle_bed_fan_menu_items(encoderLine, _lineNr, _drawLineNr, _menuItemNr, wasClicked, itemSelected);
542 558
 
543 559
   //
544 560
   // Flow:
@@ -550,6 +566,7 @@ static void lcd_tune_menu() {
550 566
   #if EXTRUDERS == 1
551 567
     MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[0], 10, 999);
552 568
   #else // EXTRUDERS > 1
569
+    MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[active_extruder], 10, 999);
553 570
     MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N1, &extruder_multiplier[0], 10, 999);
554 571
     MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N2, &extruder_multiplier[1], 10, 999);
555 572
     #if EXTRUDERS > 2
@@ -1002,44 +1019,8 @@ static void lcd_control_temperature_menu() {
1002 1019
   //
1003 1020
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
1004 1021
 
1005
-  //
1006
-  // Nozzle
1007
-  // Nozzle 1, Nozzle 2, Nozzle 3, Nozzle 4
1008
-  //
1009
-  #if EXTRUDERS == 1
1010
-    #if TEMP_SENSOR_0 != 0
1011
-      MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
1012
-    #endif
1013
-  #else //EXTRUDERS > 1
1014
-    #if TEMP_SENSOR_0 != 0
1015
-      MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N1, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
1016
-    #endif
1017
-    #if TEMP_SENSOR_1 != 0
1018
-      MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N2, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
1019
-    #endif
1020
-    #if EXTRUDERS > 2
1021
-      #if TEMP_SENSOR_2 != 0
1022
-        MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N3, &target_temperature[2], 0, HEATER_2_MAXTEMP - 15);
1023
-      #endif
1024
-      #if EXTRUDERS > 3
1025
-        #if TEMP_SENSOR_3 != 0
1026
-          MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N4, &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
1027
-        #endif
1028
-      #endif // EXTRUDERS > 3
1029
-    #endif // EXTRUDERS > 2
1030
-  #endif // EXTRUDERS > 1
1031
-
1032
-  //
1033
-  // Bed
1034
-  //
1035
-  #if TEMP_SENSOR_BED != 0
1036
-    MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
1037
-  #endif
1038
-
1039
-  //
1040
-  // Fan Speed
1041
-  //
1042
-  MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
1022
+  // Nozzle, Bed, and Fan Control
1023
+  nozzle_bed_fan_menu_items(encoderLine, _lineNr, _drawLineNr, _menuItemNr, wasClicked, itemSelected);
1043 1024
 
1044 1025
   //
1045 1026
   // Autotemp, Min, Max, Fact

Loading…
İptal
Kaydet