From 48e5d3d3c130e2b0cab9b3781503dfe8a072b04b Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 25 Oct 2022 00:51:42 +0800 Subject: [PATCH] hide bed type for 3rd party printer --- src/slic3r/GUI/Plater.cpp | 4 ++++ src/slic3r/GUI/Tab.cpp | 16 ++++++++++++++++ src/slic3r/GUI/Widgets/ComboBox.cpp | 6 ++++++ src/slic3r/GUI/Widgets/ComboBox.hpp | 2 ++ 4 files changed, 28 insertions(+) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 10e31bf8fe..78e22ac8fa 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -921,12 +921,16 @@ void Sidebar::update_all_preset_comboboxes() ams_btn->Show(); //update print button default value for bbl or third-party printer p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate); + m_bed_type_list->Enable(); + } else { connection_btn->Show(); ams_btn->Hide(); p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::eSendGcode); p_mainframe->load_printer_url(wxString::Format("http://%s",preset_bundle.printers.get_edited_preset().config.opt_string("print_host"))); + m_bed_type_list->SelectAndNotify(btPEI); + m_bed_type_list->Disable(); } // Update the print choosers to only contain the compatible presets, update the dirty flags. diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5136fb9865..11e5fd5858 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2656,6 +2656,12 @@ void TabFilament::toggle_options() { if (!m_active_page) return; + bool is_BBL_printer = false; + if (m_preset_bundle) { + is_BBL_printer = + m_preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset( + m_preset_bundle); + } if (m_active_page->title() == "Cooling") { @@ -2670,6 +2676,10 @@ void TabFilament::toggle_options() { bool pa = m_config->opt_bool("enable_pressure_advance"); toggle_option("pressure_advance", pa); + + toggle_line("cool_plate_temp_initial_layer", is_BBL_printer); + toggle_line("eng_plate_temp_initial_layer", is_BBL_printer); + toggle_line("textured_plate_temp_initial_layer", is_BBL_printer); } if (m_active_page->title() == "Setting Overrides") update_filament_overrides_page(); @@ -3440,6 +3450,12 @@ void TabPrinter::toggle_options() //BBS: extruder clearance of BBL printer can't be edited. for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" }) toggle_option(el, !is_BBL_printer); + + // SoftFever: hide BBL specific settings + for (auto el : + {"scan_first_layer", "machine_load_filament_time", + "machine_unload_filament_time", "nozzle_type", "bed_exclude_area"}) + toggle_line(el, is_BBL_printer); } wxString extruder_number; diff --git a/src/slic3r/GUI/Widgets/ComboBox.cpp b/src/slic3r/GUI/Widgets/ComboBox.cpp index 01d7d9614c..71b74ac1a4 100644 --- a/src/slic3r/GUI/Widgets/ComboBox.cpp +++ b/src/slic3r/GUI/Widgets/ComboBox.cpp @@ -73,6 +73,12 @@ void ComboBox::SetSelection(int n) SetIcon(icons[drop.selection]); } +void ComboBox::SelectAndNotify(int n) { + SetSelection(n); + sendComboBoxEvent(); +} + + void ComboBox::Rescale() { TextInput::Rescale(); diff --git a/src/slic3r/GUI/Widgets/ComboBox.hpp b/src/slic3r/GUI/Widgets/ComboBox.hpp index 0a8e018dce..7e9a92114a 100644 --- a/src/slic3r/GUI/Widgets/ComboBox.hpp +++ b/src/slic3r/GUI/Widgets/ComboBox.hpp @@ -43,6 +43,8 @@ public: void SetSelection(int n) override; + void SelectAndNotify(int n); + virtual void Rescale() override; wxString GetValue() const;