2020-06-09 17:17:08 +02:00
|
|
|
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])
|
2020-06-09 17:17:08 +02:00
|
|
|
for shelf in shelfs:
|
2020-06-09 21:57:37 +02:00
|
|
|
if shelf.color == product_color:
|
2020-06-09 17:17:08 +02:00
|
|
|
shelf.add_product(code)
|
2020-06-09 21:57:37 +02:00
|
|
|
c = shelf.get_field()
|
2020-06-09 17:17:08 +02:00
|
|
|
|
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
|
|
|
|
2020-06-10 01:14:02 +02:00
|
|
|
print("Product:", name, "is on", c.x, c.y)
|
2020-06-09 17:17:08 +02:00
|
|
|
return c
|