Browse Source

Added Extrude From Multiple Extruders from LCD feature

Eric Kuzmenko 9 years ago
parent
commit
b23d765991
2 changed files with 46 additions and 1 deletions
  1. 15
    0
      Marlin/language_en.h
  2. 31
    1
      Marlin/ultralcd.cpp

+ 15
- 0
Marlin/language_en.h View File

@@ -120,6 +120,21 @@
120 120
 #ifndef MSG_MOVE_E
121 121
 #define MSG_MOVE_E                          "Extruder"
122 122
 #endif
123
+#if EXTRUDERS > 1
124
+  #ifndef MSG_MOVE_E1
125
+  #define MSG_MOVE_E1                       "Extruder1"
126
+  #endif
127
+  #if EXTRUDERS > 2
128
+    #ifndef MSG_MOVE_E2
129
+    #define MSG_MOVE_E2                     "Extruder2"
130
+    #endif
131
+    #if EXTRUDERS > 3
132
+      #ifndef MSG_MOVE_E3
133
+      #define MSG_MOVE_E3                   "Extruder3"
134
+      #endif
135
+    #endif
136
+  #endif // EXTRUDERS > 2
137
+#endif // EXTRUDERS > 1
123 138
 #ifndef MSG_MOVE_01MM
124 139
 #define MSG_MOVE_01MM                       "Move 0.1mm"
125 140
 #endif

+ 31
- 1
Marlin/ultralcd.cpp View File

@@ -743,7 +743,15 @@ static void _lcd_move(const char *name, AxisEnum axis, int min, int max) {
743 743
 static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, X_MIN_POS, X_MAX_POS); }
744 744
 static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, Y_MIN_POS, Y_MAX_POS); }
745 745
 static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, Z_MIN_POS, Z_MAX_POS); }
746
-static void lcd_move_e() {
746
+static void lcd_move_e(
747
+#if EXTRUDERS > 1
748
+  uint8_t e = 0
749
+#endif
750
+) {
751
+  #if EXTRUDERS > 1
752
+    unsigned short original_active_extruder = active_extruder;
753
+    active_extruder = e;
754
+  #endif
747 755
   if (encoderPosition != 0) {
748 756
     current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
749 757
     encoderPosition = 0;
@@ -752,8 +760,21 @@ static void lcd_move_e() {
752 760
   }
753 761
   if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_MOVE_E), ftostr31(current_position[E_AXIS]));
754 762
   if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis);
763
+  #if EXTRUDERS > 1
764
+    active_extruder = original_active_extruder;
765
+  #endif
755 766
 }
756 767
 
768
+#if EXTRUDERS > 1
769
+  static void lcd_move_e1() { lcd_move_e(1) }
770
+  #if EXTRUDERS > 2
771
+    static void lcd_move_e2() { lcd_move_e(2) }
772
+    #if EXTRUDERS > 3
773
+      static void lcd_move_e3() { lcd_move_e(3) }
774
+    #endif
775
+  #endif
776
+#endif // EXTRUDERS > 1
777
+
757 778
 /**
758 779
  *
759 780
  * "Prepare" > "Move Xmm" > "Move XYZ" submenu
@@ -768,6 +789,15 @@ static void lcd_move_menu_axis() {
768 789
   if (move_menu_scale < 10.0) {
769 790
     MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
770 791
     MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
792
+    #if EXTRUDERS > 1
793
+      MENU_ITEM(submenu, MSG_MOVE_E1, lcd_move_e1);
794
+      #if EXTRUDERS > 2
795
+        MENU_ITEM(submenu, MSG_MOVE_E2, lcd_move_e2);
796
+        #if EXTRUDERS > 3
797
+          MENU_ITEM(submenu, MSG_MOVE_E3, lcd_move_e3);
798
+        #endif
799
+      #endif
800
+    #endif // EXTRUDERS > 1
771 801
   }
772 802
   END_MENU();
773 803
 }

Loading…
Cancel
Save