mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
FIX:fixed failure to open AMS mapping window
jira:[STUDIO-4669] Change-Id: Ia9c9ca0b8833903443c173b97e61ba4e88e5d2bb
This commit is contained in:
parent
1ed54b1d5d
commit
01f13afa56
1 changed files with 14 additions and 11 deletions
|
@ -3654,10 +3654,6 @@ void SelectMachineDialog::set_default_normal()
|
||||||
m_materialList.clear();
|
m_materialList.clear();
|
||||||
m_filaments.clear();
|
m_filaments.clear();
|
||||||
|
|
||||||
DeviceManager* dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
|
|
||||||
if (!dev_manager) return;
|
|
||||||
MachineObject* obj_ = dev_manager->get_selected_machine();
|
|
||||||
|
|
||||||
for (auto i = 0; i < extruders.size(); i++) {
|
for (auto i = 0; i < extruders.size(); i++) {
|
||||||
auto extruder = extruders[i] - 1;
|
auto extruder = extruders[i] - 1;
|
||||||
auto colour = wxGetApp().preset_bundle->project_config.opt_string("filament_colour", (unsigned int) extruder);
|
auto colour = wxGetApp().preset_bundle->project_config.opt_string("filament_colour", (unsigned int) extruder);
|
||||||
|
@ -3672,7 +3668,12 @@ void SelectMachineDialog::set_default_normal()
|
||||||
m_sizer_material->Add(item, 0, wxALL, FromDIP(4));
|
m_sizer_material->Add(item, 0, wxALL, FromDIP(4));
|
||||||
|
|
||||||
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent& e) {});
|
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent& e) {});
|
||||||
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder, obj_](wxMouseEvent& e) {
|
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent& e) {
|
||||||
|
|
||||||
|
DeviceManager* dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||||
|
if (!dev_manager) return;
|
||||||
|
MachineObject* curr_obj = dev_manager->get_selected_machine();
|
||||||
|
|
||||||
MaterialHash::iterator iter = m_materialList.begin();
|
MaterialHash::iterator iter = m_materialList.begin();
|
||||||
while (iter != m_materialList.end()) {
|
while (iter != m_materialList.end()) {
|
||||||
int id = iter->first;
|
int id = iter->first;
|
||||||
|
@ -3690,25 +3691,24 @@ void SelectMachineDialog::set_default_normal()
|
||||||
wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
|
wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
|
||||||
// update ams data
|
// update ams data
|
||||||
|
|
||||||
if (obj_ && obj_->is_support_ams_mapping()) {
|
if (curr_obj && curr_obj->is_support_ams_mapping()) {
|
||||||
if (m_mapping_popup.IsShown()) return;
|
if (m_mapping_popup.IsShown()) return;
|
||||||
wxPoint pos = item->ClientToScreen(wxPoint(0, 0));
|
wxPoint pos = item->ClientToScreen(wxPoint(0, 0));
|
||||||
pos.y += item->GetRect().height;
|
pos.y += item->GetRect().height;
|
||||||
m_mapping_popup.Move(pos);
|
m_mapping_popup.Move(pos);
|
||||||
|
|
||||||
if (obj_ &&
|
if (curr_obj->has_ams() &&
|
||||||
obj_->has_ams() &&
|
|
||||||
m_checkbox_list["use_ams"]->GetValue() &&
|
m_checkbox_list["use_ams"]->GetValue() &&
|
||||||
obj_->dev_id == m_printer_last_select)
|
curr_obj->dev_id == m_printer_last_select)
|
||||||
{
|
{
|
||||||
m_mapping_popup.set_parent_item(item);
|
m_mapping_popup.set_parent_item(item);
|
||||||
m_mapping_popup.set_current_filament_id(extruder);
|
m_mapping_popup.set_current_filament_id(extruder);
|
||||||
m_mapping_popup.set_tag_texture(materials[extruder]);
|
m_mapping_popup.set_tag_texture(materials[extruder]);
|
||||||
m_mapping_popup.update_ams_data(obj_->amsList);
|
m_mapping_popup.update_ams_data(curr_obj->amsList);
|
||||||
m_mapping_popup.Popup();
|
m_mapping_popup.Popup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Material* material_item = new Material();
|
Material* material_item = new Material();
|
||||||
material_item->id = extruder;
|
material_item->id = extruder;
|
||||||
|
@ -3741,6 +3741,9 @@ void SelectMachineDialog::set_default_normal()
|
||||||
m_scrollable_view->SetMaxSize(m_scrollable_region->GetSize());
|
m_scrollable_view->SetMaxSize(m_scrollable_region->GetSize());
|
||||||
|
|
||||||
//disable pei bed
|
//disable pei bed
|
||||||
|
DeviceManager* dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||||
|
if (!dev_manager) return;
|
||||||
|
MachineObject* obj_ = dev_manager->get_selected_machine();
|
||||||
update_flow_cali_check(obj_);
|
update_flow_cali_check(obj_);
|
||||||
|
|
||||||
wxSize screenSize = wxGetDisplaySize();
|
wxSize screenSize = wxGetDisplaySize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue