update code base to Marlin 2.0.9.2
This commit is contained in:
176
Marlin/src/lcd/extui/ui_api.h
Executable file → Normal file
176
Marlin/src/lcd/extui/ui_api.h
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -39,10 +39,15 @@
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* To view a copy of the GNU General Public License, go to the following *
|
||||
* location: <http://www.gnu.org/licenses/>. *
|
||||
* location: <https://www.gnu.org/licenses/>. *
|
||||
****************************************************************************/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../marlinui.h"
|
||||
#include "../../gcode/gcode.h"
|
||||
#if M600_PURGE_MORE_RESUMABLE
|
||||
#include "../../feature/pause.h"
|
||||
#endif
|
||||
|
||||
namespace ExtUI {
|
||||
|
||||
@@ -52,11 +57,11 @@ namespace ExtUI {
|
||||
|
||||
static constexpr size_t eeprom_data_size = 48;
|
||||
|
||||
enum axis_t : uint8_t { X, Y, Z };
|
||||
enum axis_t : uint8_t { X, Y, Z, I, J, K, X2, Y2, Z2, Z3, Z4 };
|
||||
enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 };
|
||||
enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER };
|
||||
enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER };
|
||||
enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 };
|
||||
enum result_t : uint8_t { PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE };
|
||||
enum result_t : uint8_t { PID_STARTED, PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE };
|
||||
|
||||
constexpr uint8_t extruderCount = EXTRUDERS;
|
||||
constexpr uint8_t hotendCount = HOTENDS;
|
||||
@@ -74,8 +79,12 @@ namespace ExtUI {
|
||||
bool canMove(const axis_t);
|
||||
bool canMove(const extruder_t);
|
||||
void injectCommands_P(PGM_P const);
|
||||
void injectCommands(char * const);
|
||||
bool commandsInQueue();
|
||||
|
||||
GcodeSuite::MarlinBusyState getHostKeepaliveState();
|
||||
bool getHostKeepaliveIsPaused();
|
||||
|
||||
bool isHeaterIdle(const heater_t);
|
||||
bool isHeaterIdle(const extruder_t);
|
||||
void enableHeater(const heater_t);
|
||||
@@ -100,17 +109,17 @@ namespace ExtUI {
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
float getAxisCurrent_mA(const axis_t);
|
||||
float getAxisCurrent_mA(const extruder_t);
|
||||
void setAxisCurrent_mA(const float, const axis_t);
|
||||
void setAxisCurrent_mA(const float, const extruder_t);
|
||||
void setAxisCurrent_mA(const_float_t, const axis_t);
|
||||
void setAxisCurrent_mA(const_float_t, const extruder_t);
|
||||
|
||||
int getTMCBumpSensitivity(const axis_t);
|
||||
void setTMCBumpSensitivity(const float, const axis_t);
|
||||
void setTMCBumpSensitivity(const_float_t, const axis_t);
|
||||
#endif
|
||||
|
||||
float getActualTemp_celsius(const heater_t);
|
||||
float getActualTemp_celsius(const extruder_t);
|
||||
float getTargetTemp_celsius(const heater_t);
|
||||
float getTargetTemp_celsius(const extruder_t);
|
||||
celsius_float_t getActualTemp_celsius(const heater_t);
|
||||
celsius_float_t getActualTemp_celsius(const extruder_t);
|
||||
celsius_float_t getTargetTemp_celsius(const heater_t);
|
||||
celsius_float_t getTargetTemp_celsius(const extruder_t);
|
||||
float getTargetFan_percent(const fan_t);
|
||||
float getActualFan_percent(const fan_t);
|
||||
float getAxisPosition_mm(const axis_t);
|
||||
@@ -123,14 +132,36 @@ namespace ExtUI {
|
||||
float getAxisMaxAcceleration_mm_s2(const extruder_t);
|
||||
feedRate_t getMinFeedrate_mm_s();
|
||||
feedRate_t getMinTravelFeedrate_mm_s();
|
||||
feedRate_t getFeedrate_mm_s();
|
||||
float getPrintingAcceleration_mm_s2();
|
||||
float getRetractAcceleration_mm_s2();
|
||||
float getTravelAcceleration_mm_s2();
|
||||
float getFeedrate_percent();
|
||||
int16_t getFlowPercentage(const extruder_t);
|
||||
uint8_t getProgress_percent();
|
||||
int16_t getFlow_percent(const extruder_t);
|
||||
|
||||
inline uint8_t getProgress_percent() { return ui.get_progress_percent(); }
|
||||
|
||||
#if HAS_PRINT_PROGRESS_PERMYRIAD
|
||||
inline uint16_t getProgress_permyriad() { return ui.get_progress_permyriad(); }
|
||||
#endif
|
||||
|
||||
uint32_t getProgress_seconds_elapsed();
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
uint16_t getMaterial_preset_E(const uint16_t);
|
||||
#if HAS_HEATED_BED
|
||||
uint16_t getMaterial_preset_B(const uint16_t);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
uint8_t getIDEX_Mode();
|
||||
#endif
|
||||
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
inline uint32_t getProgress_seconds_remaining() { return ui.get_remaining_time(); }
|
||||
#endif
|
||||
|
||||
#if HAS_LEVELING
|
||||
bool getLevelingActive();
|
||||
void setLevelingActive(const bool);
|
||||
@@ -138,9 +169,24 @@ namespace ExtUI {
|
||||
#if HAS_MESH
|
||||
bed_mesh_t& getMeshArray();
|
||||
float getMeshPoint(const xy_uint8_t &pos);
|
||||
void setMeshPoint(const xy_uint8_t &pos, const float zval);
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval);
|
||||
inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); }
|
||||
void setMeshPoint(const xy_uint8_t &pos, const_float_t zval);
|
||||
void moveToMeshPoint(const xy_uint8_t &pos, const_float_t z);
|
||||
void onMeshLevelingStart();
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval);
|
||||
inline void onMeshUpdate(const xy_int8_t &pos, const_float_t zval) { onMeshUpdate(pos.x, pos.y, zval); }
|
||||
|
||||
typedef enum : uint8_t {
|
||||
G29_START, // Prior to start of probe
|
||||
G29_FINISH, // Following probe of all points
|
||||
G29_POINT_START, // Beginning probe of grid location
|
||||
G29_POINT_FINISH, // Finished probe of grid location
|
||||
G26_START,
|
||||
G26_FINISH,
|
||||
G26_POINT_START,
|
||||
G26_POINT_FINISH
|
||||
} probe_state_t;
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, probe_state_t state);
|
||||
inline void onMeshUpdate(const xy_int8_t &pos, probe_state_t state) { onMeshUpdate(pos.x, pos.y, state); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -148,7 +194,14 @@ namespace ExtUI {
|
||||
void setHostResponse(const uint8_t);
|
||||
#endif
|
||||
|
||||
inline void simulateUserClick() {
|
||||
#if ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI)
|
||||
ui.lcd_clicked = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(PRINTCOUNTER)
|
||||
char* getFailedPrints_str(char buffer[21]);
|
||||
char* getTotalPrints_str(char buffer[21]);
|
||||
char* getFinishedPrints_str(char buffer[21]);
|
||||
char* getTotalPrintTime_str(char buffer[21]);
|
||||
@@ -156,47 +209,57 @@ namespace ExtUI {
|
||||
char* getFilamentUsed_str(char buffer[21]);
|
||||
#endif
|
||||
|
||||
void setTargetTemp_celsius(const float, const heater_t);
|
||||
void setTargetTemp_celsius(const float, const extruder_t);
|
||||
void setTargetFan_percent(const float, const fan_t);
|
||||
void setAxisPosition_mm(const float, const axis_t);
|
||||
void setAxisPosition_mm(const float, const extruder_t);
|
||||
void setAxisSteps_per_mm(const float, const axis_t);
|
||||
void setAxisSteps_per_mm(const float, const extruder_t);
|
||||
void setTargetTemp_celsius(const_float_t, const heater_t);
|
||||
void setTargetTemp_celsius(const_float_t, const extruder_t);
|
||||
void setTargetFan_percent(const_float_t, const fan_t);
|
||||
void coolDown();
|
||||
void setAxisPosition_mm(const_float_t, const axis_t, const feedRate_t=0);
|
||||
void setAxisPosition_mm(const_float_t, const extruder_t, const feedRate_t=0);
|
||||
void setAxisSteps_per_mm(const_float_t, const axis_t);
|
||||
void setAxisSteps_per_mm(const_float_t, const extruder_t);
|
||||
void setAxisMaxFeedrate_mm_s(const feedRate_t, const axis_t);
|
||||
void setAxisMaxFeedrate_mm_s(const feedRate_t, const extruder_t);
|
||||
void setAxisMaxAcceleration_mm_s2(const float, const axis_t);
|
||||
void setAxisMaxAcceleration_mm_s2(const float, const extruder_t);
|
||||
void setAxisMaxAcceleration_mm_s2(const_float_t, const axis_t);
|
||||
void setAxisMaxAcceleration_mm_s2(const_float_t, const extruder_t);
|
||||
void setFeedrate_mm_s(const feedRate_t);
|
||||
void setMinFeedrate_mm_s(const feedRate_t);
|
||||
void setMinTravelFeedrate_mm_s(const feedRate_t);
|
||||
void setPrintingAcceleration_mm_s2(const float);
|
||||
void setRetractAcceleration_mm_s2(const float);
|
||||
void setTravelAcceleration_mm_s2(const float);
|
||||
void setFeedrate_percent(const float);
|
||||
void setPrintingAcceleration_mm_s2(const_float_t);
|
||||
void setRetractAcceleration_mm_s2(const_float_t);
|
||||
void setTravelAcceleration_mm_s2(const_float_t);
|
||||
void setFeedrate_percent(const_float_t);
|
||||
void setFlow_percent(const int16_t, const extruder_t);
|
||||
bool awaitingUserConfirm();
|
||||
void setUserConfirmed();
|
||||
|
||||
#if M600_PURGE_MORE_RESUMABLE
|
||||
void setPauseMenuResponse(PauseMenuResponse);
|
||||
extern PauseMessage pauseModeStatus;
|
||||
PauseMode getPauseMode();
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
float getLinearAdvance_mm_mm_s(const extruder_t);
|
||||
void setLinearAdvance_mm_mm_s(const float, const extruder_t);
|
||||
void setLinearAdvance_mm_mm_s(const_float_t, const extruder_t);
|
||||
#endif
|
||||
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
float getJunctionDeviation_mm();
|
||||
void setJunctionDeviation_mm(const float);
|
||||
void setJunctionDeviation_mm(const_float_t);
|
||||
#else
|
||||
float getAxisMaxJerk_mm_s(const axis_t);
|
||||
float getAxisMaxJerk_mm_s(const extruder_t);
|
||||
void setAxisMaxJerk_mm_s(const float, const axis_t);
|
||||
void setAxisMaxJerk_mm_s(const float, const extruder_t);
|
||||
void setAxisMaxJerk_mm_s(const_float_t, const axis_t);
|
||||
void setAxisMaxJerk_mm_s(const_float_t, const extruder_t);
|
||||
#endif
|
||||
|
||||
extruder_t getTool(const uint8_t extruder);
|
||||
extruder_t getActiveTool();
|
||||
void setActiveTool(const extruder_t, bool no_move);
|
||||
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
int16_t mmToWholeSteps(const float mm, const axis_t axis);
|
||||
int16_t mmToWholeSteps(const_float_t mm, const axis_t axis);
|
||||
float mmFromWholeSteps(int16_t steps, const axis_t axis);
|
||||
|
||||
bool babystepAxis_steps(const int16_t steps, const axis_t axis);
|
||||
void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles);
|
||||
@@ -204,38 +267,40 @@ namespace ExtUI {
|
||||
|
||||
#if HAS_HOTEND_OFFSET
|
||||
float getNozzleOffset_mm(const axis_t, const extruder_t);
|
||||
void setNozzleOffset_mm(const float, const axis_t, const extruder_t);
|
||||
void setNozzleOffset_mm(const_float_t, const axis_t, const extruder_t);
|
||||
void normalizeNozzleOffset(const axis_t axis);
|
||||
#endif
|
||||
|
||||
float getZOffset_mm();
|
||||
void setZOffset_mm(const float);
|
||||
void setZOffset_mm(const_float_t);
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
float getProbeOffset_mm(const axis_t);
|
||||
void setProbeOffset_mm(const float, const axis_t);
|
||||
void setProbeOffset_mm(const_float_t, const axis_t);
|
||||
#endif
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
float getAxisBacklash_mm(const axis_t);
|
||||
void setAxisBacklash_mm(const float, const axis_t);
|
||||
void setAxisBacklash_mm(const_float_t, const axis_t);
|
||||
|
||||
float getBacklashCorrection_percent();
|
||||
void setBacklashCorrection_percent(const float);
|
||||
void setBacklashCorrection_percent(const_float_t);
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
float getBacklashSmoothing_mm();
|
||||
void setBacklashSmoothing_mm(const float);
|
||||
void setBacklashSmoothing_mm(const_float_t);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
bool getFilamentRunoutEnabled();
|
||||
void setFilamentRunoutEnabled(const bool);
|
||||
bool getFilamentRunoutState();
|
||||
void setFilamentRunoutState(const bool);
|
||||
|
||||
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
|
||||
#if HAS_FILAMENT_RUNOUT_DISTANCE
|
||||
float getFilamentRunoutDistance_mm();
|
||||
void setFilamentRunoutDistance_mm(const float);
|
||||
void setFilamentRunoutDistance_mm(const_float_t);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -245,7 +310,7 @@ namespace ExtUI {
|
||||
|
||||
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
|
||||
float getCaseLightBrightness_percent();
|
||||
void setCaseLightBrightness_percent(const float);
|
||||
void setCaseLightBrightness_percent(const_float_t);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -253,16 +318,16 @@ namespace ExtUI {
|
||||
float getPIDValues_Kp(const extruder_t);
|
||||
float getPIDValues_Ki(const extruder_t);
|
||||
float getPIDValues_Kd(const extruder_t);
|
||||
void setPIDValues(const float, const float, const float, extruder_t);
|
||||
void startPIDTune(const float, extruder_t);
|
||||
void setPIDValues(const_float_t, const_float_t , const_float_t , extruder_t);
|
||||
void startPIDTune(const celsius_t, extruder_t);
|
||||
#endif
|
||||
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
float getBedPIDValues_Kp();
|
||||
float getBedPIDValues_Ki();
|
||||
float getBedPIDValues_Kd();
|
||||
void setBedPIDValues(const float, const float, const float);
|
||||
void startBedPIDTune(const float);
|
||||
void setBedPIDValues(const_float_t, const_float_t , const_float_t);
|
||||
void startBedPIDTune(const celsius_t);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -277,8 +342,8 @@ namespace ExtUI {
|
||||
FORCE_INLINE uint32_t safe_millis() { return millis(); } // TODO: Implement for AVR
|
||||
#endif
|
||||
|
||||
void delay_us(unsigned long us);
|
||||
void delay_ms(unsigned long ms);
|
||||
void delay_us(uint32_t us);
|
||||
void delay_ms(uint32_t ms);
|
||||
void yield();
|
||||
|
||||
/**
|
||||
@@ -290,6 +355,7 @@ namespace ExtUI {
|
||||
bool isPrintingFromMediaPaused();
|
||||
bool isPrintingFromMedia();
|
||||
bool isPrinting();
|
||||
bool isPrintingPaused();
|
||||
|
||||
void printFile(const char *filename);
|
||||
void stopPrint();
|
||||
@@ -331,13 +397,20 @@ namespace ExtUI {
|
||||
void onPrintTimerStarted();
|
||||
void onPrintTimerPaused();
|
||||
void onPrintTimerStopped();
|
||||
void onPrintFinished();
|
||||
void onFilamentRunout(const extruder_t extruder);
|
||||
void onUserConfirmRequired(const char * const msg);
|
||||
void onUserConfirmRequired_P(PGM_P const pstr);
|
||||
void onStatusChanged(const char * const msg);
|
||||
void onStatusChanged_P(PGM_P const pstr);
|
||||
void onHomingStart();
|
||||
void onHomingComplete();
|
||||
void onSteppersDisabled();
|
||||
void onSteppersEnabled();
|
||||
void onFactoryReset();
|
||||
void onStoreSettings(char *);
|
||||
void onLoadSettings(const char *);
|
||||
void onPostprocessSettings();
|
||||
void onConfigurationStoreWritten(bool success);
|
||||
void onConfigurationStoreRead(bool success);
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
@@ -362,7 +435,6 @@ namespace ExtUI {
|
||||
* constexpr float increment = 10;
|
||||
*
|
||||
* UI_INCREMENT(TargetTemp_celsius, E0)
|
||||
*
|
||||
*/
|
||||
#define UI_INCREMENT_BY(method, inc, ...) ExtUI::set ## method(ExtUI::get ## method (__VA_ARGS__) + inc, ##__VA_ARGS__)
|
||||
#define UI_DECREMENT_BY(method, inc, ...) ExtUI::set ## method(ExtUI::get ## method (__VA_ARGS__) - inc, ##__VA_ARGS__)
|
||||
|
Reference in New Issue
Block a user