AL-2020/assigning.py

19 lines
450 B
Python
Raw Normal View History

import os
from codes_recognizer.rocognizer import recognizer
2020-06-09 21:57:37 +02:00
def assigning(product_code_path, shelfs):
c = None
2020-06-09 23:23:49 +02:00
code = product_code_path
# code = recognizer(product_code_path)
2020-06-09 21:57:37 +02:00
product_color = str(code[0]) + str(code[1])
for shelf in shelfs:
2020-06-09 21:57:37 +02:00
if shelf.color == product_color:
shelf.add_product(code)
2020-06-09 21:57:37 +02:00
c = shelf.get_field()
2020-06-09 23:23:49 +02:00
print("Product:", product_code_path, "is on", c.x, c.y)
return c