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 00:06:27 +08:00
parent a098b483f6
commit 28b7127150
52 changed files with 6136 additions and 250 deletions

View File

@@ -32,6 +32,7 @@
#include "GUI_Utils.hpp"
#include "wxExtensions.hpp"
#include "DeviceManager.hpp"
#include "DeviceCore/DevNozzleSystem.h" // DevNozzle (get_mapped_nozzles return type)
#include "Plater.hpp"
#include "BBLStatusBar.hpp"
#include "BBLStatusBarPrint.hpp"
@@ -61,10 +62,8 @@ namespace Slic3r { namespace GUI {
std::string get_nozzle_volume_type_cloud_string(NozzleVolumeType nozzle_volume_type);
void print_ams_mapping_result(std::vector<FilamentInfo> &result);
enum PrintFromType {
FROM_NORMAL,
FROM_SDCARD_VIEW,
};
// enum PrintFromType moved to DeviceCore/DevDefs.h so shared device-mapping GUI
// headers can name it without an include cycle. SelectMachine.hpp still sees it via DeviceManager.hpp.
enum PrintPageMode {
PrintPageModePrepare = 0,
@@ -324,6 +323,7 @@ private:
std::vector<MachineObject*> m_list;
std::vector<FilamentInfo> m_filaments;
std::vector<FilamentInfo> m_ams_mapping_result;
std::unordered_map<int, int> m_nozzle_mapping_result; // cached rack print-dispatch mapping: filament/group id -> physical nozzle pos
std::vector<int> m_filaments_map;
std::shared_ptr<BBLStatusBarPrint> m_status_bar;
std::unique_ptr<Worker> m_worker;
@@ -511,6 +511,23 @@ public:
bool is_nozzle_type_match(DevExtderSystem data, wxString& error_message) const;
int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id) const;
// Physical nozzle(s) a mapped filament (by filament index / FilamentInfo::id) prints on.
// key: nozzle pos id, value: nozzle. Used by the per-nozzle filament blacklist check loop.
std::map<int, DevNozzle> get_mapped_nozzles(int fila_id) const;
// Short label of the physical nozzle(s) a filament prints on, shown on its send-dialog card:
// rack slots ("R1", "R2 R3") for a nozzle-rack printer, or "L"/"R"/"L R" for a filament-switcher
// printer. Empty for printers with neither (the card then shows no nozzle row).
wxString get_mapped_nozzle_str(int fila_id) const;
// Rack print-dispatch nozzle mapping (H2C): request the printer's auto-mapping and consume the
// result, gating the Send button while the printer computes. Both are no-ops for non-rack printers.
bool CheckErrorSyncNozzleMappingResultV1(MachineObject* obj_);
bool CheckErrorSyncNozzleMappingResultV0(MachineObject* obj_);
void clear_nozzle_mapping();
bool use_dynamic_nozzle_map() const;
void on_flow_cali_option_changed();
PrintFromType get_print_type() {return m_print_type;};
wxString format_steel_name(NozzleType type);
PrintDialogStatus get_status() { return m_print_status; }