Commit db4a87ed authored by Georgios Dagkakis's avatar Georgios Dagkakis

corrections in batches wip plugin, not full yet

parent 4e064fa7
......@@ -16,7 +16,14 @@ class BatchesWIPSpreadsheet(plugin.InputPreparationPlugin):
""" Set the WIP in queue from spreadsheet data.
"""
wipData=data['input'].get('wip_spreadsheet', None)
node=data['graph']['node']
nodes=data['graph']['node']
# get the number of units for a standard batch
standardBatchUnits=0
for node_id, node in nodes.iteritems():
if node['_class']=='Dream.BatchSource':
standardBatchUnits=int(node['numberOfUnits'])
if wipData:
wipData.pop(0) # pop the column names
for wipItem in wipData:
......@@ -32,15 +39,25 @@ class BatchesWIPSpreadsheet(plugin.InputPreparationPlugin):
_class="Dream."+wipItem[4]
parentBatchId=wipItem[5]
wip=node[stationId].get('wip',[])
wip=nodes[stationId].get('wip',[])
if not wip:
node[stationId]['wip']=[]
node[stationId]['wip'].append({
nodes[stationId]['wip']=[]
stationClass=nodes[stationId]['_class']
# if the wip is in a buffer
if stationClass in ['Dream.RoutingQueue', 'Dream.Queue', 'Dream.LineClearance']:
wipDict={
"_class": _class,
"id": partId,
"name": partId,
"name": 'Batch_'+partId+'_wip',
"numberOfUnits":numberOfUnits,
"unitsToProcess":unitsToProcess,
"parentBatchId":parentBatchId
})
}
if parentBatchId:
wipDict['parentBatchId']=parentBatchId
wipDict['name']='Batch'+parentBatchId+'_SB'+partId+'wip'
nodes[stationId]['wip'].append(wipDict)
# if the wip is in a server
else:
workingBatchSize=int(nodes[stationId].get(('workingBatchSize'), standardBatchUnits))
print stationId, workingBatchSize
return data
\ No newline at end of file
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