mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-10 07:55:39 +02:00
Post work PR #851
This commit is contained in:
@@ -295,19 +295,19 @@ def extract_nozzle_mapping_from_3mf(zf: zipfile.ZipFile) -> dict[int, int] | Non
|
||||
physical_extruder_map = data.get("physical_extruder_map")
|
||||
if not physical_extruder_map or len(physical_extruder_map) <= 1:
|
||||
return None # Single-nozzle printer
|
||||
|
||||
|
||||
# Check if only one extruder is active.
|
||||
# If so, we can skip the mapping and just assign all slots to that extruder.
|
||||
# extruder_nozzle_stats format: ["Standard#0|High Flow#0", "Standard#1"]
|
||||
# Each entry = one extruder. Format: <NozzleVolumeType>#<count>[|...]
|
||||
# #N is the count of physical nozzles of that type (0 = none installed).
|
||||
# Types: Standard, High Flow, Hybrid, TPU High Flow
|
||||
|
||||
|
||||
active_extruders = []
|
||||
for stats_str in (data.get("extruder_nozzle_stats") or []):
|
||||
for stats_str in data.get("extruder_nozzle_stats") or []:
|
||||
nozzle_counts = [n.partition("#")[2] for n in stats_str.split("|")]
|
||||
active_extruders.append(1 if any(c not in ("0", "") for c in nozzle_counts) else 0)
|
||||
|
||||
|
||||
if sum(active_extruders) == 1:
|
||||
nozzle_mapping: dict[int, int] = {}
|
||||
active_idx = active_extruders.index(1)
|
||||
|
||||
Reference in New Issue
Block a user