Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 11, 2022
1 parent 7630229 commit d4a235f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
39 changes: 22 additions & 17 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,11 +1563,10 @@ void DWIN_CompletedLeveling() {
}

#if HAS_MESH
void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
char msg[33] = "";
char str_1[6] = "";
sprintf_P(msg, PSTR(S_FMT " %i/%i Z=%s"), GET_TEXT(MSG_PROBING_POINT), xpos, ypos,
dtostrf(zval, 1, 2, str_1));
sprintf_P(msg, PSTR(S_FMT " %i/%i Z=%s"), GET_TEXT(MSG_PROBING_POINT), xpos, ypos, dtostrf(zval, 1, 2, str_1));
ui.set_status(msg);
}
#endif
Expand Down Expand Up @@ -2287,8 +2286,10 @@ TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) {
break;
}

planner.synchronize();

#if HAS_ONESTEP_LEVELING
planner.synchronize();

if (HMI_data.FullManualTramming) {
planner.synchronize();
sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%sY%sF5000\nG0Z0F300"),
Expand All @@ -2300,28 +2301,30 @@ TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) {
else {
LIMIT(xpos, X_MIN_POS, (X_MAX_POS + probe.offset.x));
LIMIT(ypos, Y_MIN_POS, (Y_MAX_POS + probe.offset.y));
probe.stow();
gcode.process_subcommands_now(F("M420S0\nG28O"));
planner.synchronize();
inLev = true;
zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW);
probe.stow();
gcode.process_subcommands_now(F("M420S0\nG28O"));
planner.synchronize();
inLev = true;
zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW);
if (isnan(zval))
ui.set_status(F("Position Not Reachable, check offsets"));
else {
sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"),
dtostrf(xpos, 1, 1, str_1),
dtostrf(ypos, 1, 1, str_2),
dtostrf(zval, 1, 2, str_3)
);
ui.set_status(cmd);
dtostrf(xpos, 1, 1, str_1),
dtostrf(ypos, 1, 1, str_2),
dtostrf(zval, 1, 2, str_3)
);
ui.set_status(cmd);
}
inLev = false;
inLev = false;
}
return zval;

#else
planner.synchronize();

sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos);
queue.inject(cmd);

#endif
}

Expand All @@ -2332,6 +2335,7 @@ void TramBL() { Tram(3); }
void TramC () { Tram(4); }

#if HAS_ONESTEP_LEVELING

void Trammingwizard() {
bed_mesh_t zval = {0};
if (HMI_data.FullManualTramming) {
Expand Down Expand Up @@ -2388,7 +2392,8 @@ void TramC () { Tram(4); }
Draw_Chkb_Line(CurrentMenu->line(), HMI_data.FullManualTramming);
DWIN_UpdateLCD();
}
#endif

#endif // HAS_ONESTEP_LEVELING

#if ENABLED(MESH_BED_LEVELING)

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/e3v2/proui/dwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ void DWIN_CheckStatusMessage();
void DWIN_StartHoming();
void DWIN_CompletedHoming();
#if HAS_MESH
void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const float zval);
void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval);
#endif
void DWIN_MeshLevelingStart();
void DWIN_CompletedLeveling();
void DWIN_PidTuning(pidresult_t result);
void DWIN_Print_Started(const bool sd = false);
void DWIN_Print_Started(const bool sd=false);
void DWIN_Print_Pause();
void DWIN_Print_Resume();
void DWIN_Print_Finished();
Expand All @@ -182,7 +182,7 @@ void DWIN_SetDataDefaults();
void DWIN_RebootScreen();

#if ENABLED(ADVANCED_PAUSE_FEATURE)
void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button = 0);
void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button=0);
void Draw_Popup_FilamentPurge();
void Goto_FilamentPurge();
void HMI_FilamentPurge();
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/e3v2/proui/dwin_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
#endif

typedef struct {
// Color settings
// Color settings
uint16_t Background_Color = Def_Background_Color;
uint16_t Cursor_color = Def_Cursor_color;
uint16_t TitleBg_color = Def_TitleBg_color;
Expand All @@ -116,7 +116,7 @@ typedef struct {
#if HAS_HOTEND && defined(PREHEAT_1_TEMP_HOTEND)
int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND;
#endif
#if defined(PREHEAT_1_TEMP_BED)
#if HAS_HEATED_BED && defined(PREHEAT_1_TEMP_BED)
int16_t BedPidT = PREHEAT_1_TEMP_BED;
#endif
#if HAS_HOTEND || HAS_HEATED_BED
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/e3v2/proui/dwinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ void DWINUI::Draw_Button(uint8_t id, uint16_t x, uint16_t y) {
default: break;
}
}

// -------------------------- Extra -------------------------------//

// Draw a circle
Expand Down

0 comments on commit d4a235f

Please sign in to comment.