mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	ENH:Optimize the layout of AMScontrol
Change-Id: Id74c0f14cf17b5d0cbc1077bb3609d7b1c8c6c2b Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
		
							parent
							
								
									5cc08e3398
								
							
						
					
					
						commit
						739915e6f6
					
				
					 6 changed files with 106 additions and 96 deletions
				
			
		|  | @ -429,6 +429,12 @@ void MachineObject::_parse_print_option_ack(int option) | |||
| 
 | ||||
| bool MachineObject::is_in_extrusion_cali() | ||||
| { | ||||
|     auto curr_time = std::chrono::system_clock::now(); | ||||
|     auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_extrusion_cali_start_time); | ||||
|     if (diff.count() > EXTRUSION_OMIT_TIME) { | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     if (is_in_printing_status(print_status) | ||||
|         && print_type == "system" | ||||
|         && boost::contains(m_gcode_file, "extrusion_cali") | ||||
|  | @ -441,8 +447,9 @@ bool MachineObject::is_in_extrusion_cali() | |||
| 
 | ||||
| bool MachineObject::is_extrusion_cali_finished() | ||||
| { | ||||
|     if (extrusion_cali_hold_count > 0) { | ||||
|         extrusion_cali_hold_count--; | ||||
|     auto curr_time = std::chrono::system_clock::now(); | ||||
|     auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_extrusion_cali_start_time); | ||||
|     if (diff.count() > EXTRUSION_OMIT_TIME) { | ||||
|         return false; | ||||
|     } | ||||
|      | ||||
|  | @ -1502,7 +1509,7 @@ int MachineObject::command_ams_switch(int tray_index, int old_temp, int new_temp | |||
|         // unload gcode
 | ||||
|         gcode = "M620 S255\nM104 S250\nG28 X\nG91\nG1 Z3.0 F1200\nG90\n" | ||||
|                 "G1 X70 F12000\nG1 Y245\nG1 Y265 F3000\nM109 S250\nG1 X120 F12000\n" | ||||
|                 "G1 X20 Y50 F12000\nG1 Y-3\nT255\nM104 S25\nG1 X165 F5000\nG1 Y245\n" | ||||
|                 "G1 X20 Y50 F12000\nG1 Y-3\nT255\nM104 S0\nG1 X165 F5000\nG1 Y245\n" | ||||
|                 "G91\nG1 Z-3.0 F1200\nG90\nM621 S255\n"; | ||||
|     } else { | ||||
|         // load gcode
 | ||||
|  | @ -1671,8 +1678,8 @@ int MachineObject::command_start_extrusion_cali(int tray_index, int nozzle_temp, | |||
|     j["print"]["bed_temp"] = bed_temp; | ||||
|     j["print"]["max_volumetric_speed"] = max_volumetric_speed; | ||||
| 
 | ||||
|     extrusion_cali_hold_count = HOLD_COUNT_MAX; | ||||
|     this->mc_print_percent = 0; | ||||
|     // enter extusion cali
 | ||||
|     last_extrusion_cali_start_time = std::chrono::system_clock::now(); | ||||
|     return this->publish_json(j.dump()); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -20,6 +20,7 @@ | |||
| #define TIMEOUT_FOR_STRAT       20000.f     // milliseconds
 | ||||
| #define REQUEST_PUSH_MIN_TIME   15000.f     // milliseconds
 | ||||
| #define REQUEST_START_MIN_TIME  15000.f     // milliseconds
 | ||||
| #define EXTRUSION_OMIT_TIME      5000.f     // milliseconds
 | ||||
| 
 | ||||
| #define FILAMENT_MAX_TEMP       300 | ||||
| #define FILAMENT_DEF_TEMP       220 | ||||
|  | @ -456,6 +457,7 @@ public: | |||
|     std::string m_tray_tar;         // tray_tar : "0" ~ "15" or "255"
 | ||||
| 
 | ||||
|     int extrusion_cali_hold_count = 0; | ||||
|     std::chrono::system_clock::time_point last_extrusion_cali_start_time; | ||||
| 
 | ||||
|     bool is_in_extrusion_cali(); | ||||
|     bool is_extrusion_cali_finished(); | ||||
|  |  | |||
|  | @ -207,7 +207,7 @@ void ExtrusionCalibration::create() | |||
| 
 | ||||
|     // save result title and tips
 | ||||
|     wxBoxSizer* save_result_sizer = new wxBoxSizer(wxHORIZONTAL); | ||||
|     wxString fill_intro_text = _L("Calibration completed. Please select the factors according to the left figure and fill them in the input boxes."); | ||||
|     wxString fill_intro_text = _L("Calibration completed. Please find the most uniform extrusion line on your hot bed like the picture below, and fill the value on its left side into the factor K input box."); | ||||
|     m_save_cali_result_title = new Label(m_step_2_panel, fill_intro_text); | ||||
|     m_save_cali_result_title->SetFont(::Label::Body_12); | ||||
|     m_save_cali_result_title->SetForegroundColour(EXTRUSION_CALIBRATION_GREY800); | ||||
|  | @ -364,8 +364,10 @@ void ExtrusionCalibration::show_info(bool show, bool is_error, wxString text) | |||
|         if (is_error) { | ||||
|             m_info_text->Hide(); | ||||
|             m_error_text->Show(); | ||||
|             m_error_text->SetLabelText(text); | ||||
|         } else { | ||||
|             m_info_text->Show(); | ||||
|             m_info_text->SetLabelText(text); | ||||
|             m_error_text->Hide(); | ||||
|         } | ||||
|     } | ||||
|  |  | |||
|  | @ -1098,7 +1098,6 @@ void StatusBasePanel::show_ams_group(bool show, bool support_virtual_tray) | |||
|     m_ams_control->Show(true); | ||||
|     m_ams_control_box->Show(true); | ||||
|     m_ams_control->show_noams_mode(show, support_virtual_tray); | ||||
| 
 | ||||
|     if (m_show_ams_group != show) { | ||||
|         Fit(); | ||||
|     } | ||||
|  | @ -1886,68 +1885,60 @@ void StatusPanel::update_ams(MachineObject *obj) | |||
|     } | ||||
|     if (m_filament_setting_dlg) { m_filament_setting_dlg->obj = obj; } | ||||
| 
 | ||||
|     if (!obj || !obj->is_connected()) { | ||||
|         last_tray_exist_bits  = -1; | ||||
|         last_ams_exist_bits   = -1; | ||||
|         last_tray_is_bbl_bits = -1; | ||||
|         last_read_done_bits   = -1; | ||||
|         last_reading_bits     = -1; | ||||
|         last_ams_version      = -1; | ||||
|         m_ams_control->show_vams(false); | ||||
|         m_ams_control->EnterNoneAMSMode(); | ||||
|     if (!obj | ||||
|         || !obj->is_connected() | ||||
|         || obj->amsList.empty() | ||||
|         || obj->ams_exist_bits == 0) { | ||||
|         if (!obj || !obj->is_connected()) { | ||||
|             last_tray_exist_bits = -1; | ||||
|             last_ams_exist_bits = -1; | ||||
|             last_tray_is_bbl_bits = -1; | ||||
|             last_read_done_bits = -1; | ||||
|             last_reading_bits = -1; | ||||
|             last_ams_version = -1; | ||||
|             BOOST_LOG_TRIVIAL(trace) << "machine object" << obj->dev_name << " was disconnected, set show_ams_group is false"; | ||||
|         } | ||||
|         show_ams_group(false, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)); | ||||
|         BOOST_LOG_TRIVIAL(trace) << "machine object" << obj->dev_name << " was disconnected, set show_ams_group is false"; | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     bool is_support_extrusion_cali = obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI); | ||||
|     if (is_support_extrusion_cali) { | ||||
|         m_ams_control->show_vams(true); | ||||
|         m_ams_control->update_vams_kn_value(obj->vt_tray); | ||||
|     } | ||||
|     else { | ||||
|         m_ams_control->show_vams(false); | ||||
| 
 | ||||
|     show_ams_group(true, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)); | ||||
|     if (m_filament_setting_dlg) m_filament_setting_dlg->update(); | ||||
| 
 | ||||
|     std::vector<AMSinfo> ams_info; | ||||
|     for (auto ams = obj->amsList.begin(); ams != obj->amsList.end(); ams++) { | ||||
|         AMSinfo info; | ||||
|         info.ams_id = ams->first; | ||||
|         if (ams->second->is_exists && info.parse_ams_info(ams->second, obj->ams_calibrate_remain_flag, obj->is_support_ams_humidity)) ams_info.push_back(info); | ||||
|     } | ||||
|     //if (obj->ams_exist_bits != last_ams_exist_bits || obj->tray_exist_bits != last_tray_exist_bits || obj->tray_is_bbl_bits != last_tray_is_bbl_bits ||
 | ||||
|     //    obj->tray_read_done_bits != last_read_done_bits || obj->ams_version != last_ams_version) {
 | ||||
|     //    m_ams_control->UpdateAms(ams_info, false);
 | ||||
|     //    // select current ams
 | ||||
|     //    //if (!obj->m_ams_id.empty()) m_ams_control->SwitchAms(obj->m_ams_id);
 | ||||
| 
 | ||||
|     if (obj->amsList.empty() || obj->ams_exist_bits == 0) { | ||||
|         m_ams_control->EnterNoneAMSMode(); | ||||
|         show_ams_group(false, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)); | ||||
|         update_ams_control_state("", is_support_extrusion_cali); | ||||
|         BOOST_LOG_TRIVIAL(trace) << "machine object" << obj->dev_name << " ams nonexistent, set show_ams_group is false"; | ||||
|         return; | ||||
|     } else { | ||||
|         show_ams_group(true, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)); | ||||
|         if (m_filament_setting_dlg) m_filament_setting_dlg->update(); | ||||
|     //    last_tray_exist_bits  = obj->tray_exist_bits;
 | ||||
|     //    last_ams_exist_bits   = obj->ams_exist_bits;
 | ||||
|     //    last_tray_is_bbl_bits = obj->tray_is_bbl_bits;
 | ||||
|     //    last_read_done_bits   = obj->tray_read_done_bits;
 | ||||
|     //    last_ams_version      = obj->ams_version;
 | ||||
|     //}
 | ||||
|         | ||||
|         std::vector<AMSinfo> ams_info; | ||||
|         for (auto ams = obj->amsList.begin(); ams != obj->amsList.end(); ams++) { | ||||
|             AMSinfo info; | ||||
|             info.ams_id = ams->first; | ||||
|             if (ams->second->is_exists && info.parse_ams_info(ams->second, obj->ams_calibrate_remain_flag, obj->is_support_ams_humidity)) ams_info.push_back(info); | ||||
|         } | ||||
|         //if (obj->ams_exist_bits != last_ams_exist_bits || obj->tray_exist_bits != last_tray_exist_bits || obj->tray_is_bbl_bits != last_tray_is_bbl_bits ||
 | ||||
|         //    obj->tray_read_done_bits != last_read_done_bits || obj->ams_version != last_ams_version) {
 | ||||
|         //    m_ams_control->UpdateAms(ams_info, false);
 | ||||
|         //    // select current ams
 | ||||
|         //    //if (!obj->m_ams_id.empty()) m_ams_control->SwitchAms(obj->m_ams_id);
 | ||||
|     // must select a current can
 | ||||
|     m_ams_control->UpdateAms(ams_info, false, is_support_extrusion_cali); | ||||
| 
 | ||||
|         //    last_tray_exist_bits  = obj->tray_exist_bits;
 | ||||
|         //    last_ams_exist_bits   = obj->ams_exist_bits;
 | ||||
|         //    last_tray_is_bbl_bits = obj->tray_is_bbl_bits;
 | ||||
|         //    last_read_done_bits   = obj->tray_read_done_bits;
 | ||||
|         //    last_ams_version      = obj->ams_version;
 | ||||
|         //}
 | ||||
|     last_tray_exist_bits  = obj->tray_exist_bits; | ||||
|     last_ams_exist_bits   = obj->ams_exist_bits; | ||||
|     last_tray_is_bbl_bits = obj->tray_is_bbl_bits; | ||||
|     last_read_done_bits   = obj->tray_read_done_bits; | ||||
|     last_reading_bits     = obj->tray_reading_bits; | ||||
|     last_ams_version      = obj->ams_version; | ||||
|      | ||||
|         // must select a current can
 | ||||
|         m_ams_control->UpdateAms(ams_info, false, is_support_extrusion_cali); | ||||
| 
 | ||||
|         last_tray_exist_bits  = obj->tray_exist_bits; | ||||
|         last_ams_exist_bits   = obj->ams_exist_bits; | ||||
|         last_tray_is_bbl_bits = obj->tray_is_bbl_bits; | ||||
|         last_read_done_bits   = obj->tray_read_done_bits; | ||||
|         last_reading_bits     = obj->tray_reading_bits; | ||||
|         last_ams_version      = obj->ams_version; | ||||
|     } | ||||
| 
 | ||||
|     std::string curr_ams_id = m_ams_control->GetCurentAms(); | ||||
|     std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id); | ||||
|  | @ -2056,10 +2047,7 @@ void StatusPanel::update_ams(MachineObject *obj) | |||
| void StatusPanel::update_ams_control_state(std::string ams_id, bool is_support_virtual_tray) | ||||
| { | ||||
|     // update load/unload enable state
 | ||||
|     if (ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) { | ||||
|         m_ams_control->SetActionState(AMSAction::AMS_ACTION_VIRTUAL, is_support_virtual_tray); | ||||
|     } | ||||
|     else if (obj->is_in_extrusion_cali()) { | ||||
|     if (obj->is_in_extrusion_cali()) { | ||||
|         m_ams_control->SetActionState(AMSAction::AMS_ACTION_CALI, is_support_virtual_tray); | ||||
|     } | ||||
|     else if (!obj->has_ams()) { | ||||
|  |  | |||
|  | @ -1618,7 +1618,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons | |||
| 
 | ||||
|     m_sizer_left_bottom->Add(extruder_pane, 0, wxLEFT, FromDIP(10)); | ||||
| 
 | ||||
|     m_sizer_left_bottom->Add(0, 0, 0, wxEXPAND, 0); | ||||
|     //m_sizer_left_bottom->Add(0, 0, 0, wxEXPAND, 0);
 | ||||
| 
 | ||||
|     StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered), | ||||
|                             std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal)); | ||||
|  | @ -1630,32 +1630,41 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons | |||
|     StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled)); | ||||
|     StateColor btn_bd_white(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled)); | ||||
|     StateColor btn_text_green(std::pair<wxColour, int>(*wxBLACK, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Enabled)); | ||||
|     m_sizer_left_bottom->AddStretchSpacer(); | ||||
|     //m_sizer_left_bottom->AddStretchSpacer();
 | ||||
