add rot_article_default and rot_pallet_default
This commit is contained in:
parent
10c584d517
commit
184604fb49
1 changed files with 21 additions and 11 deletions
|
@ -82,6 +82,16 @@ def main():
|
||||||
else:
|
else:
|
||||||
try_rot_pallet = True
|
try_rot_pallet = True
|
||||||
|
|
||||||
|
if os.environ.get("rot_article_default"):
|
||||||
|
rot_article_default = bool(int(os.environ["rot_article_default"]))
|
||||||
|
else:
|
||||||
|
rot_article_default = False
|
||||||
|
|
||||||
|
if os.environ.get("rot_pallet_default"):
|
||||||
|
rot_pallet_default = bool(int(os.environ["rot_pallet_default"]))
|
||||||
|
else:
|
||||||
|
rot_pallet_default = False
|
||||||
|
|
||||||
if try_rot_article and try_rot_pallet:
|
if try_rot_article and try_rot_pallet:
|
||||||
product_it = product_varlength(4)
|
product_it = product_varlength(4)
|
||||||
elif try_rot_article or try_rot_pallet:
|
elif try_rot_article or try_rot_pallet:
|
||||||
|
@ -94,25 +104,25 @@ def main():
|
||||||
rot_article, rot_pallet = get_bitmask(product_it.send(True), 2)
|
rot_article, rot_pallet = get_bitmask(product_it.send(True), 2)
|
||||||
elif try_rot_article and not try_rot_pallet:
|
elif try_rot_article and not try_rot_pallet:
|
||||||
rot_article = get_bitmask(product_it.send(True), 1)[0]
|
rot_article = get_bitmask(product_it.send(True), 1)[0]
|
||||||
rot_pallet = False
|
rot_pallet = rot_pallet_default
|
||||||
elif not try_rot_article and try_rot_pallet:
|
elif not try_rot_article and try_rot_pallet:
|
||||||
rot_article = False
|
rot_article = rot_article_default
|
||||||
rot_pallet = get_bitmask(product_it.send(True), 1)[0]
|
rot_pallet = get_bitmask(product_it.send(True), 1)[0]
|
||||||
else:
|
else:
|
||||||
rot_article = False
|
rot_article = rot_article_default
|
||||||
rot_pallet = False
|
rot_pallet = rot_pallet_default
|
||||||
except TypeError:
|
except TypeError:
|
||||||
if try_rot_article and try_rot_pallet:
|
if try_rot_article and try_rot_pallet:
|
||||||
rot_article, rot_pallet = get_bitmask(product_it.next(), 2)
|
rot_article, rot_pallet = get_bitmask(product_it.next(), 2)
|
||||||
elif try_rot_article and not try_rot_pallet:
|
elif try_rot_article and not try_rot_pallet:
|
||||||
rot_article = get_bitmask(product_it.next(), 1)[0]
|
rot_article = get_bitmask(product_it.next(), 1)[0]
|
||||||
rot_pallet = False
|
rot_pallet = rot_pallet_default
|
||||||
elif not try_rot_article and try_rot_pallet:
|
elif not try_rot_article and try_rot_pallet:
|
||||||
rot_article = False
|
rot_article = rot_article_default
|
||||||
rot_pallet = get_bitmask(product_it.next(), 1)[0]
|
rot_pallet = get_bitmask(product_it.next(), 1)[0]
|
||||||
else:
|
else:
|
||||||
rot_article = False
|
rot_article = rot_article_default
|
||||||
rot_pallet = False
|
rot_pallet = rot_pallet_default
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
break # generator empty
|
break # generator empty
|
||||||
it = get_layers(bins, pallet, rot_article, rot_pallet)
|
it = get_layers(bins, pallet, rot_article, rot_pallet)
|
||||||
|
@ -127,11 +137,11 @@ def main():
|
||||||
if try_rot_article and try_rot_pallet:
|
if try_rot_article and try_rot_pallet:
|
||||||
layer, rest = it.send(get_bitmask(product_it.send(False), 2))
|
layer, rest = it.send(get_bitmask(product_it.send(False), 2))
|
||||||
elif try_rot_article and not try_rot_pallet:
|
elif try_rot_article and not try_rot_pallet:
|
||||||
layer, rest = it.send((get_bitmask(product_it.send(False), 1)[0], False))
|
layer, rest = it.send((get_bitmask(product_it.send(False), 1)[0], rot_pallet_default))
|
||||||
elif not try_rot_article and try_rot_pallet:
|
elif not try_rot_article and try_rot_pallet:
|
||||||
layer, rest = it.send((False, get_bitmask(product_it.send(False), 1)[0]))
|
layer, rest = it.send((rot_article_default, get_bitmask(product_it.send(False), 1)[0]))
|
||||||
else:
|
else:
|
||||||
layer, rest = it.send((False, False))
|
layer, rest = it.send((rot_article_default, rot_pallet_default))
|
||||||
if layer:
|
if layer:
|
||||||
layers.append(layer)
|
layers.append(layer)
|
||||||
if rest:
|
if rest:
|
||||||
|
|
Loading…
Reference in a new issue