Skip to content

Commit

Permalink
option to disable tuning graph
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 17, 2023
1 parent a91fb9c commit 0d7c5e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2510,8 +2510,8 @@
#if EITHER(PIDTEMP, PIDTEMPBED)
#define DWIN_PID_TUNE 1
#endif
#if EITHER(DWIN_PID_TUNE, MPCTEMP)
#define HAS_PIDPLOT 1
#if EITHER(DWIN_PID_TUNE, MPCTEMP) && DISABLED(DISABLE_TUNING_GRAPH)
#define SHOW_TUNING_GRAPH 1

This comment has been minimized.

Copy link
@mriscoc

mriscoc Jan 17, 2023

Contributor

But the Plot could be used not only for tuning. Maybe something shorter like SHOW_PLOT

#endif
#endif

Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
#include "endstop_diag.h"
#endif

#if HAS_PIDPLOT
#if SHOW_TUNING_GRAPH
#include "plot.h"
#endif

Expand Down Expand Up @@ -1247,7 +1247,7 @@ void EachMomentUpdate() {
#if HAS_ESDIAG
if (checkkey == ESDiagProcess) ESDiag.Update();
#endif
#if HAS_PIDPLOT
#if SHOW_TUNING_GRAPH
if (checkkey == PidProcess) plot.Update((HMI_value.pidresult == PIDTEMP_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed());
#endif
}
Expand Down Expand Up @@ -1472,7 +1472,7 @@ void DWIN_LevelingDone() {

// PID/MPC process

#if HAS_PIDPLOT && EITHER(DWIN_PID_TUNE, MPCTEMP)
#if SHOW_TUNING_GRAPH && EITHER(DWIN_PID_TUNE, MPCTEMP)

#include "plot.h"

Expand Down Expand Up @@ -1527,7 +1527,7 @@ void DWIN_LevelingDone() {
DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, _target);
}

#endif // HAS_PIDPLOT && (DWIN_PID_TUNE || MPCTEMP)
#endif // SHOW_TUNING_GRAPH && (DWIN_PID_TUNE || MPCTEMP)

#if DWIN_PID_TUNE

Expand All @@ -1548,7 +1548,7 @@ void DWIN_LevelingDone() {
#if ENABLED(PIDTEMP)
case PIDTEMP_START:
HMI_SaveProcessID(PidProcess);
#if HAS_PIDPLOT
#if SHOW_TUNING_GRAPH
DWIN_Draw_PID_MPC_Popup();
#else
DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running."));
Expand All @@ -1562,7 +1562,7 @@ void DWIN_LevelingDone() {
#if ENABLED(PIDTEMPBED)
case PIDTEMPBED_START:
HMI_SaveProcessID(PidProcess);
#if HAS_PIDPLOT
#if SHOW_TUNING_GRAPH
DWIN_Draw_PID_MPC_Popup();
#else
DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running."));
Expand Down Expand Up @@ -1596,7 +1596,7 @@ void DWIN_LevelingDone() {
switch (result) {
case MPCTEMP_START:
HMI_SaveProcessID(MPCProcess);
#if HAS_PIDPLOT
#if SHOW_TUNING_GRAPH
DWIN_Draw_PID_MPC_Popup();
#else
DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_MPC_AUTOTUNE), F("for Nozzle is running."));
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/e3v2/proui/plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "../../../inc/MarlinConfig.h"

#if BOTH(DWIN_LCD_PROUI, HAS_PIDPLOT)
#if BOTH(DWIN_LCD_PROUI, SHOW_TUNING_GRAPH)

#include "plot.h"
#include "../../../core/types.h"
Expand Down Expand Up @@ -61,7 +61,7 @@ void PlotClass::Draw(const frame_rect_t &frame, const celsius_t max, const_float

void PlotClass::Update(const_float_t value) {
if (!scale) return;
uint16_t y = round((y2) - value * scale);
const uint16_t y = round((y2) - value * scale);
if (grphpoints < grphframe.w) {
DWIN_Draw_Point(Color_Yellow, 1, 1, grphpoints + grphframe.x, y);
}
Expand All @@ -74,4 +74,4 @@ void PlotClass::Update(const_float_t value) {
grphpoints++;
}

#endif // DWIN_LCD_PROUI && HAS_PIDPLOT
#endif // DWIN_LCD_PROUI && SHOW_TUNING_GRAPH

0 comments on commit 0d7c5e0

Please sign in to comment.