| 
 | ||||
|     m_button_extrusion_cali = new Button(m_amswin, _L("Cali")); | ||||
|     m_button_area = new wxWindow(m_amswin, wxID_ANY); | ||||
|     m_button_area->SetBackgroundColour(m_amswin->GetBackgroundColour()); | ||||
|     wxBoxSizer *m_sizer_button_area = new wxBoxSizer(wxHORIZONTAL); | ||||
| 
 | ||||
|     m_button_extrusion_cali = new Button(m_button_area, _L("Cali")); | ||||
|     m_button_extrusion_cali->SetToolTip(_L("Calibration of extrusion")); | ||||
|     m_button_extrusion_cali->SetBackgroundColor(btn_bg_green); | ||||
|     m_button_extrusion_cali->SetBorderColor(btn_bd_green); | ||||
|     m_button_extrusion_cali->SetTextColor(btn_text_green); | ||||
|     m_button_extrusion_cali->SetFont(Label::Body_13); | ||||
| 
 | ||||
|     m_button_extruder_feed = new Button(m_amswin, _L("Load Filament")); | ||||
|     m_button_extruder_feed = new Button(m_button_area, _L("Load Filament")); | ||||
|     m_button_extruder_feed->SetBackgroundColor(btn_bg_green); | ||||
|     m_button_extruder_feed->SetBorderColor(btn_bd_green); | ||||
|     m_button_extruder_feed->SetTextColor(wxColour("#FFFFFE")); | ||||
|     m_button_extruder_feed->SetFont(Label::Body_13); | ||||
| 
 | ||||
