Apply more HAS_HOTEND

This commit is contained in:
Scott Lahteine
2020-04-27 22:35:25 -05:00
parent 94291eb59f
commit 01c646a892
9 changed files with 34 additions and 66 deletions

View File

@ -1749,7 +1749,7 @@
#if HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES)
#define DO_DRAW_FAN 1
#endif
#if HOTENDS && ENABLED(STATUS_HOTEND_ANIM)
#if BOTH(HAS_HOTEND, STATUS_HOTEND_ANIM)
#define ANIM_HOTEND 1
#endif
#if BOTH(DO_DRAW_BED, STATUS_BED_ANIM)

View File

@ -169,7 +169,7 @@ namespace ExtUI {
}
void enableHeater(const extruder_t extruder) {
#if HOTENDS && HEATER_IDLE_HANDLER
#if HAS_HOTEND && HEATER_IDLE_HANDLER
thermalManager.reset_hotend_idle_timer(extruder - E0);
#else
UNUSED(extruder);
@ -234,7 +234,7 @@ namespace ExtUI {
bool isHeaterIdle(const extruder_t extruder) {
return false
#if HOTENDS && HEATER_IDLE_HANDLER
#if HAS_HOTEND && HEATER_IDLE_HANDLER
|| thermalManager.hotend_idle[extruder - E0].timed_out
#else
; UNUSED(extruder)
@ -746,13 +746,13 @@ namespace ExtUI {
#endif
float getZOffset_mm() {
#if HAS_BED_PROBE
return probe.offset.z;
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
return (planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)]);
#else
return 0.0;
#endif
return (0.0f
#if HAS_BED_PROBE
+ probe.offset.z
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
+ planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)]
#endif
);
}
void setZOffset_mm(const float value) {
@ -857,17 +857,9 @@ namespace ExtUI {
float getFeedrate_percent() { return feedrate_percentage; }
#if ENABLED(PIDTEMP)
float getPIDValues_Kp(const extruder_t tool) {
return PID_PARAM(Kp, tool);
}
float getPIDValues_Ki(const extruder_t tool) {
return unscalePID_i(PID_PARAM(Ki, tool));
}
float getPIDValues_Kd(const extruder_t tool) {
return unscalePID_d(PID_PARAM(Kd, tool));
}
float getPIDValues_Kp(const extruder_t tool) { return PID_PARAM(Kp, tool); }
float getPIDValues_Ki(const extruder_t tool) { return unscalePID_i(PID_PARAM(Ki, tool)); }
float getPIDValues_Kd(const extruder_t tool) { return unscalePID_d(PID_PARAM(Kd, tool)); }
void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
thermalManager.temp_hotend[tool].pid.Kp = p;
@ -876,23 +868,15 @@ namespace ExtUI {
thermalManager.updatePID();
}
void startPIDTune(const float temp, extruder_t tool){
void startPIDTune(const float temp, extruder_t tool) {
thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
}
#endif
#if ENABLED(PIDTEMPBED)
float getBedPIDValues_Kp() {
return thermalManager.temp_bed.pid.Kp;
}
float getBedPIDValues_Ki() {
return unscalePID_i(thermalManager.temp_bed.pid.Ki);
}
float getBedPIDValues_Kd() {
return unscalePID_d(thermalManager.temp_bed.pid.Kd);
}
float getBedPIDValues_Kp() { return thermalManager.temp_bed.pid.Kp; }
float getBedPIDValues_Ki() { return unscalePID_i(thermalManager.temp_bed.pid.Ki); }
float getBedPIDValues_Kd() { return unscalePID_d(thermalManager.temp_bed.pid.Kd); }
void setBedPIDValues(const float p, const float i, const float d) {
thermalManager.temp_bed.pid.Kp = p;
@ -906,20 +890,12 @@ namespace ExtUI {
}
#endif
void injectCommands_P(PGM_P const gcode) {
queue.inject_P(gcode);
}
void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); }
bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); }
bool isAxisPositionKnown(const axis_t axis) {
return TEST(axis_known_position, axis);
}
bool isAxisPositionKnown(const extruder_t) {
return TEST(axis_known_position, E_AXIS);
}
bool isAxisPositionKnown(const axis_t axis) { return TEST(axis_known_position, axis); }
bool isAxisPositionKnown(const extruder_t) { return TEST(axis_known_position, E_AXIS); }
bool isPositionKnown() { return all_axes_known(); }
bool isMachineHomed() { return all_axes_homed(); }
@ -1008,17 +984,9 @@ namespace ExtUI {
return IFSD(IS_SD_INSERTED() && card.isMounted(), false);
}
void pausePrint() {
ui.pause_print();
}
void resumePrint() {
ui.resume_print();
}
void stopPrint() {
ui.abort_print();
}
void pausePrint() { ui.pause_print(); }
void resumePrint() { ui.resume_print(); }
void stopPrint() { ui.abort_print(); }
void onUserConfirmRequired_P(PGM_P const pstr) {
char msg[strlen_P(pstr) + 1];