MCPcopy Create free account
hub / github.com/XRay3D/GERBER_X3 / endFile

Method endFile

GGEasy/gcode/gcfile.cpp:574–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

572}
573
574void 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
593mvector<QString> File::gCodeText() const { return m_lines; }
594

Callers 1

Calls 7

xMethod · 0.80
yMethod · 0.80
safeZMethod · 0.80
sizeMethod · 0.80
isEmptyMethod · 0.80
push_backMethod · 0.45
posMethod · 0.45

Tested by

no test coverage detected