From 4166a156ea2530d3ba348c579d188c9231fb81d9 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Fri, 14 Feb 2025 18:44:11 +0800 Subject: [PATCH] ENH:add log jira: STUDIO-10445 Change-Id: If1c2b41b0f93a2f1f8bde4b3aa543a9ddeaccc08 --- src/libslic3r/PresetBundle.cpp | 5 +++-- src/slic3r/GUI/Plater.cpp | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 09eb6006b..4b678cac5 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -1901,11 +1901,12 @@ void PresetBundle::get_ams_cobox_infos(AMSComboInfo& combox_info) unsigned int PresetBundle::sync_ams_list(unsigned int &unknowns, bool use_map, std::map &maps,bool enable_append, MergeFilamentInfo &merge_info) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "use_map:" << use_map << " enable_append:" << enable_append; std::vector ams_filament_presets; std::vector ams_filament_colors; std::vector ams_array_maps; ams_multi_color_filment.clear(); - BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": filament_ams_list size: %1%") % filament_ams_list.size(); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": filament_ams_list size: %1%") % filament_ams_list.size(); struct AmsInfo { bool valid{false}; @@ -1954,7 +1955,7 @@ unsigned int PresetBundle::sync_ams_list(unsigned int &unknowns, bool use_map, s auto iter = std::find_if(filaments.begin(), filaments.end(), [this, &filament_id](auto &f) { return f.is_compatible && filaments.get_preset_base(f) == &f && f.filament_id == filament_id; }); if (iter == filaments.end()) { - BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": filament_id %1% not found or system or compatible") % filament_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": filament_id %1% not found or system or compatible") % filament_id; auto filament_type = ams.opt_string("filament_type", 0u); if (!filament_type.empty()) { filament_type = "Generic " + filament_type; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 18a957b0c..bcec32d7e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1151,16 +1151,19 @@ bool Sidebar::priv::sync_extruder_list(bool &only_external_material) return false; } - if (!plater->check_printer_initialized(obj)) + if (!plater->check_printer_initialized(obj)) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " check_printer_initialized fail"; return false; + } std::string machine_print_name = obj->printer_type; PresetBundle *preset_bundle = wxGetApp().preset_bundle; std::string target_model_id = preset_bundle->printers.get_selected_preset().get_printer_type(preset_bundle); Preset* machine_preset = get_printer_preset(obj); - if (!machine_preset) + if (!machine_preset) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << "check error: machine_preset empty"; return false; - + } if (machine_print_name != target_model_id) { MessageDialog dlg(this->plater, _L("The currently selected machine preset is inconsistent with the connected printer type.\n" "Are you sure to continue syncing?"), _L("Sync printer information"), wxICON_WARNING | wxYES | wxNO); @@ -10727,8 +10730,10 @@ bool Plater::try_sync_preset_with_connected_printer(int& nozzle_diameter) return false; MachineObject* obj = dev->get_selected_machine(); - if (!obj || !obj->is_info_ready() || obj->m_extder_data.extders.size() <= 0) + if (!obj || !obj->is_info_ready() || obj->m_extder_data.extders.size() <= 0) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " obj may empty"; return false; + } if (!obj->is_online()) { BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "obj->is_online(): " << obj->is_online(); auto printer_name = get_selected_printer_name_in_combox(); @@ -10750,8 +10755,10 @@ bool Plater::try_sync_preset_with_connected_printer(int& nozzle_diameter) // can not find the preset for connected printer, return false Preset* machine_preset = get_printer_preset(obj); - if (!machine_preset) + if (!machine_preset) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " machine_preset is empty"; return false; + } std::string printer_model = machine_preset->config.option("printer_model")->value; bool sync_printer_preset = false; @@ -10774,6 +10781,7 @@ bool Plater::try_sync_preset_with_connected_printer(int& nozzle_diameter) if (dlg.ShowModal() == wxID_YES) { sync_printer_preset = true; } else { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " sync_after_load_file_show_flag"; return false; } }