Got rid of segfault when uploading VBOs.
Added go-to-zero function. Reworked how work pos is obtained.
This commit is contained in:
+15
-3
@@ -165,7 +165,7 @@ struct machine_state_init : public machine_state {
|
||||
init_stage init_state = init_stage::start;
|
||||
void move_to_next_init_stage();
|
||||
|
||||
machine* cnc;
|
||||
machine *cnc;
|
||||
};
|
||||
|
||||
struct machine_state_idle : public machine_state {
|
||||
@@ -203,7 +203,7 @@ struct machine_state_run_program : public machine_state {
|
||||
bool continue_program();
|
||||
void move_to_next_run_stage();
|
||||
|
||||
machine* cnc;
|
||||
machine *cnc;
|
||||
run_stage stage = run_stage::start;
|
||||
bool run_failed;
|
||||
size_t run_error;
|
||||
@@ -228,7 +228,11 @@ struct machine : public transport_callbacks {
|
||||
|
||||
void set_listener(grbl::machine_listener *listener);
|
||||
void connect();
|
||||
void run_program(const grbl::program& pgm, std::string work_offset);
|
||||
|
||||
void set_work_offset(std::string work_offset);
|
||||
std::array<float, 3> get_work_pos() const;
|
||||
|
||||
void run_program(const grbl::program& pgm, const std::string& work_offset);
|
||||
void check_program(const grbl::program& pgm);
|
||||
void request_jog(jog_state jog) const;
|
||||
void cancel_jog() const;
|
||||
@@ -246,6 +250,8 @@ struct machine : public transport_callbacks {
|
||||
// 0 = G54, 1 = G55, etc
|
||||
void zero_offset(int which);
|
||||
|
||||
void go_to_zero(bool x, bool y, bool z);
|
||||
|
||||
// 0 = G54, 1 = G55, etc axis 0=X, 1=Y, 2=Z
|
||||
void zero_offset_axis(int offset_index, int axis);
|
||||
|
||||
@@ -266,6 +272,12 @@ protected:
|
||||
std::map<std::string, std::string, settings_cmp> settings;
|
||||
std::map<std::string, std::string, parameters_cmp> parameters;
|
||||
|
||||
std::string current_work_offset;
|
||||
float current_work_offset_values[3] = {0};
|
||||
public:
|
||||
const float *get_current_work_offset_values() const;
|
||||
protected:
|
||||
|
||||
volatile size_t awaiting_responses = 0;
|
||||
realtime_status_report last_report{};
|
||||
machine_listener *listener = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user