Clean up LCD Manual Move / UBL Mesh Edit (#18373)

This commit is contained in:
Scott Lahteine
2020-07-03 09:53:22 -05:00
committed by GitHub
parent 2c15a787c7
commit f6a2b64091
14 changed files with 265 additions and 208 deletions

View File

@@ -99,9 +99,6 @@
typedef void (*screenFunc_t)();
typedef void (*menuAction_t)();
// Manual Movement
extern float move_menu_scale;
#if ENABLED(ADVANCED_PAUSE_FEATURE)
void lcd_pause_show_message(const PauseMessage message,
const PauseMode mode=PAUSE_MODE_SAME,
@@ -264,6 +261,35 @@
} preheat_t;
#endif
#if HAS_LCD_MENU
// Manual Movement class
class ManualMove {
public:
static millis_t start_time;
static float menu_scale;
TERN_(IS_KINEMATIC, static float offset);
#if IS_KINEMATIC
static bool processing;
#else
static bool constexpr processing = false;
#endif
#if MULTI_MANUAL
static int8_t e_index;
#else
static int8_t constexpr e_index = 0;
#endif
static uint8_t axis;
static void task();
static void soon(AxisEnum axis
#if MULTI_MANUAL
, const int8_t eindex=-1
#endif
);
};
#endif
////////////////////////////////////////////
//////////// MarlinUI Singleton ////////////
////////////////////////////////////////////
@@ -494,29 +520,14 @@ public:
static void enable_encoder_multiplier(const bool onoff);
#endif
static int8_t manual_move_axis;
static millis_t manual_move_start_time;
#if IS_KINEMATIC
static float manual_move_offset;
static bool processing_manual_move;
#else
static constexpr bool processing_manual_move = false;
#endif
#if E_MANUAL > 1
static int8_t manual_move_e_index;
#else
static constexpr int8_t manual_move_e_index = 0;
#endif
// Manual Movement
static ManualMove manual_move;
// Select Screen (modal NO/YES style dialog)
static bool selection;
static void set_selection(const bool sel) { selection = sel; }
static bool update_selection();
static void manage_manual_move();
static bool lcd_clicked;
static bool use_click();
@@ -609,6 +620,9 @@ public:
static bool external_control;
FORCE_INLINE static void capture() { external_control = true; }
FORCE_INLINE static void release() { external_control = false; }
#if ENABLED(AUTO_BED_LEVELING_UBL)
static void external_encoder();
#endif
#else
static constexpr bool external_control = false;
#endif