Enabling opening and running of programs. Added jogging.

This commit is contained in:
2023-04-27 23:15:06 +03:00
parent 32bda9d55b
commit 796fd57ac3
7 changed files with 420 additions and 1441 deletions
+5 -3
View File
@@ -12,7 +12,7 @@ grbl::tcp_transport::tcp_transport(std::string address, uint16_t p)
live_check_thread = std::thread(&grbl::tcp_transport::worker, this);
}
void grbl::tcp_transport::open(grbl::transport_callbacks &cb) {
void grbl::tcp_transport::open(grbl::transport_callbacks& cb) {
if (is_connected) {
close();
}
@@ -83,6 +83,8 @@ void grbl::tcp_transport::worker() {
if (result == -1) {
std::cerr << "Failed while writing." << std::endl;
close();
} else {
std::cout << "<< " << line << std::endl;
}
send_queue.pop();
@@ -127,8 +129,8 @@ grbl::tcp_transport::~tcp_transport() {
live_check_thread.join();
}
bool grbl::tcp_transport::is_empty_line(const std::string &line) {
for (auto &c: line) {
bool grbl::tcp_transport::is_empty_line(const std::string& line) {
for (auto& c: line) {
if (c != '\r' && c != '\n' && c != ' ') {
return false;
}