G-code window optimization: parse g-code lines only when needed

This commit is contained in:
enricoturri1966 2021-03-04 13:23:24 +01:00
parent a820e8c22f
commit cee4ed9ff2
2 changed files with 64 additions and 33 deletions

View file

@ -609,8 +609,17 @@ public:
#if ENABLE_GCODE_WINDOW
class GCodeWindow
{
struct Line
{
std::string command;
std::string parameters;
std::string comment;
};
bool m_visible{ true };
unsigned int m_file_size{ 0 };
unsigned int m_last_line_id{ 0 };
size_t m_last_lines_size{ 0 };
std::vector<Line> m_lines;
std::string m_filename;
std::vector<std::string> m_gcode;