supporto assemblati ok

This commit is contained in:
eduardo 2024-05-24 09:24:06 +02:00
parent 8f7868c8b7
commit b6e294151a

View File

@ -388,11 +388,13 @@ class Test(Widget):
for i, step in enumerate(steps): for i, step in enumerate(steps):
if step.type == "barcodes": if step.type == "barcodes":
n_pieces = int(step.spec.get("n_pieces", 1)) n_pieces = int(step.spec.get("n_pieces", 1))
if n_pieces == 1: n_pieces_adapted = n_pieces
if n_pieces_adapted == 1:
step.spec["barcode_name"] = 'serial' step.spec["barcode_name"] = 'serial'
else: else:
step.spec["barcode_name"] = barcode_names[(n_pieces - 1) % len(barcode_names)] step.spec["barcode_name"] = barcode_names[(n_pieces_adapted - 1) % len(barcode_names)]
step.spec["n_pieces"] = str(n_pieces - 1) n_pieces_adapted -= 1
step.spec["n_pieces"] = str(n_pieces_adapted)
new_barcode_step = copy.deepcopy(step) # create a deep copy of the step new_barcode_step = copy.deepcopy(step) # create a deep copy of the step
steps.insert(i + 1, new_barcode_step) steps.insert(i + 1, new_barcode_step)
if i in skip: if i in skip: