Write the current line of GCode to file
| 1788 | |
| 1789 | // Write the current line of GCode to file |
| 1790 | void StringParser::WriteToFile() noexcept |
| 1791 | { |
| 1792 | DecodeCommand(); |
| 1793 | if (GetCommandLetter() == 'M') |
| 1794 | { |
| 1795 | if (GetCommandNumber() == 29) // end of file? |
| 1796 | { |
| 1797 | fileBeingWritten->Close(); |
| 1798 | fileBeingWritten = nullptr; |
| 1799 | Init(); |
| 1800 | const char *_ecv_array const r = (gb.LatestMachineState().compatibility == Compatibility::Marlin) ? "Done saving file." : ""; |
| 1801 | reprap.GetGCodes().HandleReply(gb, GCodeResult::ok, r); |
| 1802 | return; |
| 1803 | } |
| 1804 | } |
| 1805 | |
| 1806 | size_t indent = commandIndent; |
| 1807 | while (indent != 0) |
| 1808 | { |
| 1809 | fileBeingWritten->Write(' '); |
| 1810 | --indent; |
| 1811 | } |
| 1812 | fileBeingWritten->Write(gb.buffer); |
| 1813 | fileBeingWritten->Write('\n'); |
| 1814 | Init(); |
| 1815 | } |
| 1816 | |
| 1817 | // Write a character to file, returning true if we finished doing the binary upload |
| 1818 | bool StringParser::WriteBinaryToFile(char b) noexcept |
nothing calls this directly
no test coverage detected