Commit cd52f5aa authored by Georgios Dagkakis's avatar Georgios Dagkakis

plugin added in Batch instance so that the attributes of the shift are set correctly

parent 28b41439
from copy import copy
import json
import time
import random
import operator
from datetime import datetime
from dream.plugins import plugin
class BatchesShiftAttributes(plugin.InputPreparationPlugin):
""" Input preparation
set the shift attributes in the Batch instance
"""
def preprocess(self, data):
""" set the shift attributes in the Batch instance
"""
nodes=data['graph']['node']
for node_id, node in nodes.iteritems():
interruptions=node.get('interruptions',None)
if interruptions:
shift=interruptions.get('shift',None)
if shift:
print 11111
interruptions['shift']['thresholdTimeIsOnShift']=0
interruptions['shift']['receiveBeforeEndThreshold']=7
interruptions['shift']['endUnfinished']=1
return data
\ No newline at end of file
......@@ -299,6 +299,10 @@
{
"_class": "dream.plugins.ReadShiftFromSpreadsheet.ReadShiftFromSpreadsheet",
"input_id": "ShiftSpreadsheet"
},
{
"_class": "dream.plugins.BatchesShiftAttributes.BatchesShiftAttributes",
"input_id": "ShiftSpreadsheet"
}
]
},
......
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