From 414344faaf6243932af20806113d6226cbe1d681 Mon Sep 17 00:00:00 2001 From: Adrian Scripca Date: Fri, 5 May 2023 22:53:46 +0300 Subject: [PATCH] Markup cleanup + fixed precision DRO display. --- main.cpp | 527 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 272 insertions(+), 255 deletions(-) diff --git a/main.cpp b/main.cpp index da42eb6..98ee1b1 100644 --- a/main.cpp +++ b/main.cpp @@ -51,14 +51,13 @@ public: Window *window; grbl::jog_state jog; - TextBox *txtStatus; + TextBox *txt_status; TextBox *txtMessage; - nanogui::Color colRed = nanogui::Color(255, 0, 0, 255); + nanogui::Color color_red = nanogui::Color(255, 0, 0, 255); nanogui::Color colGreen = nanogui::Color(0, 255, 0, 255); - nanogui::Color colBg; int last_alarm = 0; grbl::program pgm; - Button *btnLoadProgram, *btnCheckProgram, *btnRunProgram; + Button *btn_load_program, *btn_check_program, *btn_run_program; std::vector jog_distances = {"0.01", "0.1", "1", "10"}; std::vector jog_feed_rates = {"5", "100", "500", "1000"}; @@ -69,6 +68,7 @@ public: float cam_zoom = 0; glm::quat cam_src_rotation = glm::quat(1.0, 0.0, 0.0, 0.0); // identity quaternion + Widget *info_layer; TabWidget *tab_widget; VScrollPanel *settings_vscroll; Widget *settings_layer; @@ -78,16 +78,13 @@ public: TextBox *mpos_x_text, *mpos_y_text, *mpos_z_text; ComboBox *cbo_work_offset, *cbo_tool, *cbo_jog_feed_rates, *cbo_jog_distance; Button *btn_keyboard_jog; + std::stringstream dro_ss; + SenderApp() : Screen(Vector2i(1024, 768), "GRBL Sender") { inc_ref(); - // save regular button color - colBg = theme()->m_button_gradient_bot_focused; - - // create main window window = new Window(this, "Machine status"); -// window->set_fixed_height((Screen::size().y() - 40) / 2); window->set_position(Vector2i(0, 0)); window->set_layout(new BoxLayout(nanogui::Orientation::Vertical)); @@ -96,221 +93,30 @@ public: tab_widget->set_selected_index(index); }); - tab_widget->set_fixed_height((this->height() - 80) / 2); + info_layer = tab_widget->add(); + tab_widget->append_tab("Info", info_layer); - Widget *layer = new Widget(tab_widget); - layer->set_layout(new GroupLayout(10, 20, 30, 0)); - tab_widget->append_tab("Info", layer); + info_layer->set_layout(new GroupLayout(10, 20, 30, 0)); + info_layer->add