| 444 | } |
| 445 | |
| 446 | void File::initSave() |
| 447 | { |
| 448 | m_lines.clear(); |
| 449 | |
| 450 | for (bool& fl : formatFlags) |
| 451 | fl = false; |
| 452 | |
| 453 | const QString format(m_gcp.getTool().type() == Tool::Laser ? Settings::formatLaser() : Settings::formatMilling()); |
| 454 | for (size_t i = 0; i < cmdList.size(); ++i) { |
| 455 | const int index = format.indexOf(cmdList[i], 0, Qt::CaseInsensitive); |
| 456 | if (index != -1) { |
| 457 | formatFlags[i + AlwaysG] = format[index + 1] == '+'; |
| 458 | if ((index + 2) < format.size()) |
| 459 | formatFlags[i + SpaceG] = format[index + 2] == ' '; |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | for (QString& str : lastValues) |
| 464 | str.clear(); |
| 465 | |
| 466 | setFeedRate(m_gcp.getTool().feedRate()); |
| 467 | setPlungeRate(m_gcp.getTool().plungeRate()); |
| 468 | setSpindleSpeed(m_gcp.getTool().spindleSpeed()); |
| 469 | setToolType(m_gcp.getTool().type()); |
| 470 | } |
| 471 | |
| 472 | void File::genGcodeAndTile() |
| 473 | { |
no test coverage detected