JobShop post_proc gadgets now work on all different results

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