Implemented check program handler.
This commit is contained in:
+14
-1
@@ -124,6 +124,13 @@ enum class init_stage {
|
||||
fetch_parameters
|
||||
};
|
||||
|
||||
enum class check_stage {
|
||||
start,
|
||||
enable_check_mode,
|
||||
run_program,
|
||||
disable_check_mode
|
||||
};
|
||||
|
||||
struct machine;
|
||||
|
||||
struct machine_state {
|
||||
@@ -171,6 +178,13 @@ struct machine_state_check_program : public machine_state {
|
||||
void on_enter(machine *m) override;
|
||||
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();
|
||||
bool check_failed;
|
||||
size_t check_error;
|
||||
};
|
||||
|
||||
struct machine_state_run_program : public machine_state {
|
||||
@@ -245,7 +259,6 @@ protected:
|
||||
grbl_machine_state state = grbl_machine_state::disconnected;
|
||||
program running_program;
|
||||
size_t executed_instructions = 0;
|
||||
bool entered_check_mode = false;
|
||||
void continue_program();
|
||||
void reset_machine_state();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user