Skip to content

Commit

Permalink
Apply case (ProUI)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 30, 2023
1 parent 11aa960 commit 2f21c0e
Show file tree
Hide file tree
Showing 43 changed files with 2,456 additions and 2,457 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ void unified_bed_leveling::shift_mesh_height() {

TERN_(HAS_MARLINUI_MENU, ui.capture());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());

save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
grid_count_t count = GRID_MAX_POINTS;
Expand Down Expand Up @@ -820,7 +820,7 @@ void unified_bed_leveling::shift_mesh_height() {
);

TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingDone());
TERN_(DWIN_LCD_PROUI, dwinLevelingDone());
}

#endif // HAS_BED_PROBE
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/runout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void event_filament_runout(const uint8_t extruder) {
#endif

TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder)));
TERN_(DWIN_LCD_PROUI, DWIN_FilamentRunout(extruder));
TERN_(DWIN_LCD_PROUI, dwinFilamentRunout(extruder));

#if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR)
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ G29_TYPE GcodeSuite::G29() {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling");
points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
#endif

TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
Expand All @@ -440,7 +440,7 @@ G29_TYPE GcodeSuite::G29() {
#if ENABLED(PREHEAT_BEFORE_LEVELING)
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
#if ALL(DWIN_LCD_PROUI, HAS_HEATED_BED)
HMI_data.BedLevT
hmiData.bedLevT
#else
LEVELING_BED_TEMP
#endif
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void GcodeSuite::G29() {
queue.inject(F("G29S2"));

TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());

return;
}
Expand All @@ -169,7 +169,7 @@ void GcodeSuite::G29() {
// Save Z for the previous mesh position
bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z);
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z));
TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z));
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z));
SET_SOFT_ENDSTOP_LOOSE(false);
}
// If there's another point to sample, move there with optional lift.
Expand Down Expand Up @@ -236,7 +236,7 @@ void GcodeSuite::G29() {
if (parser.seenval('Z')) {
bedlevel.z_values[ix][iy] = parser.value_linear_units();
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
}
else
return echo_not_entered('Z');
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/ubl/M421.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ void GcodeSuite::M421() {
else if (!WITHIN(ij.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ij.y, 0, GRID_MAX_POINTS_Y - 1))
SERIAL_ERROR_MSG(STR_ERR_MESH_XY);
else {
float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point
float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point
zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh
TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(ij.x, ij.y, zval));
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ij.x, ij.y, zval));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/config/M302.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void GcodeSuite::M302() {
if (seen_S) {
thermalManager.extrude_min_temp = parser.value_celsius();
thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0);
TERN_(DWIN_LCD_PROUI, HMI_data.ExtMinT = thermalManager.extrude_min_temp);
TERN_(DWIN_LCD_PROUI, hmiData.extMinT = thermalManager.extrude_min_temp);
}

if (parser.seen('P'))
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/control/M997.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
void GcodeSuite::M997() {

TERN_(DWIN_LCD_PROUI, DWIN_RebootScreen());
TERN_(DWIN_LCD_PROUI, dwinRebootScreen());

flashFirmware(parser.intval('S'));

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/lcd/M0_M1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ void GcodeSuite::M0_M1() {
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT));
#elif ENABLED(DWIN_LCD_PROUI)
if (parser.string_arg)
DWIN_Popup_Confirm(ICON_BLTouch, parser.string_arg, GET_TEXT_F(MSG_USERWAIT));
dwinPopupConfirm(ICON_BLTouch, parser.string_arg, GET_TEXT_F(MSG_USERWAIT));
else
DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT));
dwinPopupConfirm(ICON_BLTouch, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT));
#else

if (parser.string_arg) {
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/gcode/sd/M1001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif

#if ENABLED(HOST_ACTION_COMMANDS)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/stats/M75-M78.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
void GcodeSuite::M75() {
startOrResumeJob();
#if ENABLED(DWIN_LCD_PROUI)
if (!IS_SD_PRINTING()) DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT));
if (!IS_SD_PRINTING()) dwinPrintHeader(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT));
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/gcode/temp/M303.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#elif ENABLED(PROUI_PID_TUNE)
#include "../../lcd/e3v2/proui/dwin.h"
#endif

