2
0
forked from s444420/AL-2020
AL-2020/assigning.py

26 lines
563 B
Python
Raw Normal View History

import os
from codes_recognizer.rocognizer import recognizer
from board import get_shelfs
2020-06-09 21:23:10 +02:00
def assigning(product_code_path, board, shelfs):
code = recognizer(product_code_path)
for shelf in shelfs:
2020-06-09 21:23:10 +02:00
if shelf.is_empty:
shelf.add_product(code)
c = shelf.get_coordinates()
break
else:
if shelf.get_product() == code:
shelf.add_product(code)
c = shelf.get_coordinates()
break
print("Product", product_code_path, "is on", c)
return c