mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-15 08:23:00 +00:00
FIX:The plate type in dialog of the plate settings does not match the machine
jira: STUDIO-12181 Change-Id: I1d055e3530f19946073c30647c12fbab2be97d50 (cherry picked from commit 54b6cc3c41319ddfc0e3d78f41b903508f0f4c15)
This commit is contained in:
@@ -383,10 +383,26 @@ PlateSettingsDialog::PlateSettingsDialog(wxWindow* parent, const wxString& title
|
||||
top_sizer->Add(plate_name_txt, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
top_sizer->Add(m_ti_plate_name, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
|
||||
m_bed_type_choice = new ComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(240), -1), 0,
|
||||
NULL, wxCB_READONLY);
|
||||
for (BedType i = btDefault; i < btCount; i = BedType(int(i) + 1)) {
|
||||
m_bed_type_choice->Append(to_bed_type_name(i));
|
||||
m_bed_type_choice = new ComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(240),-1), 0, NULL, wxCB_READONLY );
|
||||
auto pm = wxGetApp().plater()->get_curr_printer_model();
|
||||
if (pm) {
|
||||
m_cur_combox_bed_types.clear();
|
||||
m_bed_type_choice->AppendString(_L("Same as Global Plate Type"));
|
||||
const ConfigOptionDef *bed_type_def = print_config_def.get("curr_bed_type");
|
||||
int index = 0;
|
||||
for (auto item : bed_type_def->enum_labels) {
|
||||
index++;
|
||||
bool find = std::find(pm->not_support_bed_types.begin(), pm->not_support_bed_types.end(), item) != pm->not_support_bed_types.end();
|
||||
if (!find) {
|
||||
m_bed_type_choice->AppendString(_L(item));
|
||||
m_cur_combox_bed_types.emplace_back(BedType(index));
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
for (BedType i = btDefault; i < btCount; i = BedType(int(i) + 1)) {
|
||||
m_bed_type_choice->Append(to_bed_type_name(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (!wxGetApp().preset_bundle->is_bbl_vendor())
|
||||
@@ -510,7 +526,13 @@ PlateSettingsDialog::~PlateSettingsDialog()
|
||||
void PlateSettingsDialog::sync_bed_type(BedType type)
|
||||
{
|
||||
if (m_bed_type_choice != nullptr) {
|
||||
m_bed_type_choice->SetSelection(int(type));
|
||||
for (int i = 0; i < m_cur_combox_bed_types.size(); i++) {
|
||||
if (m_cur_combox_bed_types[i] == type) {
|
||||
m_bed_type_choice->SetSelection(i + 1);//+1 because same as global
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_bed_type_choice->SetSelection(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,6 +623,17 @@ wxString PlateSettingsDialog::get_plate_name() const {
|
||||
|
||||
void PlateSettingsDialog::set_plate_name(const wxString &name) { m_ti_plate_name->GetTextCtrl()->SetValue(name); }
|
||||
|
||||
BedType PlateSettingsDialog::get_bed_type_choice()
|
||||
{
|
||||
if (m_bed_type_choice != nullptr) {
|
||||
int choice = m_bed_type_choice->GetSelection();
|
||||
if (choice > 0) {
|
||||
return m_cur_combox_bed_types[choice - 1];//-1 because same as globlal
|
||||
}
|
||||
}
|
||||
return BedType::btDefault;
|
||||
};
|
||||
|
||||
std::vector<int> PlateSettingsDialog::get_first_layer_print_seq()
|
||||
{
|
||||
return m_drag_canvas->get_shape_list_order();
|
||||
|
||||
Reference in New Issue
Block a user