diff --git a/src/BambuStudio.cpp b/src/BambuStudio.cpp index f3b5e05b3..6a9f05163 100644 --- a/src/BambuStudio.cpp +++ b/src/BambuStudio.cpp @@ -1346,7 +1346,7 @@ int CLI::run(int argc, char **argv) if (loaded_filament_ids.size() > input_index) { if (loaded_filament_ids[input_index] > 0) { if (loaded_filament_ids[input_index] > load_filaments.size()) { - BOOST_LOG_TRIVIAL(error) << boost::format("invalid filament id %1% at index %2%, max %3%")%loaded_filament_ids[input_index] % (input_index + 1) %load_filaments.size(); + BOOST_LOG_TRIVIAL(error) << boost::format("invalid filament_id %1% at index %2%, max %3%")%loaded_filament_ids[input_index] % (input_index + 1) %load_filaments.size(); record_exit_reson(outfile_dir, CLI_INVALID_PARAMS, 0, cli_errors[CLI_INVALID_PARAMS], sliced_info); flush_and_exit(CLI_INVALID_PARAMS); } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index ebb3a01ff..23e46470e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -431,6 +431,7 @@ void Preset::load_info(const std::string& file) } else if (v.first.compare("base_id") == 0) { this->base_id = v.second.get_value(); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " load info from: " << file << " and base_id: " << this->base_id; if (this->base_id.compare("null") == 0) this->base_id.clear(); } @@ -530,6 +531,7 @@ void Preset::save(DynamicPrintConfig* parent_config) } else { this->config.save_to_json(this->file, this->name, from_str, this->version.to_string(), this->custom_defined); } + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " save config for: " << this->name << " and filament_id: " << filament_id << " and base_id: " << this->base_id; fs::path idx_file(this->file); idx_file.replace_extension(".info"); @@ -1184,6 +1186,7 @@ void PresetCollection::load_presets( // Find a default preset for the config. The PrintPresetCollection provides different default preset based on the "printer_technology" field. preset.config = default_preset.config; } + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " load preset: " << name << " and filament_id: " << preset.filament_id << " and base_id: " << preset.base_id; preset.config.apply(std::move(config)); Preset::normalize(preset.config); // Report configuration fields, which are misplaced into a wrong group. @@ -1306,9 +1309,10 @@ int PresetCollection::get_differed_values_to_update(Preset& preset, std::mapbase_id.empty()) preset->base_id = parent_preset->setting_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << preset->name << " filament_id: " << preset->filament_id << " base_id: " << preset->base_id; preset->save(&(parent_preset->config)); } } @@ -1657,6 +1662,7 @@ bool PresetCollection::load_user_preset(std::string name, std::mapbase_id = cloud_base_id; iter->filament_id = cloud_filament_id; //presets_loaded.emplace_back(*it->second); - BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(", update the user preset %1% from cloud, type %2%, setting_id %3%, base_id %4%, sync_info %5% inherits %6%") - % iter->name %Preset::get_type_string(m_type) %iter->setting_id %iter->base_id %iter->sync_info %iter->inherits(); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", update the user preset %1% from cloud, type %2%, setting_id %3%, base_id %4%, sync_info %5% inherits %6%, filament_id %7%") + % iter->name %Preset::get_type_string(m_type) %iter->setting_id %iter->base_id %iter->sync_info %iter->inherits() % iter->filament_id; } else { //create a new one @@ -1735,8 +1741,8 @@ bool PresetCollection::load_user_preset(std::string name, std::map PresetCollection::load_external_preset( preset.filament_id = parent->filament_id; } } + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << preset.name << " filament_id: " << preset.filament_id << " base_id: " << preset.base_id; if (from_project) { preset.is_project_embedded = true; } @@ -2140,6 +2147,7 @@ bool PresetCollection::clone_presets(std::vector const &presets, auto old_name = this->get_edited_preset().name; for (auto preset : new_presets) { preset.alias.clear(); + preset.base_id.clear(); auto it = this->find_preset_internal(preset.name); assert((it == m_presets.end() || it->name != preset.name) || force_rewritten); if (it == m_presets.end() || it->name != preset.name) { @@ -2180,8 +2188,10 @@ bool PresetCollection::create_presets_from_template_for_printer(std::vector(preset.config.option("compatible_printers")); compatible_printers->values = std::vector{printer}; preset.is_visible = true; - if (type == Preset::TYPE_FILAMENT) + if (type == Preset::TYPE_FILAMENT) { preset.filament_id = create_filament_id(prefix); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << preset.name << " create filament_id: " << preset.filament_id; + } }, force_rewritten); } @@ -2200,6 +2210,7 @@ bool PresetCollection::clone_presets_for_filament(Preset const *const & pres preset.config.apply_only(dynamic_config, {"filament_vendor", "compatible_printers", "filament_type"},true); preset.filament_id = filament_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << preset.name << " is cloned and filament_id: " << filament_id; } }, force_rewritten); @@ -2317,6 +2328,7 @@ void PresetCollection::save_current_preset(const std::string &new_name, bool det parent_preset = this->find_preset(final_inherits, false, true); if (parent_preset && this->get_selected_preset().base_id.empty()) { this->get_selected_preset().base_id = parent_preset->setting_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " base_id: " << parent_preset->setting_id; } } if (parent_preset) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 656775dca..5e92e762e 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -588,6 +588,7 @@ PresetsConfigSubstitutions PresetBundle::load_user_presets(AppConfig & std::map::iterator inherits_iter = value_map.find(BBL_JSON_KEY_INHERITS); if ((pass == 1) == (inherits_iter == value_map.end() || inherits_iter->second.empty())) continue; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " start load from cloud: " << name; //get the type first std::map::iterator type_iter = value_map.find(BBL_JSON_KEY_TYPE); if (type_iter == value_map.end()) { @@ -807,6 +808,7 @@ bool PresetBundle::import_json_presets(PresetsConfigSubstitutions & s preset.version = *version; inherit_preset = collection->find_preset(inherits_value, false, true); // pointer maybe wrong after insert, redo find if (inherit_preset) preset.base_id = inherit_preset->setting_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << preset.name << " have filament_id: " << preset.filament_id << " and base_id: " << preset.base_id; Preset::normalize(preset.config); // Report configuration fields, which are misplaced into a wrong group. const Preset &default_preset = collection->default_preset_for(new_config); @@ -3362,6 +3364,7 @@ std::pair PresetBundle::load_vendor_configs_ loaded.version = current_vendor_profile->config_version; loaded.setting_id = setting_id; loaded.filament_id = filament_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << loaded.name << " load filament_id: " << filament_id; if (presets_collection->type() == Preset::TYPE_FILAMENT) { if (filament_id.empty() && "Template" != vendor_name) { BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< ": can not find filament_id for " << preset_name; diff --git a/src/slic3r/GUI/CreatePresetsDialog.cpp b/src/slic3r/GUI/CreatePresetsDialog.cpp index b5ca93e07..d0d549aee 100644 --- a/src/slic3r/GUI/CreatePresetsDialog.cpp +++ b/src/slic3r/GUI/CreatePresetsDialog.cpp @@ -460,7 +460,7 @@ static std::string get_filament_id(std::string vendor_typr_serial) user_filament_id = "P" + calculate_md5(vendor_typr_serial + get_curr_time()).substr(0, 7); } } - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " filament name is: " << vendor_typr_serial << "and create filament id is: " << user_filament_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " filament name is: " << vendor_typr_serial << "and create filament_id is: " << user_filament_id; return user_filament_id; } @@ -864,7 +864,7 @@ wxBoxSizer *CreateFilamentPresetDialog::create_filament_preset_item() } } } else { - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " not find filament id corresponding to the type: and the type is" << filament_type; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " not find filament_id corresponding to the type: and the type is" << filament_type; } sort_printer_by_nozzle(printer_name_to_filament_preset); for (std::pair printer_to_preset : printer_name_to_filament_preset) @@ -1115,7 +1115,7 @@ wxArrayString CreateFilamentPresetDialog::get_filament_preset_choices() std::set preset_name_set; for (Preset* filament_preset : preset.second) { std::string preset_name = filament_preset->name; - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " filament id: " << filament_preset->filament_id << " preset name: " << filament_preset->name; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " filament_id: " << filament_preset->filament_id << " preset name: " << filament_preset->name; size_t index_at = preset_name.find("@"); if (std::string::npos != index_at) { std::string cur_preset_name = preset_name.substr(0, index_at - 1); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 0e6e86732..b15d641f2 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1025,6 +1025,9 @@ void GUI_App::post_init() // BOOST_LOG_TRIVIAL(info) << "Loading user presets..."; // scrn->SetText(_L("Loading user presets...")); if (m_agent) { start_sync_user_preset(); } + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: true"; + } else { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: false"; } bool switch_to_3d = false; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 76b4f74fa..22f9242af 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -3756,11 +3756,13 @@ void MainFrame::on_select_default_preset(SimpleEvent& evt) case wxID_YES: { wxGetApp().app_config->set_bool("sync_user_preset", true); wxGetApp().start_sync_user_preset(true); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: true"; break; } case wxID_NO: wxGetApp().app_config->set_bool("sync_user_preset", false); wxGetApp().stop_sync_user_preset(); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: false"; break; default: break; diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 320fd63c4..6e63f6f4a 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -663,6 +663,7 @@ wxBoxSizer *PreferencesDialog::create_item_checkbox(wxString title, wxWindow *pa } else { wxGetApp().stop_sync_user_preset(); } + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: " << (sync ? "true" : "false"); } #ifdef __WXMSW__