Commit 5fd7874c authored by Georgios Dagkakis's avatar Georgios Dagkakis

Batch instance set with view and (empty) plugin to output Excel schedule of operators

parent 40fb02fc
from dream.plugins import plugin
class BatchesOperatorSpreadsheet(plugin.OutputPreparationPlugin):
""" Output the result of demand planning in a format compatible with
Output_viewDownloadFile
"""
def postprocess(self, data):
# XXX the event generator should store its result in data and not in global
# variable.
print "I'm in"
# from dream.simulation.applications.DemandPlanning.Globals import G
# data['result']['result_list'][-1][self.configuration_dict['output_id']] = {
# 'name': 'Result.xlsx',
# 'mime_type': 'application/vnd.ms-excel',
# 'data': G.reportResults.xlsx.encode('base64')
# }
# import json
# utilisationString=json.dumps(G.Utilisation, indent=5)
# outputJSONFile=open('Utilisation.json', mode='w')
# outputJSONFile.write(utilisationString)
return data
......@@ -229,7 +229,7 @@
"output_id": "operator_gantt"
},
"gadget": "Output_viewGantt",
"title": "Operator Schedule",
"title": "Operator Schedule Gantt",
"type": "object_view"
},
"view_queue_stats": {
......@@ -255,6 +255,14 @@
"gadget": "Output_viewGraph",
"title": "Operator Utilization",
"type": "object_view"
},
"view_download_spreadsheet": {
"configuration": {
"output_id": "operator_spreadsheet"
},
"gadget": "Output_viewDownloadFile",
"title": "Operator Schedule Spreadsheet",
"type": "object_view"
}
},
"post_processing": {
......@@ -284,6 +292,10 @@
{
"_class": "dream.plugins.BatchesOperatorGantt.BatchesOperatorGantt",
"output_id": "operator_gantt"
},
{
"_class": "dream.plugins.BatchesOperatorSpreadsheet.BatchesOperatorSpreadsheet",
"output_id": "operator_spreadsheet"
}
]
},
......
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