minor corrections to comply with the new schema definition (graph>node/edge

parent e1c4d2a2
......@@ -377,8 +377,9 @@ class Simulation(object):
"""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"]:
for node in data["nodes"].values():
# if self.getConfigurationDict()["Dream-Configuration"]["gui"]["queue_stat"]:
if data["application_configuration"]["output"]["view_queue_stats"]:
for node in data["graph"]["node"].values():
if node['_class'] in ('Dream.Queue', ):
node['gatherWipStat'] = 1
return data
......
......@@ -75,8 +75,9 @@ def createObjectResourcesAndCoreObjects():
json_data = G.JSONData
#Read the json data
nodes = json_data['nodes'] # read from the dictionary the dicts with key 'nodes'
edges = json_data['edges'] # read from the dictionary the dicts with key 'edges'
# nodes = json_data['nodes'] # read from the dictionary the dicts with key 'nodes'
nodes = json_data['graph']["node"] # read from the dictionary the dicts with key 'nodes'
edges = json_data['graph']["edge"] # read from the dictionary the dicts with key 'edges'
'''
......@@ -241,7 +242,7 @@ def createObjectInterruptions():
G.PeriodicMaintenanceList=[]
json_data = G.JSONData
#Read the json data
nodes = json_data['nodes'] # read from the dictionary the dicts with key 'nodes'
nodes = json_data['graph']["node"] # read from the dictionary the dicts with key 'nodes'
# loop through all the nodes to
# search for Event Generator and create them
......@@ -389,7 +390,7 @@ def createWIP():
G.OrderList.append(O)
# read from the dictionary the dicts with key 'nodes'
nodes = json_data['nodes']
nodes = json_data["graph"]['node']
for (element_id, element) in nodes.iteritems():
element['id'] = element_id
wip=element.get('wip', [])
......
......@@ -192,6 +192,18 @@ class Machine(CoreObject):
@staticmethod
def getOperationTime(time):
def refactorTime(time):
if time:
if time["distribution"]:
time["distributionType"] = time["distribution"]
for key in time[time["distribution"]]:
time[key] = time[time["distribution"]][key]
del time[time["distribution"]]
del time["distribution"]
return time
# XXX update time to comply with old definition
time = refactorTime(time)
'''returns the dictionary updated'''
if not time:
time = { 'distributionType': 'Fixed',
......
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