Commit abdb3aa1 authored by Jérome Perrin's avatar Jérome Perrin

Capacity project plugins: postprocess all results, not only the last one

parent c036000b
......@@ -14,7 +14,9 @@ class CapacityProjectGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
data['general']['dateFormat']='%Y/%m/%d'
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 CapacityProjects
for element in resultElements:
......@@ -44,7 +46,6 @@ class CapacityProjectGantt(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(),
......
......@@ -6,7 +6,7 @@ class CapacityProjectStationUtilization(plugin.OutputPreparationPlugin):
"""
def postprocess(self, data):
result = data['result']['result_list'][-1]
for result in data['result']['result_list']:
ticks = []
utilized_data = []
idle_data = []
......
......@@ -14,7 +14,8 @@ class CapacityStationGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
data['general']['dateFormat']='%Y/%m/%d'
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 CapacityProjects
for element in resultElements:
......@@ -50,13 +51,13 @@ class CapacityStationGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
duration=exitTime-entranceTime,
entranceTime=entranceTime
)
import json
outputJSONString=json.dumps(task_dict, indent=5)
outputJSONFile=open('taskDict.json', mode='w')
outputJSONFile.write(outputJSONString)
# 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(),
......
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