Implemented run program handler.

This commit is contained in:
2023-05-04 21:48:55 +03:00
parent e8c8cb46a5
commit 1fd308a648
2 changed files with 93 additions and 86 deletions
+16 -3
View File
@@ -131,6 +131,11 @@ enum class check_stage {
disable_check_mode
};
enum class run_stage {
start,
run_program,
};
struct machine;
struct machine_state {
@@ -179,10 +184,11 @@ struct machine_state_check_program : public machine_state {
void on_exit(machine *m) override;
void on_line_received(std::string line) override;
check_stage stage = check_stage::start;
machine *cnc;
bool continue_program();
void move_to_next_check_stage();
check_stage stage = check_stage::start;
machine *cnc;
bool check_failed;
size_t check_error;
};
@@ -193,6 +199,14 @@ struct machine_state_run_program : public machine_state {
void on_enter(machine *m) override;
void on_exit(machine *m) override;
void on_line_received(std::string line) override;
bool continue_program();
void move_to_next_run_stage();
machine* cnc;
run_stage stage = run_stage::start;
bool run_failed;
size_t run_error;
};
@@ -259,7 +273,6 @@ protected:
grbl_machine_state state = grbl_machine_state::disconnected;
program running_program;
size_t executed_instructions = 0;
void continue_program();
void reset_machine_state();
};