Commit 584aa0f8 authored by Georgios Dagkakis's avatar Georgios Dagkakis

comments added

parent 42dce2d5
...@@ -75,10 +75,16 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -75,10 +75,16 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
complete=0 complete=0
complete=int(complete) complete=int(complete)
# we calculate how many sub-batches are
# before station (in buffer or decomposition)
# after station (in buffer or reassembly) and
# inside station (currently worked)
buffered=awaiting - (awaiting % workingBatchSize) buffered=awaiting - (awaiting % workingBatchSize)
proceeded=complete - (complete % workingBatchSize) proceeded=complete - (complete % workingBatchSize)
currentCompleted=awaiting % workingBatchSize currentCompleted=awaiting % workingBatchSize
bufferedSubBatches=int(buffered/workingBatchSize) bufferedSubBatches=int(buffered/workingBatchSize)
# if the station is after decomposition and has full batches waiting
# these should go to the buffer before decomposition
if self.checkIfStationIsAfterDecomposition(data, stationId): if self.checkIfStationIsAfterDecomposition(data, stationId):
if buffered>=standardBatchUnits: if buffered>=standardBatchUnits:
bufferedBatches=int(buffered/standardBatchUnits) bufferedBatches=int(buffered/standardBatchUnits)
...@@ -137,7 +143,6 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -137,7 +143,6 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
stationId=group[0] stationId=group[0]
workingBatchSize=standardBatchUnits workingBatchSize=standardBatchUnits
stationWIPData=[element for element in WIPData if element[0] == stationId][0] stationWIPData=[element for element in WIPData if element[0] == stationId][0]
print stationWIPData
awaiting=stationWIPData[1] awaiting=stationWIPData[1]
complete=stationWIPData[2] complete=stationWIPData[2]
if not awaiting: if not awaiting:
...@@ -146,15 +151,16 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -146,15 +151,16 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
if not complete: if not complete:
complete=0 complete=0
complete=int(complete) complete=int(complete)
# calculate how many full batches wait in buffer
buffered=awaiting - (awaiting % workingBatchSize) buffered=awaiting - (awaiting % workingBatchSize)
bufferedBatches=int(buffered/standardBatchUnits) bufferedBatches=int(buffered/standardBatchUnits)
print buffered # create the full batches in buffer
for i in range(bufferedBatches): for i in range(bufferedBatches):
bufferId=self.getBuffer(data, stationId) bufferId=self.getBuffer(data, stationId)
self.createBatch(data, bufferId, currentBatchId, currentBatchId,standardBatchUnits) self.createBatch(data, bufferId, currentBatchId, currentBatchId,standardBatchUnits)
batchCounter+=1 batchCounter+=1
currentBatchId='Batch_'+str(batchCounter)+'_WIP' currentBatchId='Batch_'+str(batchCounter)+'_WIP'
# if there is work in progress, create the batch giving the remaining units (unitsToProcess)
if complete: if complete:
unitsToProcess=standardBatchUnits-complete unitsToProcess=standardBatchUnits-complete
self.createBatch(data, stationId, currentBatchId, currentBatchId,standardBatchUnits,unitsToProcess=unitsToProcess) self.createBatch(data, stationId, currentBatchId, currentBatchId,standardBatchUnits,unitsToProcess=unitsToProcess)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment