mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-21 12:15:21 +00:00
ENH:add log
jira: STUDIO-10445 Change-Id: If1c2b41b0f93a2f1f8bde4b3aa543a9ddeaccc08 (cherry picked from commit 4166a156ea2530d3ba348c579d188c9231fb81d9)
This commit is contained in:
@@ -2037,11 +2037,12 @@ void PresetBundle::get_ams_cobox_infos(AMSComboInfo& combox_info)
|
|||||||
|
|
||||||
unsigned int PresetBundle::sync_ams_list(unsigned int &unknowns, bool use_map, std::map<int, AMSMapInfo> &maps,bool enable_append, MergeFilamentInfo &merge_info)
|
unsigned int PresetBundle::sync_ams_list(unsigned int &unknowns, bool use_map, std::map<int, AMSMapInfo> &maps,bool enable_append, MergeFilamentInfo &merge_info)
|
||||||
{
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "use_map:" << use_map << " enable_append:" << enable_append;
|
||||||
std::vector<std::string> ams_filament_presets;
|
std::vector<std::string> ams_filament_presets;
|
||||||
std::vector<std::string> ams_filament_colors;
|
std::vector<std::string> ams_filament_colors;
|
||||||
std::vector<AMSMapInfo> ams_array_maps;
|
std::vector<AMSMapInfo> ams_array_maps;
|
||||||
ams_multi_color_filment.clear();
|
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
|
struct AmsInfo
|
||||||
{
|
{
|
||||||
bool valid{false};
|
bool valid{false};
|
||||||
@@ -2090,7 +2091,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) {
|
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; });
|
return f.is_compatible && filaments.get_preset_base(f) == &f && f.filament_id == filament_id; });
|
||||||
if (iter == filaments.end()) {
|
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);
|
auto filament_type = ams.opt_string("filament_type", 0u);
|
||||||
if (!filament_type.empty()) {
|
if (!filament_type.empty()) {
|
||||||
filament_type = "Generic " + filament_type;
|
filament_type = "Generic " + filament_type;
|
||||||
|
|||||||
@@ -1140,16 +1140,19 @@ bool Sidebar::priv::sync_extruder_list(bool &only_external_material)
|
|||||||
return false;
|
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;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string machine_print_name = obj->printer_type;
|
std::string machine_print_name = obj->printer_type;
|
||||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||||
std::string target_model_id = preset_bundle->printers.get_selected_preset().get_printer_type(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);
|
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;
|
return false;
|
||||||
|
}
|
||||||
if (machine_print_name != target_model_id) {
|
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"
|
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);
|
"Are you sure to continue syncing?"), _L("Sync printer information"), wxICON_WARNING | wxYES | wxNO);
|
||||||
|
|||||||
Reference in New Issue
Block a user