|     m_button_extruder_back = new Button(m_amswin, _L("Unload Filament")); | ||||
|     m_button_extruder_back = new Button(m_button_area, _L("Unload Filament")); | ||||
|     m_button_extruder_back->SetBackgroundColor(btn_bg_white); | ||||
|     m_button_extruder_back->SetBorderColor(btn_bd_white); | ||||
|     m_button_extruder_back->SetFont(Label::Body_13); | ||||
| 
 | ||||
|     m_sizer_left_bottom->Add(m_button_extrusion_cali, 0, wxTOP, FromDIP(20)); | ||||
|     m_sizer_left_bottom->Add(0, 0, 0, wxALL | wxLEFT, FromDIP(5)); | ||||
|     m_sizer_left_bottom->Add(m_button_extruder_back, 0, wxTOP, FromDIP(20)); | ||||
|     m_sizer_left_bottom->Add(0, 0, 0, wxALL | wxLEFT, FromDIP(5)); | ||||
|     m_sizer_left_bottom->Add(m_button_extruder_feed, 0, wxTOP, FromDIP(20)); | ||||
|     m_sizer_button_area->Add(0, 0, 1, wxEXPAND, 0); | ||||
|     m_sizer_button_area->Add(m_button_extrusion_cali, 0, wxLEFT, FromDIP(5)); | ||||
|     m_sizer_button_area->Add(m_button_extruder_back, 0, wxLEFT, FromDIP(6)); | ||||
|     m_sizer_button_area->Add(m_button_extruder_feed, 0, wxLEFT, FromDIP(6)); | ||||
| 
 | ||||
