feat(gui): multi-nozzle UI for H2C/A2L

Multi-nozzle sync widget, AMS rack-nozzle mapping popup, calibration rework, send-dialog nozzle mapping and extruder-count UI. Includes the fix to persist the AMS sync badge on filament cards (H2C/A2L and direct-sync printers).
This commit is contained in:
SoftFever
2026-07-09 01:16:26 +08:00
parent a098b483f6
commit 28b7127150
52 changed files with 6136 additions and 250 deletions
+25 -1
View File
@@ -41,8 +41,15 @@
#include "slic3r/GUI/DeviceCore/DevUtil.h"
#include <optional>
#define MAPPING_ITEM_INVALID_REMAIN -1
namespace Slic3r {
class DevNozzleRack;
namespace GUI { class wgtDeviceNozzleRackSelect; }
}
namespace Slic3r { namespace GUI {
@@ -93,6 +100,9 @@ public:
//info
wxColour m_ams_coloul;
wxString m_ams_name;
// Physical nozzle(s) the print-dispatch mapping assigned to this filament (e.g. "R1", "L R").
// Empty on printers without a nozzle rack or filament switcher; when set, the card grows a row.
wxString m_mapped_nozzle_str;
int m_ams_ctype = 0;
std::vector<wxColour> m_ams_cols = std::vector<wxColour>();
//reset
@@ -107,6 +117,7 @@ public:
ScalableBitmap m_filament_wheel_transparent;
ScalableBitmap m_ams_wheel_mitem;
ScalableBitmap m_ams_not_match;
ScalableBitmap m_rack_nozzle_bitmap;
bool m_selected {false};
bool m_warning{false};
@@ -117,6 +128,10 @@ public:
void allow_paint_dropdown(bool flag);
void set_ams_info(wxColour col, wxString txt, int ctype=0, std::vector<wxColour> cols= std::vector<wxColour>(),bool record_back_info = false);
void reset_ams_info();
// Set the mapped-nozzle label ("R1", "L R", ...); grows/shrinks the card as the row appears/clears.
void set_nozzle_info(const wxString& mapped_nozzle_str);
// Size the card: base swatch height, plus one row when a nozzle label is present.
void messure_size();
void disable();
void enable();
@@ -259,12 +274,19 @@ public:
wxBoxSizer* m_sizer_split_ams_right;
bool m_mapping_from_multi_machines {false};
// Rack nozzle manual-pick (rack printers only; hidden by default via Show(false)).
wgtDeviceNozzleRackSelect* m_rack_nozzle_select{nullptr};
Label* m_flush_warning_panel{nullptr}; // Orca: uses a plain Label for the flush warning
std::weak_ptr<DevNozzleRack> m_rack;
void set_sizer_title(wxBoxSizer *sizer, wxString text);
wxBoxSizer* create_split_sizer(wxWindow* parent, wxString text);
void set_send_win(wxWindow* win) {send_win = win;};
void update_materials_list(std::vector<std::string> list);
void set_tag_texture(std::string texture);
void update(MachineObject* obj, const std::vector<FilamentInfo>& ams_mapping_result);
void update(MachineObject* obj, const std::vector<FilamentInfo>& ams_mapping_result, bool use_dynamic_switch = false, std::optional<PrintFromType> print_type = std::nullopt);
void update_rack_select(MachineObject* obj, bool use_dynamic_switch, std::optional<PrintFromType> print_type);
void update_flush_waste(MachineObject* obj);
void update_title(MachineObject* obj);
void update_items_check_state(const std::vector<FilamentInfo>& ams_mapping_result);
void update_ams_data_multi_machines();
@@ -295,6 +317,8 @@ public:
void EnableExtMappingFilaTypeCheck(bool to_check = true) { m_ext_mapping_filatype_check = to_check;} ;
private:
void OnNozzleMappingSelected(wxCommandEvent& evt);
ResetCallback m_reset_callback{nullptr};
std::string m_material_index;
bool m_only_show_ext_spool{false};