ogarnia co gdzie polozyc

This commit is contained in:
shaaqu 2020-06-09 23:23:49 +02:00
parent 2b1b66f3b3
commit 1864443980
3 changed files with 8 additions and 8 deletions

View File

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

View File

@ -72,5 +72,5 @@ def create_image(product):
d.text((28, 28), string, font=fnt, fill=(0, 0, 0))
path = 'img/codes/' + product.name + '.png'
img.save(path)
return path
return string

View File

@ -79,13 +79,13 @@ def run():
'''
# list [x, y]
dest_shelf = new_product.shelf(shelfs)
path = functions.a_star(board[agent.y][agent.x], dest_shelf.get_field(), board)
path = functions.a_star(board[agent.y][agent.x], dest_shelf, board)
''''''
agent.item = new_product
path.pop(len(path) - 1)
# path.pop(len(path) - 1)
next_step = path.pop(len(path) - 1)
agent.is_busy = True
# agent.is_busy = True
if board[agent.y][agent.x] == dest_field:
agent.is_busy = False