Fix filament syncing by fixing nozzle diameter guards (#13330)

* Remove unused `get_printer_preset` calls.

* `Plater::check_printer_initialized` should skip nozzle flow type checks if nozzle is unknown.

Also remove unnecessary `is_multi_extruders` check.

* Remove unused `CalibUtils::is_same_nozzle_diameters()` fn.

* Simplify `CalibUtils::check_printable_status_before_cali`.

The single-arity can delegate to the vectorized arity.

* Add `DevExtruderSystem::NozzleDiameterMatchesOrUnknown` to simply checks.

* Update `CalibrationPresetPage::update_sync_button_status()` to use `NozzleDiameterMatchesOrUnknown`.

Simplify logic by iterating over each extruder and checking for diameter and volume type match.

The previous code had several mistakes (from what I could tell):

- `curr_obj->is_multi_extruders()` doesn't imply exactly 2 extruders
- the single/multi branch served no purpose
- the single branch failed to check the volume type

* Specify `std::fabs` and add explicit import.

Ref: https://github.com/OrcaSlicer/OrcaSlicer/pull/13330#discussion_r3133613736

Not sure how idiomatic this is in C++ / OrcaSlicer codebase, but CoPilot suggested it and it seems reasonable.

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Kevin J. Lynagh
2026-05-16 13:13:40 +02:00
committed by GitHub
parent 427d0f7a9f
commit 8dd1dd8921
5 changed files with 50 additions and 157 deletions

View File

@@ -265,6 +265,7 @@ protected:
void update_combobox_filaments(MachineObject* obj);
void update_show_status();
void update_sync_button_status();
bool is_nozzle_info_synced() const;
void show_status(CaliPresetPageStatus status);
void Enable_Send_Button(bool enable);
bool is_blocking_printing();