diff --git a/assigning.py b/assigning.py index 7c8274f..1430f9f 100644 --- a/assigning.py +++ b/assigning.py @@ -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 diff --git a/coder.py b/coder.py index 55f2356..caf576b 100644 --- a/coder.py +++ b/coder.py @@ -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 diff --git a/main.py b/main.py index 1532c83..a82c2ba 100644 --- a/main.py +++ b/main.py @@ -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