AL-2020/assigning.py

21 lines
532 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-10 00:03:58 +02:00
code = product_code_path[0]
2020-06-09 23:23:49 +02:00
# 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-10 00:09:14 +02:00
name = product_code_path[1].split("/")
name = name[2][:len(name[2])-4]
2020-06-09 23:23:49 +02:00
print("Product:", product_code_path, "is on", c.x, c.y)
return c