Implemented run program handler.
This commit is contained in:
+16
-3
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user