FIX: When the printer is inconsistent with the current preset

when the ams is 0/0, should not consider the print connect status
jira:none

Change-Id: I2288ff15894d5c734a98b830df6678cab2bd12fc
(cherry picked from commit 20837717d411016251c4831586b0fa61350a08b2)
This commit is contained in:
zhimin.zeng
2024-09-30 16:42:37 +08:00
committed by Noisyfox
parent b0329ac88d
commit 1658c6c54d
2 changed files with 23 additions and 3 deletions

View File

@@ -2808,6 +2808,7 @@ struct Plater::priv
return false;
#endif
}
std::vector<std::vector<DynamicPrintConfig>> get_extruder_filament_info();
void update_print_volume_state();
void schedule_background_process();
// Update background processing thread from the current config and Model.
@@ -5500,6 +5501,24 @@ void Plater::priv::schedule_background_process()
this->view3D->get_canvas3d()->set_config(this->config);
}
std::vector<std::vector<DynamicPrintConfig>> Plater::priv::get_extruder_filament_info()
{
std::vector<std::vector<DynamicPrintConfig>> filament_infos;
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev)
return filament_infos;
MachineObject *obj_ = dev->get_selected_machine();
if (obj_ == nullptr)
return filament_infos;
if (!obj_->is_multi_extruders())
return filament_infos;
filament_infos = wxGetApp().preset_bundle->get_extruder_filament_info();
return filament_infos;
}
void Plater::priv::update_print_volume_state()
{
//BBS: use the plate's bounding box instead of the bed's
@@ -5589,7 +5608,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
PartPlate* cur_plate = background_process.get_current_plate();
std::vector<int> f_maps = cur_plate->get_filament_maps();
invalidated = background_process.apply(this->model, wxGetApp().preset_bundle->full_config(false, f_maps));
background_process.fff_print()->set_extruder_filament_info(wxGetApp().preset_bundle->get_extruder_filament_info());
background_process.fff_print()->set_extruder_filament_info(get_extruder_filament_info());
}
else
invalidated = background_process.apply(this->model, wxGetApp().preset_bundle->full_config(false));