feat: printing files go into each machine's hot folder, part by part (item 10)
All checks were successful
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m13s
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 3m56s
All checks were successful
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m13s
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 3m56s
Pulled to Imprimindo, an order's files go as a copy into 3. Imprimindo/<máquina>/<C1|C2|C3>/, the class of each item (chosen in the Kanban, or measured by the Site), where FlexiPRINT takes them (Dropstar's third round, item 10). A film in parts goes to the same machine, in order, never more than two parts in its folder: the next is written when Flexi takes one. The card says "Parte 3/7 imprimindo · 4/7 ripando". The server decides what each folder gets (app/hotfolder.py, dtf_local.hot_parts) and the Kanban's computers write it: each part is claimed by one computer, so Flexi never gets it twice; a claim that did not finish goes back to the queue; a part gone from its folder was taken and is never written again; a card that leaves Imprimindo or is cancelled has what Flexi did not take deleted. A part without a class waits for one, and the class may still change in Imprimindo until its file is written. The folder sync also follows files one by one, so the parts of a film over 15 m are no longer taken for replaced copies of each other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -152,6 +152,37 @@ def run():
|
||||
'note': 'again'}, operator=True, expected=409)
|
||||
print('PASS: generated file approved as final without re-uploading; order queued for printing')
|
||||
|
||||
# Item 10: printing, the file goes once into its machine's hot folder for
|
||||
# its class; Flexi taking it is reported; leaving Imprimindo withdraws
|
||||
# what Flexi did not take.
|
||||
tag = uuid4().hex[:6]
|
||||
machine = client.call('/operator/machines', {'name': f'Hot {tag}', 'products': ['textil']}, operator=True)['id']
|
||||
try:
|
||||
client.call('/operator/orders/' + oid + '/machine', {'machine_id': machine}, operator=True)
|
||||
# No class measured or chosen: the part waits for one.
|
||||
assert not [p for p in client.call('/operator/queue/hot', {}, operator=True)['write'] if p['order'] == oid]
|
||||
client.call('/operator/orders/' + oid + '/contraction', {'item_index': 0, 'value': 'C2'}, operator=True)
|
||||
hot = client.call('/operator/queue/hot', {}, operator=True)
|
||||
due = [p for p in hot['write'] if p['order'] == oid]
|
||||
assert hot['folder'] == '3. Imprimindo' and [(p['folder'], p['name']) for p in due] == \
|
||||
[(f'Hot {tag}/C2', 'DTF-%d-item-1.png' % order['number'])], hot
|
||||
# Claimed by this computer only: asked again, nobody else gets it.
|
||||
assert not [p for p in client.call('/operator/queue/hot', {}, operator=True)['write'] if p['order'] == oid]
|
||||
part = due[0]['id']
|
||||
assert client.call(f'/operator/queue/hot/{part}', {'state': 'written'}, operator=True)['ok']
|
||||
client.call('/operator/orders/' + oid + '/contraction', {'item_index': 0, 'value': 'C1'}, operator=True,
|
||||
expected=409)
|
||||
watch = client.call('/operator/queue/hot', {}, operator=True)['watch']
|
||||
assert [p['id'] for p in watch if p['order'] == oid] == [part], watch
|
||||
assert client.call(f'/operator/queue/hot/{part}', {'state': 'consumed'}, operator=True)['ok']
|
||||
assert not client.call(f'/operator/queue/hot/{part}', {'state': 'consumed'}, operator=True)['ok']
|
||||
board = next(o for o in client.call('/operator/board', operator=True)['orders'] if o['id'] == oid)
|
||||
assert board['hot'] == {'parts': 1, 'taken': 1, 'waiting': 0}, board['hot']
|
||||
print('PASS: the printing file goes once into its machine\'s hot folder for its class')
|
||||
finally:
|
||||
client.call('/operator/machines/' + machine, {'name': f'Hot {tag}', 'products': ['textil'], 'active': False},
|
||||
operator=True)
|
||||
|
||||
# A single-page PDF is drawn from its vectors at 300 DPI.
|
||||
pdf_upload = upload_bytes(client, artwork('PDF'), name='LOCAL-PRINT-TEST.pdf')
|
||||
pdf_order = paid_order(client, loose_item(pdf_upload))
|
||||
|
||||
Reference in New Issue
Block a user