New --retract-lift-above and --retract-lift-below options. #763 #3057

This commit is contained in:
Alessandro Ranellucci 2015-12-18 18:36:39 +01:00
parent 562efc1677
commit 8138fbf349
8 changed files with 86 additions and 4 deletions

View file

@ -495,7 +495,14 @@ GCodeWriter::unretract()
std::string
GCodeWriter::lift()
{
double target_lift = this->config.retract_lift.get_at(0);
// check whether the above/below conditions are met
double target_lift = 0;
{
double above = this->config.retract_lift_above.get_at(0);
double below = this->config.retract_lift_below.get_at(0);
if (this->_pos.z >= above && this->_pos.z <= below && below > 0)
target_lift = this->config.retract_lift.get_at(0);
}
if (this->_lifted == 0 && target_lift > 0) {
this->_lifted = target_lift;
return this->_travel_to_z(this->_pos.z + target_lift, "lift Z");