| 572 | } |
| 573 | |
| 574 | void File::endFile() |
| 575 | { |
| 576 | if (toolType() == Tool::Laser) { |
| 577 | m_lines.push_back(Settings::spindleLaserOff()); |
| 578 | QPointF home(Marker::get(Marker::Home)->pos() - Marker::get(Marker::Zero)->pos()); |
| 579 | m_lines.push_back(formated({ g0(), x(home.x()), y(home.y()) })); //HomeXY |
| 580 | m_lines.push_back(Settings::laserEnd()); |
| 581 | } else { |
| 582 | m_lines.push_back(formated({ g0(), z(App::project()->safeZ()) })); //HomeZ |
| 583 | QPointF home(Marker::get(Marker::Home)->pos() - Marker::get(Marker::Zero)->pos()); |
| 584 | m_lines.push_back(formated({ g0(), x(home.x()), y(home.y()) })); //HomeXY |
| 585 | m_lines.push_back(Settings::end()); |
| 586 | } |
| 587 | for (size_t i = 0; i < m_lines.size(); ++i) { // remove epty lines |
| 588 | if (m_lines[i].isEmpty()) |
| 589 | m_lines.erase(m_lines.begin() + i--); |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | mvector<QString> File::gCodeText() const { return m_lines; } |
| 594 | |