Fix ExtUI invalid speed, timer (#15031)

This commit is contained in:
InsanityAutomation 2019-08-25 05:46:02 -04:00 committed by Scott Lahteine
parent 155765646e
commit f218405c36
12 changed files with 38 additions and 34 deletions

View file

@ -37,7 +37,7 @@ Babystep babystep;
volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1]; volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1];
#if HAS_LCD_MENU #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
int16_t Babystep::accum; int16_t Babystep::accum;
#if ENABLED(BABYSTEP_DISPLAY_TOTAL) #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
@ -75,7 +75,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
if (!CAN_BABYSTEP(axis)) return; if (!CAN_BABYSTEP(axis)) return;
#if HAS_LCD_MENU #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
accum += distance; // Count up babysteps for the UI accum += distance; // Count up babysteps for the UI
#if ENABLED(BABYSTEP_DISPLAY_TOTAL) #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
axis_total[BS_TOTAL_AXIS(axis)] += distance; axis_total[BS_TOTAL_AXIS(axis)] += distance;

View file

@ -30,7 +30,7 @@
#define BS_TODO_AXIS(A) 0 #define BS_TODO_AXIS(A) 0
#endif #endif
#if HAS_LCD_MENU && ENABLED(BABYSTEP_DISPLAY_TOTAL) #if (HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)) && ENABLED(BABYSTEP_DISPLAY_TOTAL)
#if ENABLED(BABYSTEP_XY) #if ENABLED(BABYSTEP_XY)
#define BS_TOTAL_AXIS(A) A #define BS_TOTAL_AXIS(A) A
#else #else
@ -41,7 +41,7 @@
class Babystep { class Babystep {
public: public:
static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1]; static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1];
#if HAS_LCD_MENU #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
static int16_t accum; // Total babysteps in current edit static int16_t accum; // Total babysteps in current edit
#if ENABLED(BABYSTEP_DISPLAY_TOTAL) #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; // Total babysteps since G28 static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; // Total babysteps since G28

View file

