Skip to content

Commit

Permalink
Merge commit '49ca16c3fb103e8e29f64107ba664aa82917b9f1' into pr/19339
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 13, 2020
2 parents 7a2b831 + 49ca16c commit 013dff1
Show file tree
Hide file tree
Showing 32 changed files with 487 additions and 287 deletions.
3 changes: 3 additions & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@
uint8_t count = GRID_MAX_POINTS;

mesh_index_pair best;
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::MESH_START));
do {
if (do_ubl_mesh_map) display_map(g29_map_type);

Expand Down Expand Up @@ -775,6 +776,8 @@

} while (best.pos.x >= 0 && --count);

TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::MESH_FINISH));

// Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW
TERN_(HAS_LCD_MENU, ui.release());
probe.stow();
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/feature/tmc_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class TMCMarlin : public TMC, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
#if HAS_STEALTHCHOP
inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); }
inline bool get_stealthChop_status() { return this->en_pwm_mode(); }
inline bool get_stored_stealthChop_status() { return this->stored.stealthChop_enabled; }
#endif

#if ENABLED(HYBRID_THRESHOLD)
Expand Down Expand Up @@ -171,6 +172,7 @@ class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
#if HAS_STEALTHCHOP
inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
inline bool get_stealthChop_status() { return !this->en_spreadCycle(); }
inline bool get_stored_stealthChop_status() { return this->stored.stealthChop_enabled; }
#endif

#if ENABLED(HYBRID_THRESHOLD)
Expand Down Expand Up @@ -216,6 +218,7 @@ class TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
#if HAS_STEALTHCHOP
inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
inline bool get_stealthChop_status() { return !this->en_spreadCycle(); }
inline bool get_stored_stealthChop_status() { return this->stored.stealthChop_enabled; }
#endif

#if ENABLED(HYBRID_THRESHOLD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
#include "../../module/probe.h"
#include "../../feature/probe_temp_comp.h"

#include "../../lcd/ultralcd.h"
#include "../../MarlinCore.h" // for wait_for_heatup and idle()

#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
#include "../../module/printcounter.h"
#endif

#if ENABLED(PRINTER_EVENTS_LEDS)
#include "../../feature/leds/leds.h"
#endif

/**
* G76: calibrate probe and/or bed temperature offsets
* Notes:
Expand Down Expand Up @@ -303,17 +314,17 @@ void GcodeSuite::M871() {
}
else if (parser.seen("BPE")) {
if (!parser.seenval('V')) return;
const int16_t val = parser.value_int();
const int16_t offset_val = parser.value_int();
if (!parser.seenval('I')) return;
const int16_t idx = parser.value_int();
const TempSensorID mod = (parser.seen('B') ? TSI_BED :
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
parser.seen('E') ? TSI_EXT :
#endif
TSI_PROBE
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
parser.seen('E') ? TSI_EXT :
#endif
TSI_PROBE
);
if (idx > 0 && temp_comp.set_offset(mod, idx - 1, val))
SERIAL_ECHOLNPAIR("Set value: ", val);
if (idx > 0 && temp_comp.set_offset(mod, idx - 1, offset_val))
SERIAL_ECHOLNPAIR("Set value: ", offset_val);
else
SERIAL_ECHOLNPGM("!Invalid index. Failed to set value (note: value at index 0 is constant).");

Expand All @@ -322,4 +333,25 @@ void GcodeSuite::M871() {
temp_comp.print_offsets();
}

/**
* M872: Wait for probe temperature sensor to reach a target
*
* Select only one of these flags:
* R - Wait for heating or cooling
* S - Wait only for heating
*/
void GcodeSuite::M872() {
if (DEBUGGING(DRYRUN)) return;

const bool no_wait_for_cooling = parser.seenval('S');
if (!no_wait_for_cooling && ! parser.seenval('R')) {
SERIAL_ERROR_MSG("No target temperature set.");
return;
}

const float target_temp = parser.value_celsius();
ui.set_status_P(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT(MSG_PROBE_HEATING) : GET_TEXT(MSG_PROBE_COOLING));
thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
}

