Skip to content

Commit 91b5015

Browse files
committed
πŸ§‘β€πŸ’» ExtUI::onSetPowerLoss
1 parent 2ecd4cc commit 91b5015

File tree

11 files changed

+49
-20
lines changed

11 files changed

+49
-20
lines changed

β€ŽMarlin/src/feature/powerloss.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ void PrintJobRecovery::changed() {
113113
purge();
114114
else if (IS_SD_PRINTING())
115115
save(true);
116+
TERN_(EXTENSIBLE_UI, ExtUI::onSetPowerLoss(onoff));
116117
}
117118

118119
/**

β€ŽMarlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ namespace ExtUI {
9494
// Called after loading or resetting stored settings
9595
}
9696

97-
void onSettingsStored(bool success) {
97+
void onSettingsStored(const bool success) {
9898
// Called after the entire EEPROM has been written,
9999
// whether successful or not.
100100
}
101101

102-
void onSettingsLoaded(bool success) {
102+
void onSettingsLoaded(const bool success) {
103103
// Called after the entire EEPROM has been read,
104104
// whether successful or not.
105105
}
@@ -120,6 +120,9 @@ namespace ExtUI {
120120
#endif
121121

122122
#if ENABLED(POWER_LOSS_RECOVERY)
123+
void onSetPowerLoss(const bool onoff) {
124+
// Called when power-loss is enabled/disabled
125+
}
123126
void onPowerLoss() {
124127
// Called when power-loss state is detected
125128
}

β€ŽMarlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ namespace ExtUI {
8181
// Called after loading or resetting stored settings
8282
}
8383

84-
void onSettingsStored(bool success) {
84+
void onSettingsStored(const bool success) {
8585
// Called after the entire EEPROM has been written,
8686
// whether successful or not.
8787
}
8888

89-
void onSettingsLoaded(bool success) {
89+
void onSettingsLoaded(const bool success) {
9090
// Called after the entire EEPROM has been read,
9191
// whether successful or not.
9292
}
@@ -106,6 +106,9 @@ namespace ExtUI {
106106
#endif
107107

108108
#if ENABLED(POWER_LOSS_RECOVERY)
109+
void onSetPowerLoss(const bool onoff) {
110+
// Called when power-loss is enabled/disabled
111+
}
109112
void onPowerLoss() {
110113
// Called when power-loss state is detected
111114
}

β€ŽMarlin/src/lcd/extui/dgus/dgus_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ namespace ExtUI {
102102
// Called after loading or resetting stored settings
103103
}
104104

105-
void onSettingsStored(bool success) {
105+
void onSettingsStored(const bool success) {
106106
// Called after the entire EEPROM has been written,
107107
// whether successful or not.
108108
}
109109

110-
void onSettingsLoaded(bool success) {
110+
void onSettingsLoaded(const bool success) {
111111
// Called after the entire EEPROM has been read,
112112
// whether successful or not.
113113
}
@@ -126,6 +126,9 @@ namespace ExtUI {
126126
#endif
127127

128128
#if ENABLED(POWER_LOSS_RECOVERY)
129+
void onSetPowerLoss(const bool onoff) {
130+
// Called when power-loss is enabled/disabled
131+
}
129132
void onPowerLoss() {
130133
// Called when power-loss state is detected
131134
}

β€ŽMarlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ namespace ExtUI {
100100

101101
void onPostprocessSettings() {}
102102

103-
void onSettingsStored(bool success) {
103+
void onSettingsStored(const bool success) {
104104
dgus_screen_handler.ConfigurationStoreWritten(success);
105105
}
106106

107-
void onSettingsLoaded(bool success) {
107+
void onSettingsLoaded(const bool success) {
108108
dgus_screen_handler.ConfigurationStoreRead(success);
109109
}
110110

@@ -123,6 +123,9 @@ namespace ExtUI {
123123
#endif
124124

125125
#if ENABLED(POWER_LOSS_RECOVERY)
126+
void onSetPowerLoss(const bool onoff) {
127+
// Called when power-loss is enabled/disabled
128+
}
126129
void onPowerLoss() {
127130
// Called when power-loss state is detected
128131
}

β€ŽMarlin/src/lcd/extui/example/example.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ namespace ExtUI {
8888
// Called after loading or resetting stored settings
8989
}
9090

91-
void onSettingsStored(bool success) {
91+
void onSettingsStored(const bool success) {
9292
// Called after the entire EEPROM has been written,
9393
// whether successful or not.
9494
}
9595

96-
void onSettingsLoaded(bool success) {
96+
void onSettingsLoaded(const bool success) {
9797
// Called after the entire EEPROM has been read,
9898
// whether successful or not.
9999
}
@@ -112,6 +112,9 @@ namespace ExtUI {
112112
#endif
113113

114114
#if ENABLED(POWER_LOSS_RECOVERY)
115+
void onSetPowerLoss(const bool onoff) {
116+
// Called when power-loss is enabled/disabled
117+
}
115118
void onPowerLoss() {
116119
// Called when power-loss state is detected
117120
}

β€ŽMarlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace ExtUI {
9797
void onLoadSettings(const char *buff) { InterfaceSettingsScreen::loadSettings(buff); }
9898
void onPostprocessSettings() {} // Called after loading or resetting stored settings
9999

100-
void onSettingsStored(bool success) {
100+
void onSettingsStored(const bool success) {
101101
#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
102102
if (success && InterfaceSettingsScreen::backupEEPROM()) {
103103
SERIAL_ECHOLNPGM("EEPROM backed up to SPI Flash");
@@ -106,7 +106,7 @@ namespace ExtUI {
106106
UNUSED(success);
107107
#endif
108108
}
109-
void onSettingsLoaded(bool) {}
109+
void onSettingsLoaded(const bool) {}
110110

111111
void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); }
112112

@@ -125,6 +125,9 @@ namespace ExtUI {
125125
#endif
126126

127127
#if ENABLED(POWER_LOSS_RECOVERY)
128+
void onSetPowerLoss(const bool onoff) {
129+
// Called when power-loss is enabled/disabled
130+
}
128131
void onPowerLoss() {
129132
// Called when power-loss state is detected
130133
}

β€ŽMarlin/src/lcd/extui/ia_creality/creality_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1995,12 +1995,12 @@ namespace ExtUI {
19951995
SetTouchScreenConfiguration();
19961996
}
19971997

1998-
void onSettingsStored(bool success) {
1998+
void onSettingsStored(const bool success) {
19991999
// This is called after the entire EEPROM has been written,
20002000
// whether successful or not.
20012001
}
20022002

2003-
void onSettingsLoaded(bool success) {
2003+
void onSettingsLoaded(const bool success) {
20042004
#if HAS_MESH
20052005
if (ExtUI::getMeshValid()) {
20062006
uint8_t abl_probe_index = 0;
@@ -2026,6 +2026,9 @@ namespace ExtUI {
20262026
}
20272027

20282028
#if ENABLED(POWER_LOSS_RECOVERY)
2029+
void onSetPowerLoss(const bool onoff) {
2030+
// Called when power-loss is enabled/disabled
2031+
}
20292032
void onPowerLoss() {
20302033
// Called when power-loss state is detected
20312034
}

β€ŽMarlin/src/lcd/extui/malyan/malyan_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ namespace ExtUI {
147147
void onStoreSettings(char*) {}
148148
void onLoadSettings(const char*) {}
149149
void onPostprocessSettings() {}
150-
void onSettingsStored(bool) {}
151-
void onSettingsLoaded(bool) {}
150+
void onSettingsStored(const bool) {}
151+
void onSettingsLoaded(const bool) {}
152152

153153
#if HAS_MESH
154154
void onLevelingStart() {}
@@ -158,6 +158,9 @@ namespace ExtUI {
158158
#endif
159159

160160
#if ENABLED(POWER_LOSS_RECOVERY)
161+
void onSetPowerLoss(const bool onoff) {
162+
// Called when power-loss is enabled/disabled
163+
}
161164
void onPowerLoss() {
162165
// Called when power-loss state is detected
163166
}

β€ŽMarlin/src/lcd/extui/nextion/nextion_extui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ namespace ExtUI {
7979
// Called after loading or resetting stored settings
8080
}
8181

82-
void onSettingsStored(bool success) {
82+
void onSettingsStored(const bool success) {
8383
// Called after the entire EEPROM has been written,
8484
// whether successful or not.
8585
}
8686

87-
void onSettingsLoaded(bool success) {
87+
void onSettingsLoaded(const bool success) {
8888
// Called after the entire EEPROM has been read,
8989
// whether successful or not.
9090
}
@@ -103,6 +103,9 @@ namespace ExtUI {
103103
#endif
104104

105105
#if ENABLED(POWER_LOSS_RECOVERY)
106+
void onSetPowerLoss(const bool onoff) {
107+
// Called when power-loss is enabled/disabled
108+
}
106109
void onPowerLoss() {
107110
// Called when power-loss state is detected
108111
}

β€ŽMarlin/src/lcd/extui/ui_api.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,10 @@ namespace ExtUI {
423423
void onStoreSettings(char *);
424424
void onLoadSettings(const char *);
425425
void onPostprocessSettings();
426-
void onSettingsStored(bool success);
427-
void onSettingsLoaded(bool success);
426+
void onSettingsStored(const bool success);
427+
void onSettingsLoaded(const bool success);
428428
#if ENABLED(POWER_LOSS_RECOVERY)
429+
void onSetPowerLoss(const bool onoff);
429430
void onPowerLoss();
430431
void onPowerLossResume();
431432
#endif

0 commit comments

Comments
Β (0)