fix(ams): paint_index im auto-mapping auf global_index setzen statt enumerate-Zähler
Some checks failed
Nightly Build / build (push) Has been cancelled

Bei Multicolor-Drucken mit nicht bei 0 startenden Paint-Indizes (T2, T3...)
wurde paint_index als 0,1,2... statt als tatsächlicher GCode-T-Index gesendet.
Drucker hat dadurch die falschen Slots für die falschen Farben verwendet.

Fixes #78
This commit is contained in:
2026-06-30 22:56:34 +02:00
parent 6e9ba0672f
commit c313e014ad

View File

@@ -1603,13 +1603,13 @@ class KobraXBridge:
loaded = self._select_loaded_slots_for_print(warn_on_empty_default=warn_on_empty_default)
return [
{
"paint_index": pidx,
"paint_index": gidx,
"ams_index": self._slot_to_print_ams_index(gidx),
"paint_color": [255, 255, 255, 255],
"ams_color": self._slot_color_rgba(s),
"material_type": s.get("type", "PLA"),
}
for pidx, (gidx, s) in enumerate(loaded)
for gidx, s in loaded
]
def _build_assigned_ams_box_mapping(self, assignments: list) -> tuple[list[dict], int, int]: