FIX: fix issues in the third phase of buried point

JIRA: STUDIO-5970 STUDIO-6001 STUDIO-6011 STUDIO-6012

Signed-off-by: Kunlong Ma <kunlong.ma@bambulab.com>
Change-Id: Ie0726adb1ef0a9e775ab588aed036cd764c05f06
This commit is contained in:
Kunlong Ma 2024-01-19 10:29:28 +08:00 committed by Lane.Wei
parent cecf92d4fc
commit 68463ac7b3
6 changed files with 42 additions and 52 deletions

View File

@ -1323,10 +1323,6 @@ wxMenu* MenuFactory::sla_object_menu()
append_menu_items_convert_unit(&m_sla_object_menu);
append_menu_item_settings(&m_sla_object_menu);
//update_menu_items_instance_manipulation(mtObjectSLA);
{
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("sla_object_menu", std::to_string(++sla_obj_menu_count));
}
return &m_sla_object_menu;
}
@ -1344,19 +1340,11 @@ wxMenu* MenuFactory::part_menu()
wxMenu* MenuFactory::instance_menu()
{
{
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("instance_menu", std::to_string(++instance_menu_count));
}
return &m_instance_menu;
}
wxMenu* MenuFactory::layer_menu()
{
{
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("layer_menu", std::to_string(++layer_menu_count));
}
MenuWithSeparators* menu = new MenuWithSeparators();
append_menu_item_settings(menu);
@ -1499,10 +1487,6 @@ wxMenu* MenuFactory::assemble_part_menu()
append_menu_item_change_extruder(menu);
//append_menu_item_per_object_settings(menu);
{
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("assemble_part_menu", std::to_string(++assemble_part_menu_count));
}
return menu;
}

View File

@ -96,14 +96,10 @@ private:
int object_menu_count{ 0 };
int part_menu_count{ 0 };
int sla_obj_menu_count{ 0 };
int default_menu_count{ 0 };
int instance_menu_count{ 0 };
int plate_menu_count{ 0 };
int layer_menu_count{ 0 };
int multi_selection_menu_count{ 0 };
int assemble_object_menu_ocunt{ 0 };
int assemble_part_menu_count{ 0 };
int assemble_multi_selection_menu_count{ 0 };
// Removed/Prepended Items according to the view mode

View File

@ -525,21 +525,20 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
j.clear();
j["default_menu"] = get_value("default_menu");
j["object_menu"] = get_value("object_ment");
j["object_menu"] = get_value("object_menu");
j["part_menu"] = get_value("part_menu");
j["layer_menu"] = get_value("layer_menu");
j["multi_selection_menu"] = get_value("multi_selection_menu");
j["plate_menu"] = get_value("plate_menu");
j["assemble_object_menu"] = get_value("assemble_object_menu");
j["assemble_part_menu"] = get_value("assemble_part_menu");
j["assemble_multi_selection_menu"] = get_value("assemble_multi_selection_menu");
agent->track_event("menu_click", j.dump());
j.clear();
j["device_page"] = get_value("select_device_page");
j["status"] = get_value("Status");
j["MicroSD_card"] = get_value("MicroSD Card");
j["status"] = get_value("status");
j["sd_card"] = get_value("sd_card");
j["HMS"] = get_value("HMS");
j["update"] = get_value("update");
agent->track_event("device_ctrl", j.dump());
}
}

View File

@ -171,10 +171,11 @@ MonitorPanel::~MonitorPanel()
m_media_file_panel->SwitchStorage(title == _L("SD Card"));
}
page->SetFocus();
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " select :" << m_tabpanel->GetPageText(m_tabpanel->GetSelection());
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " select :" << get_string_from_tab(PrinterTab(m_tabpanel->GetSelection()))
<< " wxString:" << m_tabpanel->GetPageText(m_tabpanel->GetSelection()).ToStdString();
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) {
std::string name = m_tabpanel->GetPageText(m_tabpanel->GetSelection()).ToStdString();
std::string name = get_string_from_tab(PrinterTab(m_tabpanel->GetSelection()));
if (name != "") {
std::string value = "";
agent->track_get_property(name, value);
@ -518,5 +519,25 @@ Freeze();
Thaw();
}
std::string MonitorPanel::get_string_from_tab(PrinterTab tab)
{
switch (tab) {
case PT_STATUS :
return "status";
case PT_MEDIA:
return "sd_card";
case PT_UPDATE:
return "update";
case PT_HMS:
return "HMS";
case PT_DEBUG:
return "debug";
default:
return "";
}
return "";
}
} // GUI
} // Slic3r

View File

@ -146,6 +146,8 @@ public:
void update_side_panel();
void show_status(int status);
std::string get_string_from_tab(PrinterTab tab);
MachineObject *obj { nullptr };
std::string last_conn_type = "undedefined";
};

View File

@ -2118,6 +2118,8 @@ struct Plater::priv
//BBS: add popup object table logic
//ObjectTableDialog* m_popup_table{ nullptr };
std::chrono::system_clock::time_point start;
std::string file_type;
std::string is_mw;
#if ENABLE_ENVIRONMENT_MAP
GLTexture environment_texture;
@ -4166,25 +4168,15 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
if (start == default_time) {
start = std::chrono::system_clock::now();
}
NetworkAgent* agent = wxGetApp().getAgent();
if (agent) {
if (!input_files.empty()) {
auto path = input_files.front();
std::string extension = path.extension().string();
if (!input_files.empty()) {
auto path = input_files.front();
file_type = path.extension().string();
std::string value = "";
agent->track_get_property("file_type", value);
if (value == "") {
value = extension;
agent->track_update_property("file_type", value);
}
if (model.model_info == nullptr) {
agent->track_update_property("is_mw", "false");
}
else {
agent->track_update_property("is_mw", "true");
}
if (model.model_info == nullptr) {
is_mw = "false";
}
else {
is_mw = "true";
}
}
return obj_idxs;
@ -8369,12 +8361,8 @@ void Plater::priv::record_start_print_preset(std::string action) {
j["record_event"] = action;
NetworkAgent* agent = wxGetApp().getAgent();
if (agent) {
std::string value = "";
agent->track_get_property("file_type", value);
j_workflow_debug["file_type"] = value;
value = "";
agent->track_get_property("is_mw", value);
j_workflow_debug["is_mw"] = value;
j_workflow_debug["file_type"] = file_type;
j_workflow_debug["is_mw"] = is_mw;
agent->track_event("user_start_print", j.dump());
agent->track_event("workflow_debug", j_workflow_debug.dump());
@ -8670,7 +8658,7 @@ int Plater::save_project(bool saveAs)
json j;
boost::uintmax_t size = boost::filesystem::file_size(into_path(filename));
j["file_size"] = size;
j["file_name"] = std::string(filename.mb_str());
j["file_name"] = into_path(filename).filename().string();
NetworkAgent* agent = wxGetApp().getAgent();
if (agent) agent->track_event("save_project", j.dump());