Account for travel moves in elapsed_time
This commit is contained in:
parent
a94402a8a2
commit
4c622c504f
1 changed files with 11 additions and 3 deletions
|
@ -629,9 +629,17 @@ GCode::travel_to(const Point &point, ExtrusionRole role, std::string comment)
|
||||||
|
|
||||||
// use G1 because we rely on paths being straight (G0 may make round paths)
|
// use G1 because we rely on paths being straight (G0 may make round paths)
|
||||||
Lines lines = travel.lines();
|
Lines lines = travel.lines();
|
||||||
for (Lines::const_iterator line = lines.begin(); line != lines.end(); ++line)
|
double path_length = 0;
|
||||||
gcode += this->writer.travel_to_xy(this->point_to_gcode(line->b), comment);
|
for (Lines::const_iterator line = lines.begin(); line != lines.end(); ++line) {
|
||||||
|
const double line_length = line->length() * SCALING_FACTOR;
|
||||||
|
path_length += line_length;
|
||||||
|
|
||||||
|
gcode += this->writer.travel_to_xy(this->point_to_gcode(line->b), comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->config.cooling)
|
||||||
|
this->elapsed_time += path_length / this->config.get_abs_value("travel_speed");
|
||||||
|
|
||||||
return gcode;
|
return gcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue