2018-10-23 00:37:48 +00:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2020-02-03 14:00:57 +00:00
|
|
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2018-10-23 00:37:48 +00:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-28 04:57:50 +00:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2018-10-23 00:37:48 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2020-07-23 03:20:14 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2018-10-23 00:37:48 +00:00
|
|
|
*
|
|
|
|
*/
|
2019-07-05 03:44:12 +00:00
|
|
|
#pragma once
|
2018-10-23 00:37:48 +00:00
|
|
|
|
2018-10-08 20:44:05 +00:00
|
|
|
/************
|
|
|
|
* ui_api.h *
|
|
|
|
************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* To view a copy of the GNU General Public License, go to the following *
|
2020-11-07 01:09:29 +00:00
|
|
|
* location: <https://www.gnu.org/licenses/>. *
|
2018-10-08 20:44:05 +00:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "../../inc/MarlinConfig.h"
|
2020-12-23 22:37:17 +00:00
|
|
|
#include "../marlinui.h"
|
2021-06-14 03:08:46 +00:00
|
|
|
#include "../../gcode/gcode.h"
|
2021-07-09 23:24:14 +00:00
|
|
|
#if M600_PURGE_MORE_RESUMABLE
|
|
|
|
#include "../../feature/pause.h"
|
|
|
|
#endif
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2018-11-14 19:13:51 +00:00
|
|
|
namespace ExtUI {
|
2019-09-19 00:35:03 +00:00
|
|
|
|
2019-05-04 04:53:15 +00:00
|
|
|
// The ExtUI implementation can store up to this many bytes
|
|
|
|
// in the EEPROM when the methods onStoreSettings and
|
|
|
|
// onLoadSettings are called.
|
|
|
|
|
|
|
|
static constexpr size_t eeprom_data_size = 48;
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2021-06-14 03:08:46 +00:00
|
|
|
enum axis_t : uint8_t { X, Y, Z, I, J, K, X2, Y2, Z2, Z3, Z4 };
|
2020-02-04 18:37:20 +00:00
|
|
|
enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 };
|
2021-03-06 20:13:28 +00:00
|
|
|
enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER };
|
2020-01-25 08:13:39 +00:00
|
|
|
enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 };
|
2021-05-02 01:28:49 +00:00
|
|
|
enum result_t : uint8_t { PID_STARTED, PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE };
|
2018-10-08 20:44:05 +00:00
|
|
|
|
|
|
|
constexpr uint8_t extruderCount = EXTRUDERS;
|
2018-10-31 00:42:26 +00:00
|
|
|
constexpr uint8_t hotendCount = HOTENDS;
|
2018-10-08 20:44:05 +00:00
|
|
|
constexpr uint8_t fanCount = FAN_COUNT;
|
|
|
|
|
2019-05-18 01:37:23 +00:00
|
|
|
#if HAS_MESH
|
2019-09-17 23:16:28 +00:00
|
|
|
typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
2019-05-18 01:37:23 +00:00
|
|
|
#endif
|
|
|
|
|
2018-10-08 20:44:05 +00:00
|
|
|
bool isMoving();
|
2018-10-31 00:42:26 +00:00
|
|
|
bool isAxisPositionKnown(const axis_t);
|
2019-08-14 22:52:57 +00:00
|
|
|
bool isAxisPositionKnown(const extruder_t);
|
2019-04-26 07:32:01 +00:00
|
|
|
bool isPositionKnown(); // Axis position guaranteed, steppers active since homing
|
|
|
|
bool isMachineHomed(); // Axis position most likely correct, steppers may have deactivated
|
2018-10-31 00:42:26 +00:00
|
|
|
bool canMove(const axis_t);
|
|
|
|
bool canMove(const extruder_t);
|
2019-06-27 19:11:02 +00:00
|
|
|
void injectCommands_P(PGM_P const);
|
2020-06-28 03:02:28 +00:00
|
|
|
void injectCommands(char * const);
|
2019-04-26 07:32:01 +00:00
|
|
|
bool commandsInQueue();
|
2018-10-31 00:42:26 +00:00
|
|
|
|
2021-07-09 23:24:14 +00:00
|
|
|
GcodeSuite::MarlinBusyState getHostKeepaliveState();
|
|
|
|
bool getHostKeepaliveIsPaused();
|
2021-06-14 03:08:46 +00:00
|
|
|
|
2019-05-10 20:56:13 +00:00
|
|
|
bool isHeaterIdle(const heater_t);
|
|
|
|
bool isHeaterIdle(const extruder_t);
|
|
|
|
void enableHeater(const heater_t);
|
|
|
|
void enableHeater(const extruder_t);
|
|
|
|
|
2019-09-25 23:46:36 +00:00
|
|
|
#if ENABLED(JOYSTICK)
|
2019-09-29 09:25:39 +00:00
|
|
|
void jog(const xyz_float_t &dir);
|
|
|
|
void _joystick_update(xyz_float_t &norm_jog);
|
2019-09-25 23:46:36 +00:00
|
|
|
#endif
|
2019-09-19 00:35:03 +00:00
|
|
|
|
2018-10-31 00:42:26 +00:00
|
|
|
/**
|
|
|
|
* Getters and setters
|
|
|
|
* Should be used by the EXTENSIBLE_UI to query or change Marlin's state.
|
|
|
|
*/
|
2018-11-18 04:21:44 +00:00
|
|
|
PGM_P getFirmwareName_str();
|
2018-10-31 00:42:26 +00:00
|
|
|
|
2019-03-24 04:09:18 +00:00
|
|
|
#if HAS_SOFTWARE_ENDSTOPS
|
|
|
|
bool getSoftEndstopState();
|
|
|
|
void setSoftEndstopState(const bool);
|
|
|
|
#endif
|
|
|
|
|
2020-03-02 18:03:43 +00:00
|
|
|
#if HAS_TRINAMIC_CONFIG
|
2019-03-24 04:09:18 +00:00
|
|
|
float getAxisCurrent_mA(const axis_t);
|
|
|
|
float getAxisCurrent_mA(const extruder_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setAxisCurrent_mA(const_float_t, const axis_t);
|
|
|
|
void setAxisCurrent_mA(const_float_t, const extruder_t);
|
2019-03-24 04:09:18 +00:00
|
|
|
|
2019-09-18 04:41:34 +00:00
|
|
|
int getTMCBumpSensitivity(const axis_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setTMCBumpSensitivity(const_float_t, const axis_t);
|
2019-03-24 04:09:18 +00:00
|
|
|
#endif
|
|
|
|
|
2021-04-24 00:14:49 +00:00
|
|
|
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);
|
2019-01-12 06:41:48 +00:00
|
|
|
float getTargetFan_percent(const fan_t);
|
|
|
|
float getActualFan_percent(const fan_t);
|
2018-10-31 00:42:26 +00:00
|
|
|
float getAxisPosition_mm(const axis_t);
|
|
|
|
float getAxisPosition_mm(const extruder_t);
|
|
|
|
float getAxisSteps_per_mm(const axis_t);
|
|
|
|
float getAxisSteps_per_mm(const extruder_t);
|
2019-09-26 06:28:09 +00:00
|
|
|
feedRate_t getAxisMaxFeedrate_mm_s(const axis_t);
|
|
|
|
feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t);
|
2018-10-31 00:42:26 +00:00
|
|
|
float getAxisMaxAcceleration_mm_s2(const axis_t);
|
|
|
|
float getAxisMaxAcceleration_mm_s2(const extruder_t);
|
2019-09-26 06:28:09 +00:00
|
|
|
feedRate_t getMinFeedrate_mm_s();
|
|
|
|
feedRate_t getMinTravelFeedrate_mm_s();
|
2021-06-14 03:08:46 +00:00
|
|
|
feedRate_t getFeedrate_mm_s();
|
2018-10-16 21:58:29 +00:00
|
|
|
float getPrintingAcceleration_mm_s2();
|
|
|
|
float getRetractAcceleration_mm_s2();
|
|
|
|
float getTravelAcceleration_mm_s2();
|
2018-10-31 00:42:26 +00:00
|
|
|
float getFeedrate_percent();
|
2021-04-27 04:40:59 +00:00
|
|
|
int16_t getFlow_percent(const extruder_t);
|
2020-12-23 22:37:17 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-10-08 20:44:05 +00:00
|
|
|
uint32_t getProgress_seconds_elapsed();
|
2019-04-04 01:21:06 +00:00
|
|
|
|
2021-03-19 01:51:19 +00:00
|
|
|
#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
|
|
|
|
|
2020-12-23 22:37:17 +00:00
|
|
|
#if ENABLED(SHOW_REMAINING_TIME)
|
|
|
|
inline uint32_t getProgress_seconds_remaining() { return ui.get_remaining_time(); }
|
|
|
|
#endif
|
|
|
|
|
2019-03-13 05:45:52 +00:00
|
|
|
#if HAS_LEVELING
|
|
|
|
bool getLevelingActive();
|
|
|
|
void setLevelingActive(const bool);
|
2019-05-18 01:37:23 +00:00
|
|
|
bool getMeshValid();
|
2019-03-13 05:45:52 +00:00
|
|
|
#if HAS_MESH
|
2019-09-17 23:16:28 +00:00
|
|
|
bed_mesh_t& getMeshArray();
|
2019-09-29 09:25:39 +00:00
|
|
|
float getMeshPoint(const xy_uint8_t &pos);
|
2021-04-01 22:59:57 +00:00
|
|
|
void setMeshPoint(const xy_uint8_t &pos, const_float_t zval);
|
|
|
|
void moveToMeshPoint(const xy_uint8_t &pos, const_float_t z);
|
2020-11-05 22:45:22 +00:00
|
|
|
void onMeshLevelingStart();
|
2021-04-01 22:59:57 +00:00
|
|
|
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); }
|
2020-04-06 20:39:34 +00:00
|
|
|
|
2021-01-29 02:40:20 +00:00
|
|
|
typedef enum : uint8_t {
|
2021-04-04 23:58:03 +00:00
|
|
|
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
|
2020-09-13 04:32:00 +00:00
|
|
|
} probe_state_t;
|
2020-04-02 19:24:55 +00:00
|
|
|
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); }
|
2019-03-13 05:45:52 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
|
|
|
void setHostResponse(const uint8_t);
|
|
|
|
#endif
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2021-07-07 01:32:08 +00:00
|
|
|
inline void simulateUserClick() {
|
|
|
|
#if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI)
|
|
|
|
ui.lcd_clicked = true;
|
|
|
|
#endif
|
|
|
|
}
|
2021-06-14 03:08:46 +00:00
|
|
|
|
2018-10-16 21:58:29 +00:00
|
|
|
#if ENABLED(PRINTCOUNTER)
|
2021-03-19 01:51:19 +00:00
|
|
|
char* getFailedPrints_str(char buffer[21]);
|
2018-10-31 00:42:26 +00:00
|
|
|
char* getTotalPrints_str(char buffer[21]);
|
|
|
|
char* getFinishedPrints_str(char buffer[21]);
|
|
|
|
char* getTotalPrintTime_str(char buffer[21]);
|
|
|
|
char* getLongestPrint_str(char buffer[21]);
|
|
|
|
char* getFilamentUsed_str(char buffer[21]);
|
2018-10-16 21:58:29 +00:00
|
|
|
#endif
|
|
|
|
|
2021-04-24 00:06:55 +00:00
|
|
|
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);
|
2021-03-12 12:54:42 +00:00
|
|
|
void coolDown();
|
2021-04-24 00:06:55 +00:00
|
|
|
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);
|
2019-09-26 06:28:09 +00:00
|
|
|
void setAxisMaxFeedrate_mm_s(const feedRate_t, const axis_t);
|
|
|
|
void setAxisMaxFeedrate_mm_s(const feedRate_t, const extruder_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setAxisMaxAcceleration_mm_s2(const_float_t, const axis_t);
|
|
|
|
void setAxisMaxAcceleration_mm_s2(const_float_t, const extruder_t);
|
2019-09-26 06:28:09 +00:00
|
|
|
void setFeedrate_mm_s(const feedRate_t);
|
|
|
|
void setMinFeedrate_mm_s(const feedRate_t);
|
|
|
|
void setMinTravelFeedrate_mm_s(const feedRate_t);
|
2021-07-09 23:24:14 +00:00
|
|
|
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);
|
2019-11-30 13:23:53 +00:00
|
|
|
void setFlow_percent(const int16_t, const extruder_t);
|
2021-01-15 19:59:27 +00:00
|
|
|
bool awaitingUserConfirm();
|
2019-09-17 01:31:08 +00:00
|
|
|
void setUserConfirmed();
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2021-07-09 23:24:14 +00:00
|
|
|
#if M600_PURGE_MORE_RESUMABLE
|
|
|
|
void setPauseMenuResponse(PauseMenuResponse);
|
|
|
|
#endif
|
|
|
|
|
2018-10-08 20:44:05 +00:00
|
|
|
#if ENABLED(LIN_ADVANCE)
|
2018-10-31 00:42:26 +00:00
|
|
|
float getLinearAdvance_mm_mm_s(const extruder_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setLinearAdvance_mm_mm_s(const_float_t, const extruder_t);
|
2018-10-08 20:44:05 +00:00
|
|
|
#endif
|
|
|
|
|
2020-04-24 01:49:11 +00:00
|
|
|
#if HAS_JUNCTION_DEVIATION
|
2018-10-08 20:44:05 +00:00
|
|
|
float getJunctionDeviation_mm();
|
2021-07-09 23:24:14 +00:00
|
|
|
void setJunctionDeviation_mm(const_float_t);
|
2018-10-08 20:44:05 +00:00
|
|
|
#else
|
2018-10-31 00:42:26 +00:00
|
|
|
float getAxisMaxJerk_mm_s(const axis_t);
|
|
|
|
float getAxisMaxJerk_mm_s(const extruder_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setAxisMaxJerk_mm_s(const_float_t, const axis_t);
|
|
|
|
void setAxisMaxJerk_mm_s(const_float_t, const extruder_t);
|
2018-10-08 20:44:05 +00:00
|
|
|
#endif
|
|
|
|
|
2021-03-01 01:50:17 +00:00
|
|
|
extruder_t getTool(const uint8_t extruder);
|
2018-10-31 00:42:26 +00:00
|
|
|
extruder_t getActiveTool();
|
|
|
|
void setActiveTool(const extruder_t, bool no_move);
|
|
|
|
|
2019-02-06 13:16:54 +00:00
|
|
|
#if ENABLED(BABYSTEPPING)
|
2021-04-01 22:59:57 +00:00
|
|
|
int16_t mmToWholeSteps(const_float_t mm, const axis_t axis);
|
2021-06-10 08:17:39 +00:00
|
|
|
float mmFromWholeSteps(int16_t steps, const axis_t axis);
|
2019-02-06 13:16:54 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
#endif
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2019-03-12 01:48:49 +00:00
|
|
|
#if HAS_HOTEND_OFFSET
|
2018-10-31 00:42:26 +00:00
|
|
|
float getNozzleOffset_mm(const axis_t, const extruder_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setNozzleOffset_mm(const_float_t, const axis_t, const extruder_t);
|
2019-02-06 13:16:54 +00:00
|
|
|
void normalizeNozzleOffset(const axis_t axis);
|
2018-10-08 20:44:05 +00:00
|
|
|
#endif
|
|
|
|
|
2019-08-25 09:46:02 +00:00
|
|
|
float getZOffset_mm();
|
2021-07-09 23:24:14 +00:00
|
|
|
void setZOffset_mm(const_float_t);
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2020-02-09 18:22:54 +00:00
|
|
|
#if HAS_BED_PROBE
|
|
|
|
float getProbeOffset_mm(const axis_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setProbeOffset_mm(const_float_t, const axis_t);
|
2020-02-09 18:22:54 +00:00
|
|
|
#endif
|
|
|
|
|
2018-10-08 20:44:05 +00:00
|
|
|
#if ENABLED(BACKLASH_GCODE)
|
2018-10-31 00:42:26 +00:00
|
|
|
float getAxisBacklash_mm(const axis_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setAxisBacklash_mm(const_float_t, const axis_t);
|
2018-10-08 20:44:05 +00:00
|
|
|
|
|
|
|
float getBacklashCorrection_percent();
|
2021-07-09 23:24:14 +00:00
|
|
|
void setBacklashCorrection_percent(const_float_t);
|
2018-10-08 20:44:05 +00:00
|
|
|
|
|
|
|
#ifdef BACKLASH_SMOOTHING_MM
|
|
|
|
float getBacklashSmoothing_mm();
|
2021-07-09 23:24:14 +00:00
|
|
|
void setBacklashSmoothing_mm(const_float_t);
|
2018-10-08 20:44:05 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2019-02-13 02:08:34 +00:00
|
|
|
#if HAS_FILAMENT_SENSOR
|
2018-10-31 00:42:26 +00:00
|
|
|
bool getFilamentRunoutEnabled();
|
|
|
|
void setFilamentRunoutEnabled(const bool);
|
2020-06-28 03:02:28 +00:00
|
|
|
bool getFilamentRunoutState();
|
|
|
|
void setFilamentRunoutState(const bool);
|
2018-10-16 12:28:52 +00:00
|
|
|
|
2020-05-06 04:18:23 +00:00
|
|
|
#if HAS_FILAMENT_RUNOUT_DISTANCE
|
2018-10-16 12:28:52 +00:00
|
|
|
float getFilamentRunoutDistance_mm();
|
2021-07-09 23:24:14 +00:00
|
|
|
void setFilamentRunoutDistance_mm(const_float_t);
|
2018-10-16 12:28:52 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2019-11-24 12:08:05 +00:00
|
|
|
#if ENABLED(CASE_LIGHT_ENABLE)
|
|
|
|
bool getCaseLightState();
|
|
|
|
void setCaseLightState(const bool);
|
|
|
|
|
|
|
|
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
|
|
|
|
float getCaseLightBrightness_percent();
|
2021-07-09 23:24:14 +00:00
|
|
|
void setCaseLightBrightness_percent(const_float_t);
|
2019-11-24 12:08:05 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2020-02-10 22:48:22 +00:00
|
|
|
#if ENABLED(PIDTEMP)
|
2020-02-09 18:22:54 +00:00
|
|
|
float getPIDValues_Kp(const extruder_t);
|
|
|
|
float getPIDValues_Ki(const extruder_t);
|
|
|
|
float getPIDValues_Kd(const extruder_t);
|
2021-04-24 00:06:55 +00:00
|
|
|
void setPIDValues(const_float_t, const_float_t , const_float_t , extruder_t);
|
2021-07-09 23:24:14 +00:00
|
|
|
void startPIDTune(const celsius_t, extruder_t);
|
2020-02-10 22:48:22 +00:00
|
|
|
#endif
|
2020-02-24 11:29:13 +00:00
|
|
|
|
2020-02-10 22:48:22 +00:00
|
|
|
#if ENABLED(PIDTEMPBED)
|
2020-02-09 18:22:54 +00:00
|
|
|
float getBedPIDValues_Kp();
|
|
|
|
float getBedPIDValues_Ki();
|
|
|
|
float getBedPIDValues_Kd();
|
2021-07-09 23:24:14 +00:00
|
|
|
void setBedPIDValues(const_float_t, const_float_t , const_float_t);
|
|
|
|
void startBedPIDTune(const celsius_t);
|
2020-02-09 18:22:54 +00:00
|
|
|
#endif
|
|
|
|
|
2018-10-31 00:42:26 +00:00
|
|
|
/**
|
|
|
|
* Delay and timing routines
|
|
|
|
* Should be used by the EXTENSIBLE_UI to safely pause or measure time
|
|
|
|
* safe_millis must be called at least every 1 sec to guarantee time
|
|
|
|
* yield should be called within lengthy loops
|
|
|
|
*/
|
2018-11-18 04:21:44 +00:00
|
|
|
#ifdef __SAM3X8E__
|
|
|
|
uint32_t safe_millis();
|
|
|
|
#else
|
2018-11-20 06:02:13 +00:00
|
|
|
FORCE_INLINE uint32_t safe_millis() { return millis(); } // TODO: Implement for AVR
|
2018-11-18 04:21:44 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-29 02:40:20 +00:00
|
|
|
void delay_us(uint32_t us);
|
|
|
|
void delay_ms(uint32_t ms);
|
2018-10-31 00:42:26 +00:00
|
|
|
void yield();
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2018-10-31 00:42:26 +00:00
|
|
|
/**
|
|
|
|
* Media access routines
|
|
|
|
*
|
|
|
|
* Should be used by the EXTENSIBLE_UI to operate on files
|
|
|
|
*/
|
|
|
|
bool isMediaInserted();
|
2018-10-20 06:44:46 +00:00
|
|
|
bool isPrintingFromMediaPaused();
|
2018-10-08 20:44:05 +00:00
|
|
|
bool isPrintingFromMedia();
|
|
|
|
bool isPrinting();
|
2020-10-28 17:23:46 +00:00
|
|
|
bool isPrintingPaused();
|
2018-10-31 00:42:26 +00:00
|
|
|
|
|
|
|
void printFile(const char *filename);
|
2018-10-08 20:44:05 +00:00
|
|
|
void stopPrint();
|
|
|
|
void pausePrint();
|
|
|
|
void resumePrint();
|
|
|
|
|
|
|
|
class FileList {
|
|
|
|
private:
|
|
|
|
uint16_t num_files;
|
|
|
|
|
|
|
|
public:
|
|
|
|
FileList();
|
2018-10-31 00:42:26 +00:00
|
|
|
void refresh();
|
2018-11-18 04:21:44 +00:00
|
|
|
bool seek(const uint16_t, const bool skip_range_check = false);
|
2018-10-08 20:44:05 +00:00
|
|
|
|
|
|
|
const char *longFilename();
|
|
|
|
const char *shortFilename();
|
|
|
|
const char *filename();
|
2018-10-31 00:42:26 +00:00
|
|
|
bool isDir();
|
2018-10-08 20:44:05 +00:00
|
|
|
|
2018-11-18 04:21:44 +00:00
|
|
|
void changeDir(const char * const dirname);
|
2018-10-31 00:42:26 +00:00
|
|
|
void upDir();
|
|
|
|
bool isAtRootDir();
|
2019-09-18 04:41:34 +00:00
|
|
|
uint16_t count();
|
2018-10-08 20:44:05 +00:00
|
|
|
};
|
|
|
|
|
2018-10-31 00:42:26 +00:00
|
|
|
/**
|
|
|
|
* Event callback routines
|
|
|
|
*
|
|
|
|
* Should be declared by EXTENSIBLE_UI and will be called by Marlin
|
|
|
|
*/
|
2018-10-08 20:44:05 +00:00
|
|
|
void onStartup();
|
2018-10-16 21:58:29 +00:00
|
|
|
void onIdle();
|
2018-10-08 20:44:05 +00:00
|
|
|
void onMediaInserted();
|
|
|
|
void onMediaError();
|
|
|
|
void onMediaRemoved();
|
|
|
|
void onPlayTone(const uint16_t frequency, const uint16_t duration);
|
2019-10-10 00:46:10 +00:00
|
|
|
void onPrinterKilled(PGM_P const error, PGM_P const component);
|
2018-10-08 20:44:05 +00:00
|
|
|
void onPrintTimerStarted();
|
|
|
|
void onPrintTimerPaused();
|
|
|
|
void onPrintTimerStopped();
|
2020-11-05 22:45:22 +00:00
|
|
|
void onPrintFinished();
|
2019-01-28 02:18:05 +00:00
|
|
|
void onFilamentRunout(const extruder_t extruder);
|
2019-03-09 20:13:50 +00:00
|
|
|
void onUserConfirmRequired(const char * const msg);
|
2019-10-10 00:46:10 +00:00
|
|
|
void onUserConfirmRequired_P(PGM_P const pstr);
|
2018-11-18 04:21:44 +00:00
|
|
|
void onStatusChanged(const char * const msg);
|
2020-04-16 05:33:31 +00:00
|
|
|
void onStatusChanged_P(PGM_P const pstr);
|
2020-11-05 22:45:22 +00:00
|
|
|
void onHomingStart();
|
|
|
|
void onHomingComplete();
|
|
|
|
void onSteppersDisabled();
|
|
|
|
void onSteppersEnabled();
|
2018-10-08 20:44:05 +00:00
|
|
|
void onFactoryReset();
|
2019-05-04 04:53:15 +00:00
|
|
|
void onStoreSettings(char *);
|
|
|
|
void onLoadSettings(const char *);
|
2021-04-24 06:16:14 +00:00
|
|
|
void onPostprocessSettings();
|
2019-05-04 04:53:15 +00:00
|
|
|
void onConfigurationStoreWritten(bool success);
|
|
|
|
void onConfigurationStoreRead(bool success);
|
2020-01-04 03:00:44 +00:00
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
2020-03-31 19:22:04 +00:00
|
|
|
void onPowerLossResume();
|
2020-01-04 03:00:44 +00:00
|
|
|
#endif
|
|
|
|
#if HAS_PID_HEATING
|
2020-03-31 19:22:04 +00:00
|
|
|
void onPidTuning(const result_t rst);
|
2020-01-04 03:00:44 +00:00
|
|
|
#endif
|
2018-10-08 20:44:05 +00:00
|
|
|
};
|
2018-10-31 00:42:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper macros to increment or decrement a value. For example:
|
|
|
|
*
|
|
|
|
* UI_INCREMENT_BY(TargetTemp_celsius, 10, E0)
|
|
|
|
*
|
|
|
|
* Expands to:
|
|
|
|
*
|
|
|
|
* setTargetTemp_celsius(getTargetTemp_celsius(E0) + 10, E0);
|
|
|
|
*
|
|
|
|
* Or, in the case where a constant increment is desired:
|
|
|
|
*
|
|
|
|
* constexpr float increment = 10;
|
|
|
|
*
|
|
|
|
* UI_INCREMENT(TargetTemp_celsius, E0)
|
|
|
|
*/
|
2018-11-14 19:13:51 +00:00
|
|
|
#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__)
|
2018-10-31 00:42:26 +00:00
|
|
|
|
|
|
|
#define UI_INCREMENT(method, ...) UI_INCREMENT_BY(method, increment, ##__VA_ARGS__)
|
|
|
|
#define UI_DECREMENT(method, ...) UI_DECREMENT_BY(method, increment, ##__VA_ARGS__)
|