Implemented showing program extents
This commit is contained in:
@@ -682,6 +682,12 @@ void grbl::machine::request_jog_fixed(grbl::jog_direction dir, float distance, f
|
||||
awaiting_responses++;
|
||||
}
|
||||
|
||||
void grbl::machine::start_z_probe(float min_z, float feed_rate) {
|
||||
std::string command = "G38.2 Z" + std::to_string(min_z) + "F" + std::to_string(feed_rate);
|
||||
pipe->send(command);
|
||||
awaiting_responses++;
|
||||
}
|
||||
|
||||
bool grbl::jog_state::no_jogging() const {
|
||||
return !(up_pressed || down_pressed || left_pressed || right_pressed || z_up_pressed || z_down_pressed);
|
||||
}
|
||||
@@ -812,6 +818,18 @@ void grbl::machine_state_idle::on_line_received(std::string line) {
|
||||
// TODO: some parameters have more than two :
|
||||
auto pieces = split_string(line, ":");
|
||||
cnc->parameters[pieces[0]] = pieces[1];
|
||||
|
||||
if (starts_with(line, "PRB")) {
|
||||
auto pieces = split_string(line, ":");
|
||||
auto coords_as_string = split_string(pieces[1], ",");
|
||||
|
||||
float probe_coords[3];
|
||||
for (auto i = 0; i < 3; i++) {
|
||||
probe_coords[i] = std::stof(coords_as_string[i]);
|
||||
}
|
||||
bool probe_touched = pieces[2] == "1";
|
||||
cnc->listener->on_probe_result(probe_touched, probe_coords);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user