Expand Down Expand Up @@ -69,7 +69,7 @@ void GcodeSuite::M303() {
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID);
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_HEATER_ID));
TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_BAD_HEATER_ID));
TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_BAD_HEATER_ID));
return;
}

Expand All @@ -79,7 +79,7 @@ void GcodeSuite::M303() {
const celsius_t temp = seenS ? parser.value_celsius() : default_temp;
const bool u = parser.boolval('U');

TERN_(DWIN_PID_TUNE, DWIN_StartM303(seenC, c, seenS, hid, temp));
TERN_(PROUI_PID_TUNE, dwinStartM303(seenC, c, seenS, hid, temp));

IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY));

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2386,10 +2386,10 @@

#if ENABLED(DWIN_LCD_PROUI)
#if ANY(PIDTEMP, PIDTEMPBED)
#define DWIN_PID_TUNE 1
#define PROUI_PID_TUNE 1
#endif
#if ANY(DWIN_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH)
#define SHOW_TUNING_GRAPH 1
#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH)
#define PROUI_TUNING_GRAPH 1
#endif
#endif

Expand Down
20 changes: 10 additions & 10 deletions Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ class TextScroller {
#if ENABLED(AUTO_BED_LEVELING_UBL)
uint8_t tilt_grid = 1;

void manual_value_update(bool undefined=false) {
void manualValueUpdate(bool undefined=false) {
gcode.process_subcommands_now(
TS(F("M421I"), mesh_x, 'J', mesh_y, 'Z', p_float_t(current_position.z, 3), undefined ? "N" : "")
);
planner.synchronize();
}

bool create_plane_from_mesh() {
bool createPlaneFromMesh() {
struct linear_fit_data lsf_results;
incremental_LSF_reset(&lsf_results);
GRID_LOOP(x, y) {
Expand Down Expand Up @@ -312,7 +312,7 @@ class TextScroller {

#else

void manual_value_update() {
void manualValueUpdate() {
gcode.process_subcommands_now(
TS(F("G29I"), mesh_x, 'J', mesh_y, 'Z', p_float_t(current_position.z, 3))
);
Expand Down Expand Up @@ -340,7 +340,7 @@ class TextScroller {
}
}

float get_max_value() {
float getMaxValue() {
float max = __FLT_MIN__;
GRID_LOOP(x, y) {
if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max)
Expand All @@ -349,7 +349,7 @@ class TextScroller {
return max;
}

float get_min_value() {
float getMinValue() {
float min = __FLT_MAX__;
GRID_LOOP(x, y) {
if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] < min)
Expand All @@ -363,7 +363,7 @@ class TextScroller {
const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x,
cell_width_px = total_width_px / (GRID_MAX_POINTS_X),
cell_height_px = total_width_px / (GRID_MAX_POINTS_Y);
const float v_max = abs(get_max_value()), v_min = abs(get_min_value()), range = _MAX(v_min, v_max);
const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max);

// Clear background from previous selection and select new square
dwinDrawRectangle(1, COLOR_BG_BLACK, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px);
Expand Down Expand Up @@ -418,8 +418,8 @@ class TextScroller {

void setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead
float v1, v2,
v_min = abs(get_min_value()),
v_max = abs(get_max_value());
v_min = abs(getMinValue()),
v_max = abs(getMaxValue());
if (viewer_asymmetric_range) {
if (v_min > 3e+10F) v_min = 0.0000001;
if (v_max > 3e+10F) v_max = 0.0000001;
Expand Down Expand Up @@ -3437,7 +3437,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
if (draw)
drawMenuItem(row, ICON_ResumeEEPROM, F("Convert Mesh to Plane"));
else {
if (mesh_conf.create_plane_from_mesh()) break;
if (mesh_conf.createPlaneFromMesh()) break;
gcode.process_subcommands_now(F("M420 S1"));
planner.synchronize();
audioFeedback(true);
Expand Down Expand Up @@ -3582,7 +3582,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
if (draw)
drawMenuItem(row, ICON_ResumeEEPROM, F("Clear Point Value"));
else {
mesh_conf.manual_value_update(true);
mesh_conf.manualValueUpdate(true);
redrawMenu(false);
}
break;
Expand Down
Loading

0 comments on commit 2f21c0e

Please sign in to comment.