Commit d2c9ebce authored by Georgios Dagkakis's avatar Georgios Dagkakis

cleanup with comments

parent 824569d7
......@@ -15,6 +15,7 @@ class BatchesWIPKEtool(plugin.InputPreparationPlugin):
"""
def preprocess(self, data):
# if the WIP data is to be defined manually just return
if data['general'].get('wipSource',None)=='Manually':
return data
......
......@@ -13,6 +13,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
"""
def preprocess(self, data):
# if the WIP data is to be read by KE tool just return
if data['general'].get('wipSource',None)=='KE tool':
return data
......
......@@ -15,6 +15,7 @@ class BatchesWIPSpreadsheet(plugin.InputPreparationPlugin):
def preprocess(self, data):
""" Set the WIP in queue from spreadsheet data.
"""
# if the WIP data is to be read by KE tool just return
if data['general'].get('wipSource',None)=='By KE':
return data
......
from dream.plugins import plugin
class OutputKEWIP(plugin.OutputPreparationPlugin):
""" Output the station utilization metrics in a format compatible with
""" Output the WIP the KE tool return in a DREAM formatted spreadsheet
"""
def postprocess(self, data):
# if the wip was defined manually, no report should be given, just a message to explain.
if data['general'].get('wipSource',None)=='Manually':
data['result']['result_list'][0][self.configuration_dict['output_id']]=[[
'WIP Was defined Manually. No KE tool Input!'
]]
return data
# if the mode was to read by KE but no spreadsheet was uploaded, give a warning.
if not data['input'].get('wip_report',{}):
data['result']['result_list'][0][self.configuration_dict['output_id']]=[[
'Warning! No WIP Report was provided. KE could not be run and no WIP was defined in the model!'
]]
return data
# set the titles
outPutSpreadsheet=[['Station','# units awaiting processing','# units complete but not passed on']]
nodes=data['graph']['node']
# create rows for all the stations
for node_id, node in nodes.iteritems():
if 'Machine' in node['_class'] or 'M3' in node['_class']:
outPutSpreadsheet.append([node_id,0])
# read the input and for the queues that have WIP set the total number of units to the next station
# WIP from KE tool now is only in Queues but the manual input is done as '# units awaiting processing' in station
for node_id, node in nodes.iteritems():
if 'Queue' in node['_class'] or 'Clearance' in node['_class']:
wip=node.get('wip',[])
......@@ -43,7 +47,6 @@ class OutputKEWIP(plugin.OutputPreparationPlugin):
def getNextStation(self,data,bufferId):
nodes=data['graph']['node']
current=bufferId
# find all the successors that may share batches
while 1:
next=self.getSuccessors(data, current)[0]
if 'Machine' in nodes[next]['_class'] or 'M3' in nodes[next]['_class']:
......
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