This commit is contained in:
shaaqu 2020-06-10 00:03:58 +02:00
parent 1864443980
commit 238355d785
7 changed files with 9 additions and 6 deletions

View File

@ -5,7 +5,7 @@ from codes_recognizer.rocognizer import recognizer
def assigning(product_code_path, shelfs):
c = None
code = product_code_path
code = product_code_path[0]
# code = recognizer(product_code_path)
product_color = str(code[0]) + str(code[1])
for shelf in shelfs:

View File

@ -72,5 +72,6 @@ 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 string
r = [string, path]
return r

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -79,11 +79,13 @@ def run():
'''
# list [x, y]
dest_shelf = new_product.shelf(shelfs)
path = functions.a_star(board[agent.y][agent.x], dest_shelf, board)
dest_field = board[dest_shelf.y+1][dest_shelf.x]
path = functions.a_star(board[agent.y][agent.x], dest_field, board)
print(path)
''''''
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

View File

@ -103,6 +103,6 @@ def selectedSupply():
supply = []
for i in range(len(products)):
supply.append([products[i].color, products[i].shape, products[i].mass, products[i].size, '-'])
supply.append(['-', '-', 0, '-', '-'])
# supply.append(['-', '-', 0, '-', '-'])
print(supply)
return supply

View File

@ -32,5 +32,4 @@ class FinalProduct:
self.img = create_image(self)
def shelf(self, shelfs):
print(self.img)
return assigning(self.img, shelfs);

View File

@ -20,6 +20,7 @@ class Shelf:
self.level3.append(product)
def get_field(self):
return self.field
def get_color(self):