Add alarm details and only rerender status when it changes

This commit is contained in:
2023-04-28 16:08:05 +03:00
parent 30ccb20846
commit 0b8f5a6950
4 changed files with 55 additions and 18 deletions
+14 -1
View File
@@ -46,6 +46,19 @@ struct realtime_status_report {
std::string firmware;
};
inline bool operator==(const realtime_status_report& a, const realtime_status_report& b) {
return (a.status == b.status &&
a.sub_status == b.sub_status &&
a.machine_pos[0] == b.machine_pos[0] &&
a.machine_pos[1] == b.machine_pos[1] &&
a.machine_pos[2] == b.machine_pos[2] &&
a.work_pos[0] == b.work_pos[0] &&
a.work_pos[1] == b.work_pos[1] &&
a.work_pos[2] == b.work_pos[2] &&
true
);
}
realtime_status_report parse_status_report(std::string line, grbl::realtime_status_report& result);
enum class grbl_machine_state {
@@ -119,7 +132,7 @@ protected:
void on_line_received(std::string line, transport *transport) override;
realtime_status_report last_report{};
machine_listener* listener = nullptr;
machine_listener *listener = nullptr;
transport *pipe = nullptr;
grbl_machine_state state = grbl_machine_state::init;
program running_program;