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

Automatically add Event Generator for queue statistics when using Queue stat widget

parent 9b3e3987
......@@ -366,6 +366,19 @@ class Simulation(object):
def _preprocess(self, data):
"""Preprocess the data, for instance reading spreadsheet.
"""
# by default we add an event generator if using queue stats
if self.getConfigurationDict()["Dream-Configuration"]["gui"]["queue_stat"]:
if not "__queue_stat" in data["nodes"]:
data["nodes"]["__queue_stat"] = {
"_class": "Dream.EventGenerator",
"argumentDict": "{}",
"duration": 10,
"interval": 10,
"method": "Globals.countQueueMetrics",
"name": "Queue Statistics",
"start": 1,
"stop": -1
}
return data
def run(self, data):
......
......@@ -149,7 +149,7 @@ class Simulation(ACO.Simulation):
def _preprocess(self, in_data):
""" Set the WIP in queue from spreadsheet data.
"""
data = copy(in_data)
data = copy(ACO.Simulation._preprocess(self, in_data))
self.data = data
now = datetime.now()
......
......@@ -14,6 +14,7 @@ class Simulation(DefaultSimulation):
def _preprocess(self, data):
"""Preprocess data, reading shift spreadsheet
"""
data = DefaultSimulation._preprocess(data)
strptime = datetime.datetime.strptime
now = strptime(data['general']['currentDate'], '%Y/%m/%d')
......
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