|     m_button_area->SetSizer(m_sizer_button_area); | ||||
|     m_button_area->Layout(); | ||||
|     m_button_area->Fit(); | ||||
| 
 | ||||
|     m_sizer_left_bottom->Add(0, 0, 1, wxEXPAND, 0); | ||||
|     m_sizer_left_bottom->Add(m_button_area, 0, wxEXPAND | wxTOP, FromDIP(18)); | ||||
|     m_sizer_left->Add(m_sizer_left_bottom, 0, wxEXPAND, 0); | ||||
| 
 | ||||
| 
 | ||||
|  | @ -1668,7 +1677,12 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons | |||
|     m_vams_info.material_state = AMSCanType::AMS_CAN_TYPE_VIRTUAL; | ||||
|     m_vams_info.can_id = wxString::Format("%d", VIRTUAL_TRAY_ID).ToStdString(); | ||||
|     auto vams_panel = new wxWindow(m_panel_virtual, wxID_ANY); | ||||
| <<<<<<< HEAD   (46bdd5 FIX: tree support first layer defects) | ||||
|     m_vams_refresh = new AMSrefresh(vams_panel, wxID_ANY, 0, m_vams_info); | ||||
| ======= | ||||
|     vams_panel->SetBackgroundColour(AMS_CONTROL_DEF_BLOCK_BK_COLOUR); | ||||
|     //m_vams_refresh = new AMSrefresh(vams_panel, wxID_ANY, 0, m_vams_info);
 | ||||
