AL-2020/assigning.py
2020-06-10 01:14:02 +02:00

21 lines
519 B
Python

import os
from codes_recognizer.rocognizer import recognizer
def assigning(product_code_path, shelfs):
c = None
code = product_code_path[0]
# code = recognizer(product_code_path)
product_color = str(code[0]) + str(code[1])
for shelf in shelfs:
if shelf.color == product_color:
shelf.add_product(code)
c = shelf.get_field()
name = product_code_path[1].split("/")
name = name[2][:len(name[2])-4]
print("Product:", name, "is on", c.x, c.y)
return c