@ -188,7 +188,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
host_action_prompt_show(); host_action_prompt_show();
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Load Filament")); ExtUI::onUserConfirmRequired(PSTR("Load Filament"));
#endif #endif
while (wait_for_user) { while (wait_for_user) {
#if HAS_BUZZER #if HAS_BUZZER
@ -243,7 +243,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Continuous Purge Running..."), PSTR("Continue")); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Continuous Purge Running..."), PSTR("Continue"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Continuous Purge Running...")); ExtUI::onUserConfirmRequired(PSTR("Continuous Purge Running..."));
#endif #endif
for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
@ -524,7 +524,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), PSTR("Continue")); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), PSTR("Continue"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Nozzle Parked")); ExtUI::onUserConfirmRequired(PSTR("Nozzle Parked"));
#endif #endif
while (wait_for_user) { while (wait_for_user) {
#if HAS_BUZZER #if HAS_BUZZER
@ -548,7 +548,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("HeaterTimeout")); ExtUI::onUserConfirmRequired(PSTR("HeaterTimeout"));
#endif #endif
// Wait for LCD click or M108 // Wait for LCD click or M108

View file

@ -716,7 +716,7 @@ void MMU2::filament_runout() {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue")); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("MMU2 Eject Recover")); ExtUI::onUserConfirmRequired(PSTR("MMU2 Eject Recover"));
#endif #endif
while (wait_for_user) idle(); while (wait_for_user) idle();
BUZZ(200, 404); BUZZ(200, 404);

View file

@ -334,7 +334,7 @@ void GcodeSuite::M43() {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue")); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("M43 Wait Called")); ExtUI::onUserConfirmRequired(PSTR("M43 Wait Called"));
#endif #endif
#endif #endif

View file

@ -98,7 +98,7 @@ void GcodeSuite::M0_M1() {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue")); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("M0/1 Break Called")); ExtUI::onUserConfirmRequired(PSTR("M0/1 Break Called"));
#endif #endif
if (ms > 0) { if (ms > 0) {
@ -108,10 +108,6 @@ void GcodeSuite::M0_M1() {
else else
while (wait_for_user) idle(); while (wait_for_user) idle();
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired(nullptr);
#endif
#if HAS_LEDS_OFF_FLAG #if HAS_LEDS_OFF_FLAG
printerEventLEDs.onResumeAfterWait(); printerEventLEDs.onResumeAfterWait();
#endif #endif

View file

@ -33,9 +33,6 @@
*/ */
void GcodeSuite::M75() { void GcodeSuite::M75() {
print_job_timer.start(); print_job_timer.start();
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onPrintTimerStarted();
#endif
} }
/** /**

View file

@ -320,7 +320,7 @@ namespace ExtUI {
#endif #endif
constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE; constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
setFeedrate_mm_s(max_manual_feedrate[axis]); setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[axis]));
if (!flags.manual_motion) set_destination_from_current(); if (!flags.manual_motion) set_destination_from_current();
destination[axis] = clamp(position, min, max); destination[axis] = clamp(position, min, max);
@ -331,7 +331,7 @@ namespace ExtUI {
setActiveTool(extruder, true); setActiveTool(extruder, true);
constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE; constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
setFeedrate_mm_s(max_manual_feedrate[E_AXIS]); setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[E_AXIS]));
if (!flags.manual_motion) set_destination_from_current(); if (!flags.manual_motion) set_destination_from_current();
destination[E_AXIS] = position; destination[E_AXIS] = position;
flags.manual_motion = true; flags.manual_motion = true;
@ -714,17 +714,26 @@ namespace ExtUI {
} }
#endif #endif
#if HAS_BED_PROBE float getZOffset_mm() {
float getZOffset_mm() { #if HAS_BED_PROBE
return zprobe_zoffset; return zprobe_zoffset;
} #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
#else
return 0.0;
#endif
}
void setZOffset_mm(const float value) { void setZOffset_mm(const float value) {
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { #if HAS_BED_PROBE
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
zprobe_zoffset = value; zprobe_zoffset = value;
} #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
} babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]));
#endif // HAS_BED_PROBE #else
UNUSED(value);
#endif
}
#if HAS_HOTEND_OFFSET #if HAS_HOTEND_OFFSET

View file

@ -198,10 +198,8 @@ namespace ExtUI {
void normalizeNozzleOffset(const axis_t axis); void normalizeNozzleOffset(const axis_t axis);
#endif #endif
#if HAS_BED_PROBE float getZOffset_mm();
float getZOffset_mm(); void setZOffset_mm(const float);
void setZOffset_mm(const float);
#endif
#if ENABLED(BACKLASH_GCODE) #if ENABLED(BACKLASH_GCODE)
float getAxisBacklash_mm(const axis_t); float getAxisBacklash_mm(const axis_t);

View file

@ -60,7 +60,7 @@ void _man_probe_pt(const float &rx, const float &ry) {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue")); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Delta Calibration in progress")); ExtUI::onUserConfirmRequired(PSTR("Delta Calibration in progress"));
#endif #endif
while (wait_for_user) idle(); while (wait_for_user) idle();
ui.goto_previous_screen_no_defer(); ui.goto_previous_screen_no_defer();

View file

@ -60,6 +60,10 @@ bool Stopwatch::start() {
Stopwatch::debug(PSTR("start")); Stopwatch::debug(PSTR("start"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onPrintTimerStarted();
#endif
if (!isRunning()) { if (!isRunning()) {
if (isPaused()) accumulator = duration(); if (isPaused()) accumulator = duration();
else reset(); else reset();

View file

@ -378,7 +378,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), PSTR("Continue")); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), PSTR("Continue"));
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Stow Probe")); ExtUI::onUserConfirmRequired(PSTR("Stow Probe"));
#endif #endif
while (wait_for_user) idle(); while (wait_for_user) idle();
ui.reset_status(); ui.reset_status();