| >>>>>>> CHANGE (92ae56 ENH:Optimize the layout of AMScontrol) | ||||
|     m_vams_lib = new AMSLib(vams_panel, wxID_ANY, m_vams_info); | ||||
|     m_vams_road = new AMSRoad(vams_panel, wxID_ANY, m_vams_info, -1, -1, wxDefaultPosition, AMS_CAN_ROAD_SIZE); | ||||
| 
 | ||||
|  | @ -1694,8 +1708,8 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons | |||
| 
 | ||||
|     wxBoxSizer* m_sizer_vams = new wxBoxSizer(wxVERTICAL); | ||||
|     m_sizer_vams->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(14)); | ||||
|     m_sizer_vams->Add(m_vams_refresh, 0, wxALIGN_CENTER_HORIZONTAL, 0); | ||||
|     m_sizer_vams->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(2)); | ||||
|     //m_sizer_vams->Add(m_vams_refresh, 0, wxALIGN_CENTER_HORIZONTAL, 0);
 | ||||
|     m_sizer_vams->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(2) + AMS_REFRESH_SIZE.y); | ||||
|     m_sizer_vams->Add(m_vams_lib, 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, FromDIP(4)); | ||||
|     m_sizer_vams->Add(m_vams_road, 0, wxALL, 0); | ||||
| 
 | ||||
|  | @ -1979,24 +1993,11 @@ wxColour AMSControl::GetCanColour(std::string amsid, std::string canid) | |||
| 
 | ||||
