Ver código fonte

Cancel Objects followup

Scott Lahteine 5 anos atrás
pai
commit
600429a067

+ 1
- 1
Marlin/src/lcd/language/language_en.h Ver arquivo

@@ -427,7 +427,7 @@ namespace Language_en {
427 427
   PROGMEM Language_Str MSG_PAUSE_PRINT                     = _UxGT("Pause Print");
428 428
   PROGMEM Language_Str MSG_RESUME_PRINT                    = _UxGT("Resume Print");
429 429
   PROGMEM Language_Str MSG_STOP_PRINT                      = _UxGT("Stop Print");
430
-  PROGMEM Language_Str MSG_OBJECT_CANCEL                   = _UxGT("Cancel Object");
430
+  PROGMEM Language_Str MSG_CANCEL_OBJECT                   = _UxGT("Cancel Object");
431 431
   PROGMEM Language_Str MSG_OUTAGE_RECOVERY                 = _UxGT("Outage Recovery");
432 432
   PROGMEM Language_Str MSG_MEDIA_MENU                      = _UxGT("Print from Media");
433 433
   PROGMEM Language_Str MSG_NO_MEDIA                        = _UxGT("No Media");

+ 0
- 1
Marlin/src/lcd/menu/menu.cpp Ver arquivo

@@ -25,7 +25,6 @@
25 25
 #if HAS_LCD_MENU
26 26
 
27 27
 #include "menu.h"
28
-#include "../ultralcd.h"
29 28
 #include "../../module/planner.h"
30 29
 #include "../../module/motion.h"
31 30
 #include "../../module/printcounter.h"

+ 0
- 6
Marlin/src/lcd/menu/menu.h Ver arquivo

@@ -365,12 +365,6 @@ class MenuItem_bool {
365 365
   ++_thisItemNr;                                          \
366 366
 } while(0)
367 367
 
368
-#define MENU_ITEM_ADDON_START(X) do{ \
369
-  if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \
370
-    SETCURSOR(X, _lcdLineNr)
371
-
372
-#define MENU_ITEM_ADDON_END() } }while(0)
373
-
374 368
 #define STATIC_ITEM(LABEL, V...) STATIC_ITEM_P(GET_TEXT(LABEL), ##V)
375 369
 
376 370
 #define MENU_ITEM_P(TYPE, PLABEL, V...)       _MENU_ITEM_P(TYPE, false, PLABEL, ##V)

+ 33
- 0
Marlin/src/lcd/menu/menu_addon.h Ver arquivo

@@ -0,0 +1,33 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#include "../lcdprint.h"
25
+#if HAS_GRAPHICAL_LCD
26
+  #include "../dogm/ultralcd_DOGM.h"
27
+#endif
28
+
29
+#define MENU_ITEM_ADDON_START(X) do{ \
30
+  if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \
31
+    SETCURSOR(X, _lcdLineNr)
32
+
33
+#define MENU_ITEM_ADDON_END() } }while(0)

+ 1
- 1
Marlin/src/lcd/menu/menu_advanced.cpp Ver arquivo

@@ -654,7 +654,7 @@ void menu_advanced_settings() {
654 654
   #endif
655 655
 
656 656
   #if ENABLED(CANCEL_OBJECTS)
657
-    SUBMENU(MSG_CANCELOBJECTS, [](){ editable.int8 = -1; goto_screen(menu_cancelobject); });
657
+    SUBMENU(MSG_CANCEL_OBJECT, [](){ editable.int8 = -1; ui.goto_screen(menu_cancelobject); });
658 658
   #endif
659 659
 
660 660
   #if ENABLED(DAC_STEPPER_CURRENT)

+ 5
- 4
Marlin/src/lcd/menu/menu_cancelobject.cpp Ver arquivo

@@ -29,6 +29,7 @@
29 29
 #if HAS_LCD_MENU && ENABLED(CANCEL_OBJECTS)
30 30
 
31 31
 #include "menu.h"
32
+#include "menu_addon.h"
32 33
 
33 34
 #include "../../feature/cancel_object.h"
34 35
 
@@ -39,15 +40,15 @@
39 40
 //
40 41
 void menu_cancelobject() {
41 42
   START_MENU();
42
-  MENU_BACK(MSG_MAIN);
43
+  BACK_ITEM(MSG_MAIN);
43 44
 
44
-  GCODES_ITEM(MSG_OBJECT_CANCEL, PSTR("M486 C"));
45
+  GCODES_ITEM(MSG_CANCEL_OBJECT, PSTR("M486 C"));
45 46
 
46 47
   // Draw cancelable items in a loop
47 48
   for (int8_t i = 0; i < cancelable.object_count; i++) {
48 49
     if (!TEST(cancelable.canceled, i)) {
49 50
       editable.int8 = i;
50
-      ACTION_ITEM(MSG_OBJECT_CANCEL, [](){
51
+      ACTION_ITEM(MSG_CANCEL_OBJECT, [](){
51 52
         cancelable.cancel_object(editable.int8);
52 53
         ui.quick_feedback();
53 54
       });
@@ -58,7 +59,7 @@ void menu_cancelobject() {
58 59
   }
59 60
 
60 61
   /*
61
-  MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_OBJECT_CANCEL, &editable.int8, -1, 32, [](){
62
+  MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_CANCEL_OBJECT, &editable.int8, -1, 32, [](){
62 63
     if (editable.int8 > -1) {
63 64
       cancelable.cancel_object(editable.int8);
64 65
       ui.quick_feedback();

+ 2
- 4
Marlin/src/lcd/menu/menu_mixer.cpp Ver arquivo

@@ -29,11 +29,9 @@
29 29
 #if HAS_LCD_MENU && ENABLED(MIXING_EXTRUDER)
30 30
 
31 31
 #include "menu.h"
32
-#include "../../feature/mixing.h"
32
+#include "menu_addon.h"
33 33
 
34
-#include "../dogm/ultralcd_DOGM.h"
35
-#include "../ultralcd.h"
36
-#include "../lcdprint.h"
34
+#include "../../feature/mixing.h"
37 35
 
38 36
 #define CHANNEL_MIX_EDITING !DUAL_MIXING_EXTRUDER
39 37
 

+ 1
- 6
Marlin/src/lcd/menu/menu_motion.cpp Ver arquivo

@@ -29,12 +29,7 @@
29 29
 #if HAS_LCD_MENU
30 30
 
31 31
 #include "menu.h"
32
-
33
-#include "../lcdprint.h"
34
-
35
-#if HAS_GRAPHICAL_LCD
36
-  #include "../dogm/ultralcd_DOGM.h"
37
-#endif
32
+#include "menu_addon.h"
38 33
 
39 34
 #include "../../module/motion.h"
40 35
 

Carregando…
Cancelar
Salvar