diff --git a/src/slic3r/GUI/AMSSetting.cpp b/src/slic3r/GUI/AMSSetting.cpp index 0818f5445e..cad793ea4d 100644 --- a/src/slic3r/GUI/AMSSetting.cpp +++ b/src/slic3r/GUI/AMSSetting.cpp @@ -192,8 +192,8 @@ void AMSSetting::create() wxPanel* m_panel_img = new wxPanel(m_panel_body, wxID_ANY, wxDefaultPosition, wxDefaultSize); m_panel_img->SetBackgroundColour(AMS_SETTING_GREY200); wxBoxSizer *m_sizer_img = new wxBoxSizer(wxVERTICAL); - auto img = new wxStaticBitmap(m_panel_img, wxID_ANY, create_scaled_bitmap("ams_icon", nullptr, 126), wxDefaultPosition, wxDefaultSize); - m_sizer_img->Add(img, 0, wxALIGN_CENTER | wxTOP, 26); + ams_img = new wxStaticBitmap(m_panel_img, wxID_ANY, create_scaled_bitmap("ams_icon", nullptr, 126), wxDefaultPosition, wxDefaultSize); + m_sizer_img->Add(ams_img, 0, wxALIGN_CENTER | wxTOP, 26); m_sizer_img->Add(0, 0, 0, wxTOP, 18); m_panel_img->SetSizer(m_sizer_img); m_panel_img->Layout(); @@ -262,6 +262,19 @@ void AMSSetting::update_insert_material_read_mode(bool selected) Fit(); } +void AMSSetting::update_image(std::string ams_type) +{ + if (ams_type == m_current_ams_type) return; + if (ams_type == "generic") { + ams_img->SetBitmap(create_scaled_bitmap("monitor_upgrade_f1", nullptr, 126)); + } + else { + ams_img->SetBitmap(create_scaled_bitmap("ams_icon", nullptr, 126)); + } + m_current_ams_type = ams_type; + Layout(); +} + void AMSSetting::update_starting_read_mode(bool selected) { m_checkbox_starting_auto_read->SetValue(selected); diff --git a/src/slic3r/GUI/AMSSetting.hpp b/src/slic3r/GUI/AMSSetting.hpp index 0b227de29a..6afaea68e5 100644 --- a/src/slic3r/GUI/AMSSetting.hpp +++ b/src/slic3r/GUI/AMSSetting.hpp @@ -28,6 +28,7 @@ public: void create(); void update_insert_material_read_mode(bool selected); + void update_image(std::string ams_type); void update_starting_read_mode(bool selected); void update_remain_mode(bool selected); void update_switch_filament(bool selected); @@ -46,6 +47,7 @@ protected: void on_dpi_changed(const wxRect &suggested_rect) override; protected: + std::string m_current_ams_type; wxPanel * m_panel_body; CheckBox * m_checkbox_Insert_material_auto_read; wxStaticText *m_title_Insert_material_auto_read; @@ -68,7 +70,7 @@ protected: wxStaticText *m_tip_ams_img; Button * m_button_auto_demarcate; - + wxStaticBitmap* ams_img; wxBoxSizer *m_sizer_Insert_material_tip_inline; wxBoxSizer *m_sizer_starting_tip_inline; wxBoxSizer *m_sizer_remain_inline; diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index c1e696d826..4c997045af 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1551,6 +1551,7 @@ void MachineObject::parse_version_func() is_support_tunnel_mqtt = true; is_support_ams_humidity = false; is_support_1080dpi = true; + ams_support_remain = false; } } diff --git a/src/slic3r/GUI/Project.cpp b/src/slic3r/GUI/Project.cpp index 081831c980..1d6e535bd7 100644 --- a/src/slic3r/GUI/Project.cpp +++ b/src/slic3r/GUI/Project.cpp @@ -310,6 +310,9 @@ std::map> ProjectPanel::Reload(wxString aux_path) pfile_obj["filename"] = wxGetApp().url_encode(file_path_obj.filename().string().c_str()); pfile_obj["size"] = formatBytes((unsigned long)filelen); + std::string file_extension = file_path_obj.extension().string(); + boost::algorithm::to_lower(file_extension); + //image if (file_extension == ".jpg" || file_extension == ".jpeg" || diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 35b84ffe15..9bf8d91607 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1543,10 +1543,10 @@ wxWindow *SelectMachineDialog::create_ams_checkbox(wxString title, wxWindow *par sizer_checkbox->Add(text, 0, wxALIGN_CENTER, 0); enable_ams = new ScalableBitmap(this, "enable_ams", 16); - auto img_ams_tip = new wxStaticBitmap(checkbox, wxID_ANY, enable_ams->bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0); + img_ams_tip = new wxStaticBitmap(checkbox, wxID_ANY, enable_ams->bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0); sizer_checkbox->Add(img_ams_tip, 0, wxALIGN_CENTER | wxLEFT, FromDIP(5)); - img_ams_tip->Bind(wxEVT_ENTER_WINDOW, [this, img_ams_tip](auto& e) { + img_ams_tip->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) { wxPoint img_pos = img_ams_tip->ClientToScreen(wxPoint(0, 0)); wxPoint popup_pos(img_pos.x, img_pos.y + img_ams_tip->GetRect().height); m_mapping_tip_popup.Position(popup_pos, wxSize(0, 0)); @@ -1563,7 +1563,6 @@ wxWindow *SelectMachineDialog::create_ams_checkbox(wxString title, wxWindow *par img_ams_tip->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& e) { m_mapping_tip_popup.Dismiss(); }); - ams_tip = img_ams_tip; checkbox->SetSizer(sizer_checkbox); checkbox->Layout(); @@ -1683,7 +1682,7 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj) Fit(); } -void SelectMachineDialog::prepare_mode() +void SelectMachineDialog::prepare_mode(bool refresh_button) { // disable combobox m_comboBox_printer->Enable(); @@ -1698,7 +1697,9 @@ void SelectMachineDialog::prepare_mode() if (wxIsBusy()) wxEndBusyCursor(); - Enable_Send_Button(true); + if (refresh_button) { + Enable_Send_Button(true); + } m_status_bar->reset(); if (m_simplebook->GetSelection() != 0) { @@ -2016,12 +2017,6 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vectorEnable(); - // m_panel_warn m_simplebook - if (status == PrintDialogStatus::PrintStatusSending) { - sending_mode(); - } else { - prepare_mode(); - } // other if (status == PrintDialogStatus::PrintStatusInit) { @@ -2164,6 +2159,14 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vectoramsList.empty() || obj_->ams_exist_bits == 0 - || !obj_->m_is_support_show_bak || !obj_->ams_support_auto_switch_filament_flag || !obj_->ams_auto_switch_filament_flag || !obj_->is_function_supported(PrinterFunction::FUNC_FILAMENT_BACKUP) @@ -3036,6 +3038,8 @@ void SelectMachineDialog::update_ams_check(MachineObject* obj) && obj->ams_support_use_ams && obj->has_ams()) { select_use_ams->Show(); + if (obj->printer_type == "N1") {img_ams_tip->Hide();} + else {img_ams_tip->Show();} } else { select_use_ams->Hide(); } @@ -3350,7 +3354,7 @@ void SelectMachineDialog::on_dpi_changed(const wxRect &suggested_rect) enable_ams_mapping->msw_rescale(); amsmapping_tip->SetBitmap(enable_ams_mapping->bmp()); enable_ams->msw_rescale(); - ams_tip->SetBitmap(enable_ams->bmp()); + img_ams_tip->SetBitmap(enable_ams->bmp()); m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE); m_button_refresh->SetCornerRadius(FromDIP(12)); diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 2d54ad3617..34c1dfa5fc 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -385,7 +385,7 @@ protected: ScalableBitmap * print_weight{nullptr}; wxStaticBitmap * amsmapping_tip{nullptr}; ScalableBitmap * enable_ams_mapping{nullptr}; - wxStaticBitmap * ams_tip{nullptr}; + wxStaticBitmap * img_ams_tip{nullptr}; wxStaticBitmap * img_ams_backup{nullptr}; ScalableBitmap * enable_ams{nullptr}; @@ -400,7 +400,7 @@ public: void check_fcous_state(wxWindow* window); void popup_filament_backup(); void update_select_layout(MachineObject *obj); - void prepare_mode(); + void prepare_mode(bool refresh_button = true); void sending_mode(); void finish_mode(); void sync_ams_mapping_result(std::vector& result); diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 972c02a87f..5642bd30d8 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -2383,7 +2383,7 @@ void StatusPanel::update_ams(MachineObject *obj) show_ams_group(true); - if (!obj->m_is_support_show_bak || !is_support_filament_backup || !obj->ams_support_auto_switch_filament_flag) { + if (!is_support_filament_backup || !obj->ams_support_auto_switch_filament_flag) { m_ams_control->show_auto_refill(false); } else { @@ -3240,6 +3240,7 @@ void StatusPanel::on_ams_setting_click(SimpleEvent &event) if (obj) { m_ams_setting_dlg->update_insert_material_read_mode(obj->ams_insert_flag); m_ams_setting_dlg->update_starting_read_mode(obj->ams_power_on_flag); + m_ams_setting_dlg->update_image(obj->printer_type == "N1"?"generic":"f1"); std::string ams_id = m_ams_control->GetCurentShowAms(); if (obj->amsList.size() == 0) { /* wxString txt = _L("AMS settings are not supported for external spool"); diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index 330ae6e972..11833236d6 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -2832,13 +2832,10 @@ void AMSControl::EnterNoneAMSMode(bool support_vt_load) m_extruder->no_ams_mode(true); m_button_ams_setting->Hide(); m_button_guide->Hide(); - if (support_vt_load) { - m_button_extruder_feed->Show(); - m_button_extruder_back->Show(); - } else { - m_button_extruder_feed->Hide(); - m_button_extruder_back->Hide(); - } + + m_button_extruder_feed->Show(); + m_button_extruder_back->Show(); + ShowFilamentTip(false); m_amswin->Layout();