Cancel Objects followup

This commit is contained in:
Scott Lahteine 2019-10-25 19:49:48 -05:00
parent e690471739
commit 600429a067
8 changed files with 43 additions and 23 deletions

View file

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

View file

@ -25,7 +25,6 @@
#if HAS_LCD_MENU #if HAS_LCD_MENU
#include "menu.h" #include "menu.h"
#include "../ultralcd.h"
#include "../../module/planner.h" #include "../../module/planner.h"
#include "../../module/motion.h" #include "../../module/motion.h"
#include "../../module/printcounter.h" #include "../../module/printcounter.h"

View file

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

View file

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

View file

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

View file

@ -29,6 +29,7 @@
#if HAS_LCD_MENU && ENABLED(CANCEL_OBJECTS) #if HAS_LCD_MENU && ENABLED(CANCEL_OBJECTS)
#include "menu.h" #include "menu.h"
#include "menu_addon.h"
#include "../../feature/cancel_object.h" #include "../../feature/cancel_object.h"
@ -39,15 +40,15 @@
// //
void menu_cancelobject() { void menu_cancelobject() {
START_MENU(); START_MENU();
MENU_BACK(MSG_MAIN); BACK_ITEM(MSG_MAIN);
GCODES_ITEM(MSG_OBJECT_CANCEL, PSTR("M486 C")); GCODES_ITEM(MSG_CANCEL_OBJECT, PSTR("M486 C"));
// Draw cancelable items in a loop // Draw cancelable items in a loop
for (int8_t i = 0; i < cancelable.object_count; i++) { for (int8_t i = 0; i < cancelable.object_count; i++) {
if (!TEST(cancelable.canceled, i)) { if (!TEST(cancelable.canceled, i)) {
editable.int8 = i; editable.int8 = i;
ACTION_ITEM(MSG_OBJECT_CANCEL, [](){ ACTION_ITEM(MSG_CANCEL_OBJECT, [](){
cancelable.cancel_object(editable.int8); cancelable.cancel_object(editable.int8);
ui.quick_feedback(); ui.quick_feedback();
}); });
@ -58,7 +59,7 @@ void menu_cancelobject() {
} }
/* /*
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_OBJECT_CANCEL, &editable.int8, -1, 32, [](){ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_CANCEL_OBJECT, &editable.int8, -1, 32, [](){
if (editable.int8 > -1) { if (editable.int8 > -1) {
cancelable.cancel_object(editable.int8); cancelable.cancel_object(editable.int8);
ui.quick_feedback(); ui.quick_feedback();

View file

@ -29,11 +29,9 @@
#if HAS_LCD_MENU && ENABLED(MIXING_EXTRUDER) #if HAS_LCD_MENU && ENABLED(MIXING_EXTRUDER)
#include "menu.h" #include "menu.h"
#include "../../feature/mixing.h" #include "menu_addon.h"
#include "../dogm/ultralcd_DOGM.h" #include "../../feature/mixing.h"
#include "../ultralcd.h"
#include "../lcdprint.h"
#define CHANNEL_MIX_EDITING !DUAL_MIXING_EXTRUDER #define CHANNEL_MIX_EDITING !DUAL_MIXING_EXTRUDER

View file

@ -29,12 +29,7 @@
#if HAS_LCD_MENU #if HAS_LCD_MENU
#include "menu.h" #include "menu.h"
#include "menu_addon.h"
#include "../lcdprint.h"
#if HAS_GRAPHICAL_LCD
#include "../dogm/ultralcd_DOGM.h"
#endif
#include "../../module/motion.h" #include "../../module/motion.h"