Commit 9d39a004 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Operators to output their utilization in a different tab

parent b49f75a6
...@@ -7,87 +7,57 @@ class BatchesOperatorUtilization(plugin.OutputPreparationPlugin): ...@@ -7,87 +7,57 @@ class BatchesOperatorUtilization(plugin.OutputPreparationPlugin):
def postprocess(self, data): def postprocess(self, data):
result = data['result']['result_list'][-1] result = data['result']['result_list'][-1]
print 1
# ticks = [] ticks = []
# working_data = [] working_data = []
# waiting_data = [] waiting_data = []
# failure_data = [] off_shift_data = []
# blockage_data = []
# off_shift_data = [] options = {
# "xaxis": {
# options = { "minTickSize": 1,
# "xaxis": { "ticks": ticks
# "minTickSize": 1, },
# "ticks": ticks "yaxis": {
# }, "max": 100
# "yaxis": { },
# "max": 100 "series": {
# }, "bars": {
# "series": { "show": True,
# "bars": { "barWidth": 0.8,
# "show": True, "align": "center"
# "barWidth": 0.8, },
# "align": "center" "stack": True
# }, }
# "stack": True }
# }
# } series = [{
# "label": "Working",
# series = [{ "data": working_data
# "label": "Working", }, {
# "data": working_data "label": "Waiting",
# }, { "data": waiting_data
# "label": "Waiting", },
# "data": waiting_data {
# }, { "label": "Off_shift",
# "label": "Failures", "data": off_shift_data
# "data": failure_data }];
# }, {
# "label": "Blockage", out = result[self.configuration_dict['output_id']] = {
# "data": blockage_data "series": series,
# }, "options": options
# { }
# "label": "off_shift",
# "data": off_shift_data i = 0
# }]; for obj in result['elementList']:
# if obj.get('_class') == 'Dream.Operator':
# out = result[self.configuration_dict['output_id']] = { if obj['results']['working_ratio']:
# "series": series, working_data.append((i, obj['results']['working_ratio'][0]))
# "options": options if obj['results']['waiting_ratio']:
# } waiting_data.append((i, obj['results']['waiting_ratio'][0]))
# if obj['results']['off_shift_ratio']:
# i = 0 off_shift_data.append((i, obj['results']['off_shift_ratio'][0]))
# for obj in result['elementList']: ticks.append((i, obj.get('name', self.getNameFromId(data, obj['id']))))
# if obj.get('_class').startswith('Dream.BatchScrapMachine') or obj.get('_class')=='Dream.M3': i += 1
# nextId=self.getSuccessors(data, obj['id'])[0]
# nextClass=data['graph']['node'][nextId]['_class']
# objResults=copy(obj['results'])
#
# # if a station is before batch-reassembly then the blockage of reassembly is added to the station
# # and reducted from its waiting
# nextResults={}
# if nextClass.startswith('Dream.BatchReassembly'):
# for nextObj in result['elementList']:
# if nextObj['id']==nextId:
# nextResults=nextObj["results"]
# if nextResults:
# nextBlockage=nextResults['blockage_ratio'][0]
# objResults['blockage_ratio'][0]=nextBlockage
# objResults['waiting_ratio'][0]-=nextBlockage
#
# if objResults['working_ratio']:
# working_data.append((i, objResults['working_ratio'][0]))
# if objResults['waiting_ratio']:
# waiting_data.append((i, objResults['waiting_ratio'][0]))
# if objResults['failure_ratio']:
# failure_data.append((i, objResults['failure_ratio'][0]))
# if objResults['blockage_ratio']:
# blockage_data.append((i, objResults['blockage_ratio'][0]))
# if objResults['off_shift_ratio']:
# off_shift_data.append((i, objResults['off_shift_ratio'][0]))
#
# ticks.append((i, obj.get('name', self.getNameFromId(data, obj['id']))))
# i += 1
#
return data return 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