Changed Transportqueuing
This commit is contained in:
17
DB.py
17
DB.py
@@ -801,7 +801,7 @@ class DB:
|
||||
return [boxnr, pos, src, srcx, srcy, srcz, dst, dstx, dsty, dstz, state, ts]
|
||||
|
||||
|
||||
def getmovetransportcount (self, position):
|
||||
def getnewmovetransportcount (self, position):
|
||||
"""
|
||||
Count number of movetransports
|
||||
"""
|
||||
@@ -814,6 +814,21 @@ class DB:
|
||||
return cursor.fetchone ()
|
||||
|
||||
|
||||
|
||||
def getmovetransportsentcount (self, position):
|
||||
"""
|
||||
Count number of sent movetransports
|
||||
"""
|
||||
try:
|
||||
cursor = self.executesql ("SELECT COUNT (position) FROM Transports WHERE position = '%s' AND state = 'Sent' AND src NOT LIKE 'I00_' ORDER BY ts" % position)
|
||||
except:
|
||||
self.log ("Couldn't count Movetransports")
|
||||
raise Warning
|
||||
|
||||
return cursor.fetchone ()
|
||||
|
||||
|
||||
|
||||
def getsenttransport (self, position, src, src_x, src_y):
|
||||
"""
|
||||
getting a sent Transport
|
||||
|
||||
20
storage.py
20
storage.py
@@ -827,18 +827,19 @@ class ISOServer (IPKT, SCLS, TQUI):
|
||||
|
||||
#1st send pending Transports
|
||||
for i in range (int (self.parameter['RFZs'])):
|
||||
self.message (3, "Queue Move Transports for RFZ %d" % (i + 1))
|
||||
self.message (3, "Queue Pending Move Transports for RFZ %d" % (i + 1))
|
||||
_r = self.sendmovetransports ('RFZ%d' % (i + 1))
|
||||
if _r:
|
||||
break
|
||||
|
||||
#FixmMe ToDo New methods for Chaos, Move and Expressjobs
|
||||
for i in range (int (self.parameter['RFZs'])):
|
||||
_count = DB_con.getmovetransportcount ('RFZ%d' % (i + 1))
|
||||
self.message (3, "Queue Move Transports for RFZ %d" % (i + 1))
|
||||
_count = DB_con.getnewmovetransportcount ('RFZ%d' % (i + 1))
|
||||
_sentcount = DB_con.getmovetransportsentcount ('RFZ%d' % (i + 1))
|
||||
self.message (3, "Queue Move Transports for RFZ %d Count %d Sent %d" % (i + 1, _count[0], _sentcount[0]))
|
||||
#Check if Errorboxes have to be moved
|
||||
|
||||
_count = DB_con.getmovetransportcount ('RFZ%d' % (i + 1))
|
||||
_count = DB_con.getnewmovetransportcount ('RFZ%d' % (i + 1))
|
||||
|
||||
_count = [0]
|
||||
#automatic Storage moves - add timecontrol
|
||||
@@ -889,7 +890,7 @@ class ISOServer (IPKT, SCLS, TQUI):
|
||||
self.message (6, "Ordering Time to check for new moves")
|
||||
for _dest in filter (lambda a: a[0] == 'O', self.transportmatrix['srcbydst'].keys ()):
|
||||
if 3 >= 1:
|
||||
self.message (6, "Current Outqueuesize %d reached maximum - stop sweep" % 1)
|
||||
self.message (6, "Ordereng Current Outqueuesize %d for dest %s reached maximum - stop sweep" % (1, _dest))
|
||||
continue
|
||||
|
||||
#FixMe ignore Expressdestinations
|
||||
@@ -981,8 +982,9 @@ class ISOServer (IPKT, SCLS, TQUI):
|
||||
_exp = 1
|
||||
if _exp:
|
||||
self.message (3, "Exp: Sweeping over Expressjobs for ")
|
||||
_count = DB_con.getmovetransportcount ('RFZ2')
|
||||
self.message (3, " Exp: count for RFZ2 Taufs %d" %_count[0])
|
||||
_count = DB_con.getnewmovetransportcount ('RFZ2')
|
||||
_sentcount = DB_con.getmovetransportsentcount ('RFZ2')
|
||||
self.message (3, " Exp: count for RFZ2 Taufs %d sent %d" % (_count[0], _sentcount[0]))
|
||||
DB_con = self.connections['DB']
|
||||
job = DB_con.findactiveexpressjob ()
|
||||
if job:
|
||||
@@ -997,7 +999,7 @@ class ISOServer (IPKT, SCLS, TQUI):
|
||||
mailexplog (job, explog)
|
||||
except:
|
||||
print ('Problem')
|
||||
elif _count[0] < 1:
|
||||
elif __sentcount[0] == 0 and _count[0] == 0:
|
||||
#FixMe just RBG 2 at the moment
|
||||
if _source == 'T001':
|
||||
self.message (3, "Exp: Check Article From T001 due to no Move Job active")
|
||||
@@ -1022,7 +1024,7 @@ class ISOServer (IPKT, SCLS, TQUI):
|
||||
|
||||
#ES Move Jobs
|
||||
_esjob = DB_con.findnewesmovejobs ()
|
||||
_count = DB_con.getmovetransportcount ('RFZ2')
|
||||
_count = DB_con.getnewmovetransportcount ('RFZ2')
|
||||
self.message (3, " Sweep: count for RFZ2 Taufs %d" %_count[0])
|
||||
|
||||
if _esjob and _count[0] > 0:
|
||||
|
||||
Reference in New Issue
Block a user