JobShop post_proc gadgets now work on all different results

parent 69bab6d0
...@@ -27,7 +27,11 @@ class JSComponentGantt(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -27,7 +27,11 @@ class JSComponentGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
maxSimTime=data['general']['maxSimTime'] maxSimTime=data['general']['maxSimTime']
self.initializeTimeSupport(data) self.initializeTimeSupport(data)
date_format = '%d-%m-%Y %H:%M' date_format = '%d-%m-%Y %H:%M'
resultElements=data['result']['result_list'][-1]['elementList']
'''read the results'''
for result in data['result']['result_list']:
resultElements=result['elementList']
task_dict = {} task_dict = {}
# loop in the results to find Operators # loop in the results to find Operators
for element in resultElements: for element in resultElements:
...@@ -79,7 +83,6 @@ class JSComponentGantt(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -79,7 +83,6 @@ class JSComponentGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
) )
# return the result to the gadget # return the result to the gadget
result = data['result']['result_list'][-1]
result[self.configuration_dict['output_id']] = dict( result[self.configuration_dict['output_id']] = dict(
time_unit=self.getTimeUnitText(), time_unit=self.getTimeUnitText(),
task_list=sorted(task_dict.values(), task_list=sorted(task_dict.values(),
......
...@@ -24,7 +24,7 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -24,7 +24,7 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin):
'''returns the id of the operator that has performed a certain task''' '''returns the id of the operator that has performed a certain task'''
# XXX searching in the last solution only # XXX searching in the last solution only
# XXX synchronize with the solution that is used by postprocess method # XXX synchronize with the solution that is used by postprocess method
resultElements=self.data['result']['result_list'][-1]['elementList'] resultElements=self.result['elementList']
for element in resultElements: for element in resultElements:
if element.get("_class", None) in self.OPERATOR_CLASS_SET: if element.get("_class", None) in self.OPERATOR_CLASS_SET:
schedule = element["results"].get("schedule", []) schedule = element["results"].get("schedule", [])
...@@ -38,7 +38,7 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -38,7 +38,7 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin):
STATION_CLASS_SET = set(["Dream.MouldAssembly", "Dream.MachineJobShop"]) STATION_CLASS_SET = set(["Dream.MouldAssembly", "Dream.MachineJobShop"])
def isActiveStation(self, ID): def isActiveStation(self, ID):
'''returns True if station is an active station''' '''returns True if station is an active station'''
resultElements=self.data['result']['result_list'][-1]['elementList'] resultElements=self.result['elementList']
for element in resultElements: for element in resultElements:
if element.get("_class", None) in self.STATION_CLASS_SET: if element.get("_class", None) in self.STATION_CLASS_SET:
if element.get("id", None) == ID: if element.get("id", None) == ID:
...@@ -63,10 +63,12 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -63,10 +63,12 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin):
data['general']['dateFormat']='%Y/%m/%d' data['general']['dateFormat']='%Y/%m/%d'
self.initializeTimeSupport(data) self.initializeTimeSupport(data)
date_format = '%d-%m-%Y %H:%M' date_format = '%d-%m-%Y %H:%M'
'''reading results''' '''reading results'''
resultElements=data['result']['result_list'][-1]['elementList'] for result in data['result']['result_list']:
self.result = result
resultElements=result['elementList']
# create the titles row # create the titles row
result = data['result']['result_list'][-1]
result[self.configuration_dict['output_id']] = [['Job ID', result[self.configuration_dict['output_id']] = [['Job ID',
'Order', 'Order',
'Due Date', 'Due Date',
......
...@@ -23,7 +23,9 @@ class JSOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -23,7 +23,9 @@ class JSOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
maxSimTime=data['general']['maxSimTime'] maxSimTime=data['general']['maxSimTime']
self.initializeTimeSupport(data) self.initializeTimeSupport(data)
date_format = '%d-%m-%Y %H:%M' date_format = '%d-%m-%Y %H:%M'
resultElements=data['result']['result_list'][-1]['elementList']
for result in data['result']['result_list']:
resultElements=result['elementList']
task_dict = {} task_dict = {}
# loop in the results to find Operators # loop in the results to find Operators
for element in resultElements: for element in resultElements:
...@@ -74,7 +76,6 @@ class JSOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -74,7 +76,6 @@ class JSOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
duration=exitTime-entranceTime, duration=exitTime-entranceTime,
) )
# return the result to the gadget # return the result to the gadget
result = data['result']['result_list'][-1]
result[self.configuration_dict['output_id']] = dict( result[self.configuration_dict['output_id']] = dict(
time_unit=self.getTimeUnitText(), time_unit=self.getTimeUnitText(),
task_list=sorted(task_dict.values(), task_list=sorted(task_dict.values(),
......
...@@ -7,7 +7,7 @@ class JSOperatorUtilization(plugin.OutputPreparationPlugin): ...@@ -7,7 +7,7 @@ class JSOperatorUtilization(plugin.OutputPreparationPlugin):
# XXX hardcoded values # XXX hardcoded values
JS_OPERATOR_CLASS_SET = set(["Dream.Operator"]) JS_OPERATOR_CLASS_SET = set(["Dream.Operator"])
def postprocess(self, data): def postprocess(self, data):
result = data['result']['result_list'][-1] for result in data['result']['result_list']:
ticks = [] ticks = []
working_data = [] working_data = []
......
...@@ -7,7 +7,7 @@ class JSStationUtilization(plugin.OutputPreparationPlugin): ...@@ -7,7 +7,7 @@ class JSStationUtilization(plugin.OutputPreparationPlugin):
# XXX hardcoded values # XXX hardcoded values
JS_STATION_CLASS_SET = set(["Dream.MouldAssembly", "Dream.MachineJobShop"]) JS_STATION_CLASS_SET = set(["Dream.MouldAssembly", "Dream.MachineJobShop"])
def postprocess(self, data): def postprocess(self, data):
result = data['result']['result_list'][-1] for result in data['result']['result_list']:
ticks = [] ticks = []
working_data = [] working_data = []
......
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