diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 187ee95cf4..fbaccfe86a 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -6087,6 +6087,8 @@ bool GLCanvas3D::_init_main_toolbar() wxGetApp().plater()->orient(); //BBS do not show orient menu //_render_orient_menu(left, right, bottom, top); + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) agent->track_update_property("auto_orient", std::to_string(++auto_orient_count)); } }; if (!m_main_toolbar.add_item(item)) @@ -6096,7 +6098,12 @@ bool GLCanvas3D::_init_main_toolbar() item.icon_filename = m_is_dark ? "toolbar_arrange_dark.svg" : "toolbar_arrange.svg"; item.tooltip = _utf8(L("Arrange all objects")) + " [A]\n" + _utf8(L("Arrange objects on selected plates")) + " [Shift+A]"; item.sprite_id++; - item.left.action_callback = []() {}; + item.left.action_callback = [this]() { + if (m_canvas != nullptr) { + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) agent->track_update_property("auto_arrange", std::to_string(++auto_arrange_count)); + } + }; item.enabling_callback = []()->bool { return wxGetApp().plater()->can_arrange(); }; item.left.toggable = true; //BBS: GUI refactor: adjust the main toolbar position @@ -6121,7 +6128,13 @@ bool GLCanvas3D::_init_main_toolbar() item.tooltip = _utf8(L("Split to objects")); item.sprite_id++; item.left.render_callback = nullptr; - item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_OBJECTS)); }; + item.left.action_callback = [this]() { + if (m_canvas != nullptr) { + wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_OBJECTS)); + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) agent->track_update_property("split_to_objects", std::to_string(++split_to_objects_count)); + } + }; item.visibility_callback = GLToolbarItem::Default_Visibility_Callback; item.enabling_callback = []()->bool { return wxGetApp().plater()->can_split_to_objects(); }; if (!m_main_toolbar.add_item(item)) @@ -6131,7 +6144,13 @@ bool GLCanvas3D::_init_main_toolbar() item.icon_filename = m_is_dark ? "split_parts_dark.svg" : "split_parts.svg"; item.tooltip = _utf8(L("Split to parts")); item.sprite_id++; - item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_VOLUMES)); }; + item.left.action_callback = [this]() { + if (m_canvas != nullptr) { + wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_VOLUMES)); + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) agent->track_update_property("split_to_part", std::to_string(++split_to_part_count)); + } + }; item.visibility_callback = GLToolbarItem::Default_Visibility_Callback; item.enabling_callback = []()->bool { return wxGetApp().plater()->can_split_to_volumes(); }; if (!m_main_toolbar.add_item(item)) @@ -6141,7 +6160,13 @@ bool GLCanvas3D::_init_main_toolbar() item.icon_filename = m_is_dark ? "toolbar_variable_layer_height_dark.svg" : "toolbar_variable_layer_height.svg"; item.tooltip = _utf8(L("Variable layer height")); item.sprite_id++; - item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_LAYERSEDITING)); }; + item.left.action_callback = [this]() { + if (m_canvas != nullptr) { + wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_LAYERSEDITING)); + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) agent->track_update_property("custom_height", std::to_string(++custom_height_count)); + } + }; item.visibility_callback = [this]()->bool { bool res = current_printer_technology() == ptFFF; // turns off if changing printer technology @@ -6244,7 +6269,13 @@ bool GLCanvas3D::_init_assemble_view_toolbar() item.tooltip = _utf8(L("Assembly View")); item.sprite_id = 1; item.left.toggable = false; - item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLVIEWTOOLBAR_ASSEMBLE)); m_gizmos.reset_all_states(); wxGetApp().plater()->get_assmeble_canvas3D()->get_gizmos_manager().reset_all_states(); }; + item.left.action_callback = [this]() { + if (m_canvas != nullptr) { + wxPostEvent(m_canvas, SimpleEvent(EVT_GLVIEWTOOLBAR_ASSEMBLE)); m_gizmos.reset_all_states(); wxGetApp().plater()->get_assmeble_canvas3D()->get_gizmos_manager().reset_all_states(); + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) agent->track_update_property("custom_painting", std::to_string(++custom_painting_count)); + } + }; item.left.render_callback = GLToolbarItem::Default_Render_Callback; item.visible = true; item.visibility_callback = [this]()->bool { return true; }; diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index c3331deeec..8eb5158a09 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -628,6 +628,15 @@ private: ArrangeSettings &get_arrange_settings() { return get_arrange_settings(this); } + + //BBS:record key botton frequency + int auto_orient_count = 0; + int auto_arrange_count = 0; + int split_to_objects_count = 0; + int split_to_part_count = 0; + int custom_height_count = 0; + int custom_painting_count = 0; + public: OrientSettings& get_orient_settings() { diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp index ba8fd5280b..c725809bba 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp @@ -191,6 +191,9 @@ public: virtual std::string get_tooltip() const { return ""; } + int get_count() { return ++count; } + std::string get_gizmo_name() { return on_get_name(); } + protected: float last_input_window_width = 0; virtual bool on_init() = 0; @@ -229,6 +232,7 @@ private: // Flag for dirty visible state of Gizmo // When True then need new rendering bool m_dirty; + int count = 0; }; diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 7890487f95..3430b15eaf 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -983,6 +983,15 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt) update_data(); m_parent.set_as_dirty(); } + try { + std::string name = m_gizmos[m_hover]->get_gizmo_name(); + int count = m_gizmos[m_hover]->get_count(); + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) { + agent->track_update_property(name, std::to_string(count)); + } + } + catch (...) {} } else if (evt.MiddleDown()) { m_mouse_capture.middle = true; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index e364a529e4..7680ca144d 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -470,6 +470,56 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_ //} #endif + try { + NetworkAgent* agent = GUI::wxGetApp().getAgent(); + if (agent) { + json j; + std::string value; + agent->track_get_property("auto_orient", value); + j["auto_orient"] = value; + value = ""; + agent->track_get_property("auto_arrange", value); + j["auto_arrange"] = value; + value = ""; + agent->track_get_property("split_to_object", value); + j["split_to_object"] = value; + value = ""; + agent->track_get_property("split_to_part", value); + j["split_to_part"] = value; + value = ""; + agent->track_get_property("custom_height", value); + j["custom_height"] = value; + value = ""; + + agent->track_get_property("Move", value); + j["move"] = value; + value = ""; + agent->track_get_property("Rotate", value); + j["rotate"] = value; + value = ""; + agent->track_get_property("Scale", value); + j["scale"] = value; + value = ""; + agent->track_get_property("Lay on face", value); + j["flatten"] = value; + value = ""; + agent->track_get_property("Support Painting", value); + j["custom_support"] = value; + value = ""; + agent->track_get_property("Seam painting", value); + j["custom_seam"] = value; + value = ""; + agent->track_get_property("Text shape", value); + j["text_shape"] = value; + value = ""; + agent->track_get_property("custom_painting", value); + j["custom_painting"] = value; + agent->track_event("key_func", j.dump()); + } + + } + catch (...) {} + MarkdownTip::ExitTip(); m_plater->reset();