FIX: should not display sync dialog when open obj file
2. select machine with unchecked presets, cannot get the corresponding machine preset jira: 9070 9065 Change-Id: Ic971a17eef464bead4f247d769ab6be4facb68d1
This commit is contained in:
parent
4b083d8d82
commit
a297b57249
|
@ -4977,6 +4977,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (load_config) {
|
||||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||||
if (dev) {
|
if (dev) {
|
||||||
MachineObject *obj = dev->get_selected_machine();
|
MachineObject *obj = dev->get_selected_machine();
|
||||||
|
@ -4987,20 +4988,20 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
|
|
||||||
double preset_nozzle_diameter = 0.4;
|
double preset_nozzle_diameter = 0.4;
|
||||||
const ConfigOption *opt = printer_preset.config.option("nozzle_diameter");
|
const ConfigOption *opt = printer_preset.config.option("nozzle_diameter");
|
||||||
if (opt)
|
if (opt) preset_nozzle_diameter = static_cast<const ConfigOptionFloatsNullable *>(opt)->values[0];
|
||||||
preset_nozzle_diameter = static_cast<const ConfigOptionFloatsNullable *>(opt)->values[0];
|
|
||||||
float machine_nozzle_diameter = obj->m_extder_data.extders[0].current_nozzle_diameter;
|
float machine_nozzle_diameter = obj->m_extder_data.extders[0].current_nozzle_diameter;
|
||||||
|
|
||||||
std::string machine_type = obj->printer_type;
|
std::string machine_type = obj->printer_type;
|
||||||
if (obj->is_support_upgrade_kit && obj->installed_upgrade_kit)
|
if (obj->is_support_upgrade_kit && obj->installed_upgrade_kit) machine_type = "C12";
|
||||||
machine_type = "C12";
|
|
||||||
|
|
||||||
if (printer_preset.get_current_printer_type(preset_bundle) != machine_type || !is_approx((float) preset_nozzle_diameter, machine_nozzle_diameter)) {
|
if (printer_preset.get_current_printer_type(preset_bundle) != machine_type || !is_approx((float) preset_nozzle_diameter, machine_nozzle_diameter)) {
|
||||||
Preset *machine_preset = get_printer_preset(obj);
|
Preset *machine_preset = get_printer_preset(obj);
|
||||||
if (machine_preset != nullptr) {
|
if (machine_preset != nullptr) {
|
||||||
bool sync_printer_info = false;
|
bool sync_printer_info = false;
|
||||||
if (!wxGetApp().app_config->has("sync_after_load_file_show_flag")) {
|
if (!wxGetApp().app_config->has("sync_after_load_file_show_flag")) {
|
||||||
wxString tips = from_u8((boost::format(L("The printer you are currently bound to is %s,\nThe printer preset for your current file is %s,\n")) %machine_preset->name % printer_preset.name).str());
|
wxString tips = from_u8((boost::format(L("The printer you are currently bound to is %s,\nThe printer preset for your current file is %s,\n")) %
|
||||||
|
machine_preset->name % printer_preset.name)
|
||||||
|
.str());
|
||||||
if (obj->is_multi_extruders())
|
if (obj->is_multi_extruders())
|
||||||
tips += L("Do you want to sync printer presets, ams and nozzle information immediately?");
|
tips += L("Do you want to sync printer presets, ams and nozzle information immediately?");
|
||||||
else
|
else
|
||||||
|
@ -5023,6 +5024,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (new_model) delete new_model;
|
if (new_model) delete new_model;
|
||||||
|
|
||||||
|
|
|
@ -416,6 +416,8 @@ void PresetComboBox::add_connected_printers(std::string selected, bool alias_nam
|
||||||
set_label_marker(Append(separator(L("My Printer")), wxNullBitmap));
|
set_label_marker(Append(separator(L("My Printer")), wxNullBitmap));
|
||||||
m_first_printer_idx = GetCount();
|
m_first_printer_idx = GetCount();
|
||||||
for (auto iter = machine_list.begin(); iter != machine_list.end(); ++iter) {
|
for (auto iter = machine_list.begin(); iter != machine_list.end(); ++iter) {
|
||||||
|
Preset* printer_preset = get_printer_preset(iter->second);
|
||||||
|
printer_preset->is_visible = true;
|
||||||
int item_id = Append(from_u8(iter->second->dev_name), wxNullBitmap, &m_first_printer_idx + std::distance(machine_list.begin(), iter));
|
int item_id = Append(from_u8(iter->second->dev_name), wxNullBitmap, &m_first_printer_idx + std::distance(machine_list.begin(), iter));
|
||||||
}
|
}
|
||||||
m_last_printer_idx = GetCount();
|
m_last_printer_idx = GetCount();
|
||||||
|
|
Loading…
Reference in New Issue