Commit 95bbebcc authored by Georgios Dagkakis's avatar Georgios Dagkakis

correction so that plugin does not use the standard units as hard-coded

parent 4d266b2a
...@@ -43,7 +43,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -43,7 +43,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
sharingStations=[] sharingStations=[]
if workingBatchSize!=standardBatchUnits: if workingBatchSize!=standardBatchUnits:
sharingStations=self.findSharingStations(data,stationId) sharingStations=self.findSharingStations(data,stationId)
self.checkIfDefinitionIsValid(data, WIPData, stationId, sharingStations) self.checkIfDefinitionIsValid(data, WIPData, stationId, sharingStations,standardBatchUnits)
return data return data
...@@ -82,7 +82,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -82,7 +82,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
return sharingStations return sharingStations
# validates the definition of WIP and throws an error message in case it is not valid, i.e. not full batches are formed # validates the definition of WIP and throws an error message in case it is not valid, i.e. not full batches are formed
def checkIfDefinitionIsValid(self,data,WIPData,stationId,sharingStations): def checkIfDefinitionIsValid(self,data,WIPData,stationId,sharingStations,standardBatchUnits):
# find all the stations in the group. For example PackagingA may not share batches with PackagingB. # find all the stations in the group. For example PackagingA may not share batches with PackagingB.
# but carding does share with both so the group should contain all 3 stations # but carding does share with both so the group should contain all 3 stations
allStations=[stationId]+sharingStations allStations=[stationId]+sharingStations
...@@ -100,7 +100,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -100,7 +100,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
totalUnits+=int(row[1]) totalUnits+=int(row[1])
if row[2]: if row[2]:
totalUnits+=int(row[2]) totalUnits+=int(row[2])
assert totalUnits % 80 == 0, 'wrong wip definition in group '+str(allStations)+'. Not full batches.' assert totalUnits % standardBatchUnits == 0, 'wrong wip definition in group '+str(allStations)+'. Not full batches.'
......
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