Add Lift Z only Above/Below, On Surface (e.g. Only on Top) (#1562)

* Added config options for Enforce Lift Z (from SS, doesn't affect Gcode
yet)

* working, minus first layer override; also fixed m_last_extrusion_role not being set

* fixed logic to match SS

* minimize to just one config

* removed first layer override

* Cleaned up logic, working as intended

* added lift above z, lift below z; somehow broke filament overrides

* fixed overrides not working, but lift above/below and enforce don't override

* fixed filament overrides

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Jason M-H
2023-07-22 09:07:13 -04:00
committed by GitHub
parent e339ed2a47
commit c033720435
8 changed files with 127 additions and 22 deletions

View File

@ -691,7 +691,10 @@ std::string GCodeWriter::lift(LiftType lift_type)
double target_lift = 0;
{
//BBS
target_lift = this->config.z_hop.get_at(m_extruder->id());
double above = this->config.retract_lift_above.get_at(m_extruder->id());
double below = this->config.retract_lift_below.get_at(m_extruder->id());
if (m_pos(2) >= above && (below == 0 || m_pos(2) <= below))
target_lift = this->config.z_hop.get_at(m_extruder->id());
}
// BBS
if (m_lifted == 0 && m_to_lift == 0 && target_lift > 0) {