Merge pull request #9312 from thinkyhead/bf2_fade_info_too
[2.0.x] Include Z Fade in log_machine_info
This commit is contained in:
commit
4eb41031e9
3 changed files with 49 additions and 20 deletions
|
@ -335,6 +335,10 @@ void safe_delay(millis_t ms) {
|
||||||
#endif
|
#endif
|
||||||
if (planner.leveling_active) {
|
if (planner.leveling_active) {
|
||||||
SERIAL_ECHOLNPGM(" (enabled)");
|
SERIAL_ECHOLNPGM(" (enabled)");
|
||||||
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||||
|
if (planner.z_fade_height)
|
||||||
|
SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height);
|
||||||
|
#endif
|
||||||
#if ABL_PLANAR
|
#if ABL_PLANAR
|
||||||
const float diff[XYZ] = {
|
const float diff[XYZ] = {
|
||||||
stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS],
|
stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS],
|
||||||
|
@ -350,10 +354,21 @@ void safe_delay(millis_t ms) {
|
||||||
SERIAL_ECHOPGM(" Z");
|
SERIAL_ECHOPGM(" Z");
|
||||||
if (diff[Z_AXIS] > 0) SERIAL_CHAR('+');
|
if (diff[Z_AXIS] > 0) SERIAL_CHAR('+');
|
||||||
SERIAL_ECHO(diff[Z_AXIS]);
|
SERIAL_ECHO(diff[Z_AXIS]);
|
||||||
#elif ENABLED(AUTO_BED_LEVELING_UBL)
|
#else
|
||||||
SERIAL_ECHOPAIR("UBL Adjustment Z", stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS]);
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
SERIAL_ECHOPGM("UBL Adjustment Z");
|
||||||
SERIAL_ECHOPAIR("ABL Adjustment Z", bilinear_z_offset(current_position));
|
const float rz = ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]);
|
||||||
|
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||||
|
SERIAL_ECHOPGM("ABL Adjustment Z");
|
||||||
|
const float rz = bilinear_z_offset(current_position);
|
||||||
|
#endif
|
||||||
|
SERIAL_ECHO(ftostr43sign(rz, '+'));
|
||||||
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||||
|
if (planner.z_fade_height) {
|
||||||
|
SERIAL_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position[Z_AXIS]), '+'));
|
||||||
|
SERIAL_CHAR(')');
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -365,10 +380,16 @@ void safe_delay(millis_t ms) {
|
||||||
|
|
||||||
SERIAL_ECHOPGM("Mesh Bed Leveling");
|
SERIAL_ECHOPGM("Mesh Bed Leveling");
|
||||||
if (planner.leveling_active) {
|
if (planner.leveling_active) {
|
||||||
float rz = current_position[Z_AXIS];
|
|
||||||
planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], rz);
|
|
||||||
SERIAL_ECHOLNPGM(" (enabled)");
|
SERIAL_ECHOLNPGM(" (enabled)");
|
||||||
SERIAL_ECHOPAIR("MBL Adjustment Z", rz);
|
SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS], 1.0), '+'));
|
||||||
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||||
|
if (planner.z_fade_height) {
|
||||||
|
SERIAL_ECHOPAIR(" (", ftostr43sign(
|
||||||
|
mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS], planner.fade_scaling_factor_for_z(current_position[Z_AXIS])), '+'
|
||||||
|
));
|
||||||
|
SERIAL_CHAR(')');
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SERIAL_ECHOPGM(" (disabled)");
|
SERIAL_ECHOPGM(" (disabled)");
|
||||||
|
|
|
@ -132,32 +132,40 @@
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::G29() {
|
void GcodeSuite::G29() {
|
||||||
|
|
||||||
|
#if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY)
|
||||||
|
const bool seenQ = parser.seen('Q');
|
||||||
|
#else
|
||||||
|
constexpr bool seenQ = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
// G29 Q is also available if debugging
|
// G29 Q is also available if debugging
|
||||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
const bool query = parser.seen('Q');
|
|
||||||
const uint8_t old_debug_flags = marlin_debug_flags;
|
const uint8_t old_debug_flags = marlin_debug_flags;
|
||||||
if (query) marlin_debug_flags |= DEBUG_LEVELING;
|
if (seenQ) marlin_debug_flags |= DEBUG_LEVELING;
|
||||||
if (DEBUGGING(LEVELING)) {
|
if (DEBUGGING(LEVELING)) {
|
||||||
DEBUG_POS(">>> G29", current_position);
|
DEBUG_POS(">>> G29", current_position);
|
||||||
log_machine_info();
|
log_machine_info();
|
||||||
}
|
}
|
||||||
marlin_debug_flags = old_debug_flags;
|
marlin_debug_flags = old_debug_flags;
|
||||||
#if DISABLED(PROBE_MANUALLY)
|
#if DISABLED(PROBE_MANUALLY)
|
||||||
if (query) return;
|
if (seenQ) return;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(PROBE_MANUALLY)
|
#if ENABLED(PROBE_MANUALLY)
|
||||||
const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'), no_action = seenA || seenQ;
|
const bool seenA = parser.seen('A');
|
||||||
|
#else
|
||||||
|
constexpr bool seenA = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
|
const bool no_action = seenA || seenQ,
|
||||||
const bool faux = parser.boolval('C');
|
faux =
|
||||||
#elif ENABLED(PROBE_MANUALLY)
|
#if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
|
||||||
const bool faux = no_action;
|
parser.boolval('C')
|
||||||
#else
|
#else
|
||||||
bool constexpr faux = false;
|
no_action
|
||||||
#endif
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
// Don't allow auto-leveling without homing first
|
// Don't allow auto-leveling without homing first
|
||||||
if (axis_unhomed_error()) return;
|
if (axis_unhomed_error()) return;
|
||||||
|
@ -388,7 +396,7 @@ void GcodeSuite::G29() {
|
||||||
|
|
||||||
// Disable auto bed leveling during G29.
|
// Disable auto bed leveling during G29.
|
||||||
// Be formal so G29 can be done successively without G28.
|
// Be formal so G29 can be done successively without G28.
|
||||||
set_bed_leveling_enabled(false);
|
if (!no_action) set_bed_leveling_enabled(false);
|
||||||
|
|
||||||
#if HAS_BED_PROBE
|
#if HAS_BED_PROBE
|
||||||
// Deploy the probe. Probe will raise if needed.
|
// Deploy the probe. Probe will raise if needed.
|
||||||
|
|
|
@ -258,7 +258,7 @@
|
||||||
|
|
||||||
#define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL)
|
#define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL)
|
||||||
#define _TMC2208_DEFINE_SOFTWARE(ST) SoftwareSerial ST##_HARDWARE_SERIAL = SoftwareSerial(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN); \
|
#define _TMC2208_DEFINE_SOFTWARE(ST) SoftwareSerial ST##_HARDWARE_SERIAL = SoftwareSerial(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN); \
|
||||||
TMC2208Stepper stepper##ST(&stepper##ST##_serial, ST##_SERIAL_RX_PIN > -1)
|
TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL, ST##_SERIAL_RX_PIN > -1)
|
||||||
|
|
||||||
// Stepper objects of TMC2208 steppers used
|
// Stepper objects of TMC2208 steppers used
|
||||||
#if ENABLED(X_IS_TMC2208)
|
#if ENABLED(X_IS_TMC2208)
|
||||||
|
|
Loading…
Reference in a new issue