#endif // PROBE_TEMP_COMPENSATION
1 change: 1 addition & 0 deletions Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {

#if ENABLED(PROBE_TEMP_COMPENSATION)
case 871: M871(); break; // M871: Print/reset/clear first layer temperature offset values
case 872: M872(); break; // M872: Wait for probe temp
#endif

#if ENABLED(LIN_ADVANCE)
Expand Down
6 changes: 5 additions & 1 deletion Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
* M868 - Report or set position encoder module error correction threshold.
* M869 - Report position encoder module error.
* M871 - Print/reset/clear first layer temperature offset values. (Requires PROBE_TEMP_COMPENSATION)
* M872 - Wait for probe temp (Requires PROBE_TEMP_COMPENSATION)
* M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER)
* M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
Expand Down Expand Up @@ -820,7 +821,10 @@ class GcodeSuite {
FORCE_INLINE static void M869() { I2CPEM.M869(); }
#endif

TERN_(PROBE_TEMP_COMPENSATION, static void M871());
#if ENABLED(PROBE_TEMP_COMPENSATION)
static void M871();
static void M872();
#endif

TERN_(LIN_ADVANCE, static void M900());

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2020-09-11"
#define STRING_DISTRIBUTION_DATE "2020-09-13"
#endif

/**
Expand Down
9 changes: 9 additions & 0 deletions Marlin/src/lcd/dwin/e3v2/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ void show_plus_or_minus(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNu
void ICON_Print() {
if (select_page.now == 0) {
DWIN_ICON_Show(ICON, ICON_Print_1, 17, 130);
DWIN_Draw_Rectangle(0, White, 17, 130, 126, 229);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 1, 447, 271 - 243, 479 - 19, 58, 201);
else
Expand All @@ -244,6 +245,7 @@ void ICON_Print() {
void ICON_Prepare() {
if (select_page.now == 1) {
DWIN_ICON_Show(ICON, ICON_Prepare_1, 145, 130);
DWIN_Draw_Rectangle(0, White, 145, 130, 254, 229);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 31, 447, 271 - 213, 479 - 19, 186, 201);
else
Expand All @@ -261,6 +263,7 @@ void ICON_Prepare() {
void ICON_Control() {
if (select_page.now == 2) {
DWIN_ICON_Show(ICON, ICON_Control_1, 17, 246);
DWIN_Draw_Rectangle(0, White, 17, 246, 126, 345);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 61, 447, 271 - 183, 479 - 19, 58, 318);
else
Expand All @@ -278,6 +281,7 @@ void ICON_Control() {
void ICON_StartInfo(bool show) {
if (show) {
DWIN_ICON_Show(ICON, ICON_Info_1, 145, 246);
DWIN_Draw_Rectangle(0, White, 145, 246, 254, 345);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 91, 447, 271 - 153, 479 - 19, 186, 318);
else
Expand All @@ -295,6 +299,7 @@ void ICON_StartInfo(bool show) {
void ICON_Leveling(bool show) {
if (show) {
DWIN_ICON_Show(ICON, ICON_Leveling_1, 145, 246);
DWIN_Draw_Rectangle(0, White, 145, 246, 254, 345);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 211, 447, 238, 479 - 19, 186, 318);
else
Expand All @@ -312,6 +317,7 @@ void ICON_Leveling(bool show) {
void ICON_Tune() {
if (select_print.now == 0) {
DWIN_ICON_Show(ICON, ICON_Setup_1, 8, 252);
DWIN_Draw_Rectangle(0, White, 8, 252, 87, 351);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 121, 447, 271 - 123, 479 - 21, 34, 325);
else
Expand All @@ -329,6 +335,7 @@ void ICON_Tune() {
void ICON_Pause() {
if (select_print.now == 1) {
DWIN_ICON_Show(ICON, ICON_Pause_1, 96, 252);
DWIN_Draw_Rectangle(0, White, 96, 252, 175, 351);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 181, 447, 271 - 63, 479 - 20, 124, 325);
else
Expand All @@ -346,6 +353,7 @@ void ICON_Pause() {
void ICON_Continue() {
if (select_print.now == 1) {
DWIN_ICON_Show(ICON, ICON_Continue_1, 96, 252);
DWIN_Draw_Rectangle(0, White, 96, 252, 175, 351);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 1, 447, 271 - 243, 479 - 19, 124, 325);
else
Expand All @@ -363,6 +371,7 @@ void ICON_Continue() {
void ICON_Stop() {
if (select_print.now == 2) {
DWIN_ICON_Show(ICON, ICON_Stop_1, 184, 252);
DWIN_Draw_Rectangle(0, White, 184, 252, 263, 351);
if (HMI_flag.language_chinese)
DWIN_Frame_AreaCopy(1, 151, 447, 271 - 93, 479 - 20, 210, 325);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/

#pragma once
Expand All @@ -36,7 +36,7 @@
*
* PolyReader r(data, N_ELEMENTS(data));
*
* for(r.start();r.has_more(); r.next()) {
* for (r.start();r.has_more(); r.next()) {
* uint16_t x = r.x;
* uint16_t y = r.y;
*
Expand Down Expand Up @@ -107,8 +107,8 @@ class PolyReader {
}
}

bool has_more() {return p != NULL;}
bool end_of_loop() {return start_x == eol;}
bool has_more() { return p != NULL; }
bool end_of_loop() { return start_x == eol; }
};

/**
Expand All @@ -129,7 +129,7 @@ class TransformedPolyReader : public PolyReader {
*/
static constexpr uint8_t fract_bits = 5;
typedef int16_t fix_t;
fix_t makefix(float f) {return f * (1 << fract_bits);}
fix_t makefix(float f) { return f * (1 << fract_bits); }

// First two rows of 3x3 transformation matrix
fix_t a, b, c;
Expand Down Expand Up @@ -254,6 +254,13 @@ class GenericPolyUI {
draw_mode_t mode;

public:
enum ButtonStyle : uint8_t {
FILL = 1,
STROKE = 2,
SHADOW = 4,
REGULAR = 7
};

typedef POLY_READER poly_reader_t;

GenericPolyUI(CommandProcessor &c, draw_mode_t what = BOTH) : cmd(c), mode(what) {}
Expand All @@ -276,7 +283,7 @@ class GenericPolyUI {
Polygon p(cmd);
p.begin_fill();
p.begin_loop();
for(r.start();r.has_more();r.next()) {
for (r.start();r.has_more();r.next()) {
p(r.x * 16, r.y * 16);
if (r.end_of_loop()) {
p.end_loop();
Expand Down Expand Up @@ -306,7 +313,7 @@ class GenericPolyUI {
Polygon p(cmd);
p.begin_stroke();
p.begin_loop();
for(r.start();r.has_more(); r.next()) {
for (r.start();r.has_more(); r.next()) {
p(r.x * 16, r.y * 16);
if (r.end_of_loop()) {
p.end_loop();
Expand All @@ -323,7 +330,7 @@ class GenericPolyUI {
int16_t y_min = INT16_MAX;
int16_t x_max = INT16_MIN;
int16_t y_max = INT16_MIN;
for(r.start(); r.has_more(); r.next()) {
for (r.start(); r.has_more(); r.next()) {
x_min = min(x_min, int16_t(r.x));
x_max = max(x_max, int16_t(r.x));
y_min = min(y_min, int16_t(r.y));
Expand Down Expand Up @@ -355,11 +362,11 @@ class GenericPolyUI {
btn_shadow_depth = depth;
}

void button(const uint8_t tag, poly_reader_t r) {
void button(const uint8_t tag, poly_reader_t r, uint8_t style = REGULAR) {
using namespace FTDI;
// Draw the shadow
#if FTDI_API_LEVEL >= 810
if (mode & BACKGROUND) {
if (mode & BACKGROUND && style & SHADOW) {
cmd.cmd(SAVE_CONTEXT());
cmd.cmd(TAG(tag));
cmd.cmd(VERTEX_TRANSLATE_X(btn_shadow_depth * 16));
Expand All @@ -381,11 +388,15 @@ class GenericPolyUI {
#endif
// Draw the fill and stroke
cmd.cmd(TAG(tag));
cmd.cmd(COLOR_RGB(btn_fill_color));
fill(r, false);
cmd.cmd(COLOR_RGB(btn_stroke_color));
cmd.cmd(LINE_WIDTH(btn_stroke_width));
stroke(r);
if (style & FILL) {
cmd.cmd(COLOR_RGB(btn_fill_color));
fill(r, false);
}
if (style & STROKE) {
cmd.cmd(COLOR_RGB(btn_stroke_color));
cmd.cmd(LINE_WIDTH(btn_stroke_width));
stroke(r);
}
cmd.cmd(RESTORE_CONTEXT());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ namespace Language_en {
PROGMEM Language_Str MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate";
PROGMEM Language_Str MSG_AUTOLEVEL_X_AXIS = u8"Level X Axis";
PROGMEM Language_Str MSG_BED_MAPPING_DONE = u8"Bed mapping finished";
PROGMEM Language_Str MSG_RESET_BLTOUCH = u8"Reset BLTouch";
PROGMEM Language_Str MSG_LEVELING = u8"Leveling";
PROGMEM Language_Str MSG_SHOW_MESH = u8"Show Bed Mesh";

#ifdef TOUCH_UI_LULZBOT_BIO
PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#define ACCELERATION_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define ENDSTOPS_POS BTN_POS(1,6), BTN_SIZE(1,1)
#define JERK_POS BTN_POS(2,6), BTN_SIZE(1,1)
#define OFFSETS_POS BTN_POS(1,7), BTN_SIZE(1,1)
#define CASE_LIGHT_POS BTN_POS(1,7), BTN_SIZE(1,1)
#define BACKLASH_POS BTN_POS(2,7), BTN_SIZE(1,1)
#define CASE_LIGHT_POS BTN_POS(1,8), BTN_SIZE(1,1)
#define OFFSETS_POS BTN_POS(1,8), BTN_SIZE(1,1)
#define TMC_HOMING_THRS_POS BTN_POS(2,8), BTN_SIZE(1,1)
#if EITHER(CASE_LIGHT_ENABLE, SENSORLESS_HOMING)
#if EITHER(HAS_MULTI_HOTEND, SENSORLESS_HOMING)
#define BACK_POS BTN_POS(1,9), BTN_SIZE(2,1)
#else
#define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1)
Expand Down Expand Up @@ -98,8 +98,8 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
.tag(13).button( TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT))
.enabled(ENABLED(SENSORLESS_HOMING))
.tag(14).button( TMC_HOMING_THRS_POS, GET_TEXT_F(MSG_TMC_HOMING_THRS))
.enabled(EITHER(HAS_MULTI_HOTEND, BLTOUCH))
.tag(4) .button( OFFSETS_POS, GET_TEXT_F(TERN(HAS_MULTI_HOTEND, MSG_OFFSETS_MENU, MSG_RESET_BLTOUCH)))
.enabled(ENABLED(HAS_MULTI_HOTEND))
.tag(4) .button( OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU))
.enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR))
.tag(11).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT))
.tag(12).button( ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS))
Expand All @@ -123,13 +123,9 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
case 2: GOTO_SCREEN(ZOffsetScreen); break;
#endif
case 3: GOTO_SCREEN(StepsScreen); break;
case 4:
#if HAS_MULTI_HOTEND
GOTO_SCREEN(NozzleOffsetScreen);
#elif ENABLED(BLTOUCH)
injectCommands_P(PSTR("M280 P0 S60"));
#endif
break;
#if ENABLED(HAS_MULTI_HOTEND)
case 4: GOTO_SCREEN(NozzleOffsetScreen); break;
#endif
case 5: GOTO_SCREEN(MaxVelocityScreen); break;
case 6: GOTO_SCREEN(DefaultAccelerationScreen); break;
case 7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break;
Expand Down
Loading

0 comments on commit 013dff1

Please sign in to comment.