Commit 6535ecfd authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

temporary implementation of the plugin the preprocess the wip in the default...

temporary implementation of the plugin the preprocess the wip in the default instance. To  be added as full plugin
parent 41a1bc5a
import json
def preprocess(data):
# #with open('defaultWIPSampleInput.json', "r+") as jsonFile:
# #jsondata = json.loads(jsonFile.read())
# for key, value in data.iteritems() :
# print key
wipData=data['input']['wip_spreadsheet']
node=data['graph']['node']
wipData.pop(0) # pop the column names
for wipItem in wipData:
partId=wipItem[0]
# in case there is no id, do not process the element
if not partId:
continue
stationId=wipItem[1]
remainingProcessingTime=wipItem[2]
wip=node[stationId].get('wip',[])
if not wip:
node[stationId]['wip']=[]
node[stationId]['wip'].append({
"_class": "Dream.Part",
"id": partId,
"name": partId,
"remainingProcessingTime":{"Fixed":{"mean":remainingProcessingTime}}
})
return data
\ No newline at end of file
......@@ -79,10 +79,13 @@ class PluginRegistry(object):
"""
for input_preparation in self.input_preparation_list:
data = input_preparation.preprocess(deepcopy(data))
from DefaultWIPAlgorithm import preprocess as pp
data=pp(deepcopy(data))
data = self.execution_plugin.run(data)
for output_preparation in self.output_preparation_list:
data = output_preparation.postprocess(deepcopy(data))
return data
\ No newline at end of file
print '^'*100
print data['result']
\ 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