FIX:plate number corresponds to plate number in 3D
jira: none Change-Id: I632e3e3330bddcc7744de8ebc69900feb57e1b41
This commit is contained in:
parent
6b90e5b877
commit
5d30cb5883
|
@ -385,11 +385,12 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
|
||||||
wxArrayString choices;
|
wxArrayString choices;
|
||||||
for (size_t i = 0; i < plate_list.get_plate_count(); i++) {
|
for (size_t i = 0; i < plate_list.get_plate_count(); i++) {
|
||||||
auto temp_plate = GUI::wxGetApp().plater()->get_partplate_list().get_plate(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) {
|
if (m_is_empty_project) {
|
||||||
m_is_empty_project = false;
|
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) {
|
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++) {
|
for (size_t i = 0; i < choices.size(); i++) {
|
||||||
cur_combox->Append(choices[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) {
|
cur_combox->Bind(wxEVT_COMBOBOX, [this](auto &e) {
|
||||||
update_when_change_plate(e.GetSelection());
|
if (e.GetSelection() < m_plate_choices.size()) {
|
||||||
Layout();
|
update_when_change_plate(m_plate_choices[e.GetSelection()]);
|
||||||
Fit();
|
Layout();
|
||||||
|
Fit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
m_plate_combox_sizer->Add(cur_combox, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxEXPAND | wxBOTTOM, FromDIP(5));
|
m_plate_combox_sizer->Add(cur_combox, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||||
|
|
||||||
|
|
|
@ -282,6 +282,7 @@ private:
|
||||||
wxCheckBox* m_merge_color_checkbox = nullptr;
|
wxCheckBox* m_merge_color_checkbox = nullptr;
|
||||||
bool m_is_empty_project = true;
|
bool m_is_empty_project = true;
|
||||||
|
|
||||||
|
std::vector<int> m_plate_choices;
|
||||||
const int THUMBNAIL_SIZE_WIDTH = 200;
|
const int THUMBNAIL_SIZE_WIDTH = 200;
|
||||||
int m_specify_plate_idx{-1};
|
int m_specify_plate_idx{-1};
|
||||||
wxString m_printer_name;
|
wxString m_printer_name;
|
||||||
|
|
Loading…
Reference in New Issue