FIX:plate number corresponds to plate number in 3D

jira: none
Change-Id: I632e3e3330bddcc7744de8ebc69900feb57e1b41
This commit is contained in:
zhou.xu 2025-01-06 16:38:30 +08:00 committed by lane.wei
parent 6b90e5b877
commit 5d30cb5883
2 changed files with 14 additions and 6 deletions

View File

@ -385,11 +385,12 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
wxArrayString choices;
for (size_t i = 0; i < plate_list.get_plate_count(); i++) {
auto temp_plate = GUI::wxGetApp().plater()->get_partplate_list().get_plate(i);
if (!temp_plate->get_objects().empty()) {
if (!temp_plate->get_objects_on_this_plate().empty()) {
if (m_is_empty_project) {
m_is_empty_project = false;
}
choices.Add(std::to_wstring(i));
choices.Add(i < 10 ? ("0"+std::to_wstring(i + 1)) : std::to_wstring(i));
m_plate_choices.emplace_back(i);
}
}
if (m_is_empty_project == false) {
@ -406,11 +407,17 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
for (size_t i = 0; i < choices.size(); i++) {
cur_combox->Append(choices[i]);
}
cur_combox->SetSelection(m_specify_plate_idx);
auto iter = std::find(m_plate_choices.begin(), m_plate_choices.end(), m_specify_plate_idx);
if (iter != m_plate_choices.end()) {
auto index = iter - m_plate_choices.begin();
cur_combox->SetSelection(index);
}
cur_combox->Bind(wxEVT_COMBOBOX, [this](auto &e) {
update_when_change_plate(e.GetSelection());
Layout();
Fit();
if (e.GetSelection() < m_plate_choices.size()) {
update_when_change_plate(m_plate_choices[e.GetSelection()]);
Layout();
Fit();
}
});
m_plate_combox_sizer->Add(cur_combox, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxEXPAND | wxBOTTOM, FromDIP(5));

View File

@ -282,6 +282,7 @@ private:
wxCheckBox* m_merge_color_checkbox = nullptr;
bool m_is_empty_project = true;
std::vector<int> m_plate_choices;
const int THUMBNAIL_SIZE_WIDTH = 200;
int m_specify_plate_idx{-1};
wxString m_printer_name;