| void AMSControl::SetActionState(AMSAction action, bool support_virtual_tray) | ||||
| { | ||||
|     if (action == Slic3r::GUI::AMSAction::AMS_ACTION_NOAMS && !support_virtual_tray) | ||||
|     { | ||||
|         m_button_extrusion_cali->Hide(); | ||||
|         m_button_extruder_feed->Hide(); | ||||
|         m_button_extruder_back->Hide(); | ||||
|     } else { | ||||
|         m_button_extrusion_cali->Show(); | ||||
|         m_button_extruder_feed->Show(); | ||||
|         m_button_extruder_back->Show(); | ||||
|     } | ||||
|     m_button_area->Layout(); | ||||
|     m_button_area->Fit(); | ||||
| 
 | ||||
|     switch (action) { | ||||
|     case Slic3r::GUI::AMSAction::AMS_ACTION_NONE: break; | ||||
|     case Slic3r::GUI::AMSAction::AMS_ACTION_VIRTUAL: | ||||
|         m_button_extrusion_cali->Enable(); | ||||
|         m_button_extruder_feed->Disable(); | ||||
|         m_button_extruder_back->Disable(); | ||||
|         break; | ||||
|     case Slic3r::GUI::AMSAction::AMS_ACTION_LOAD:  | ||||
|         m_button_extrusion_cali->Enable(); | ||||
|         m_button_extruder_feed->Enable(); | ||||
|  | @ -2023,7 +2024,10 @@ void AMSControl::SetActionState(AMSAction action, bool support_virtual_tray) | |||
|         m_button_extruder_back->Disable(); | ||||
|         break;  | ||||
|     case Slic3r::GUI::AMSAction::AMS_ACTION_NOAMS: | ||||
|         m_button_extrusion_cali->Disable(); | ||||
|         if (support_virtual_tray) | ||||
|             m_button_extrusion_cali->Enable(); | ||||
|         else | ||||
|             m_button_extrusion_cali->Disable(); | ||||
|         m_button_extruder_feed->Disable(); | ||||
|         m_button_extruder_back->Disable(); | ||||
|         break; | ||||
|  | @ -2039,6 +2043,8 @@ void AMSControl::EnterNoneAMSMode() | |||
|     m_button_ams_setting->Hide(); | ||||
|     m_button_guide->Hide(); | ||||
|     m_button_retry->Hide(); | ||||
|     m_button_extruder_feed->Hide(); | ||||
|     m_button_extruder_back->Hide(); | ||||
|     ShowFilamentTip(false); | ||||
| } | ||||
| 
 | ||||
|  | @ -2050,6 +2056,8 @@ void AMSControl::ExitNoneAMSMode() | |||
|     m_button_ams_setting->Show(); | ||||
|     m_button_guide->Show(); | ||||
|     m_button_retry->Show(); | ||||
|     m_button_extruder_feed->Show(); | ||||
|     m_button_extruder_back->Show(); | ||||
|     ShowFilamentTip(true); | ||||
| } | ||||
| 
 | ||||
|  | @ -2168,7 +2176,14 @@ void AMSControl::Reset() | |||
| 
 | ||||
| void AMSControl::show_noams_mode(bool show, bool support_virtual_tray) | ||||
| { | ||||
|     show_vams(support_virtual_tray); | ||||
|     m_sizer_ams_tips->Show(support_virtual_tray); | ||||
|     if (!support_virtual_tray) | ||||
|         m_button_extrusion_cali->Hide(); | ||||
|     else { | ||||
|         m_button_extrusion_cali->Show(); | ||||
|     } | ||||
| 
 | ||||
|     show?ExitNoneAMSMode() : EnterNoneAMSMode(); | ||||
| } | ||||
| 
 | ||||
|  | @ -2198,13 +2213,9 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> info, bool keep_selection, bool | |||
| { | ||||
|     std::string curr_ams_id = GetCurentAms(); | ||||
|     std::string curr_can_id = GetCurrentCan(curr_ams_id); | ||||
|     if (info.size() > 0) ExitNoneAMSMode(); | ||||
| 
 | ||||
|     // update extrusion cali
 | ||||
|     if (has_extrusion_cali) | ||||
|         m_button_extrusion_cali->Show(); | ||||
|     else | ||||
|         m_button_extrusion_cali->Hide(); | ||||
|     m_button_area->Layout(); | ||||
|     m_button_area->Fit();         | ||||
| 
 | ||||
|     // update item
 | ||||
|     m_ams_info = info; | ||||
|  |  | |||
|  | @ -60,7 +60,6 @@ enum class AMSAction : int { | |||
|     AMS_ACTION_CALI, | ||||
|     AMS_ACTION_PRINTING, | ||||
|     AMS_ACTION_NORMAL, | ||||
|     AMS_ACTION_VIRTUAL, | ||||
|     AMS_ACTION_NOAMS, | ||||
| }; | ||||
| 
 | ||||
|  | @ -505,6 +504,7 @@ protected: | |||
|     Button *m_button_extrusion_cali= {nullptr}; | ||||
|     Button *m_button_guide = {nullptr}; | ||||
|     Button *m_button_retry = {nullptr}; | ||||
|     wxWindow* m_button_area = {nullptr}; | ||||
| 
 | ||||
|     wxHyperlinkCtrl *m_hyperlink = {nullptr}; | ||||
|     AmsHumidityTipPopup m_Humidity_tip_popup; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tao wang
						tao wang