Skip to content

Commit

Permalink
Update visualiser to pull in only connected clients from the master a…
Browse files Browse the repository at this point in the history
…nd fix some gdk related bugs
  • Loading branch information
lalithsuresh committed Aug 7, 2012
1 parent 28db02b commit df24803
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions visualiser/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

MASTER_IP = "172.17.255.103"
MASTER_REST_PORT = "8080"
CLIENT_RESOURCE = "/odin/clients/json"
CLIENT_RESOURCE = "/odin/clients/connected/json"
AGENT_RESOURCE = "/odin/agents/json"
SPACING = 10
CANVAS_WIDTH = 1000
Expand Down Expand Up @@ -268,9 +268,9 @@ def update_canvas (canvas):
agent_map = fetch_agent_data_map ()
client_map = fetch_client_data_map ()

for each in agent_map.keys():
if (each in agent_item_map):
item = agent_item_map[each]
#for each in agent_map.keys():
# if (each in agent_item_map):
# item = agent_item_map[each]

for each in client_map.keys():
color = "green"
Expand All @@ -291,14 +291,14 @@ def update_canvas (canvas):
agent.get_data("coords")[1],
item.get_data("my_coords")[0],
item.get_data("my_coords")[1])
agent.raise_(None)
#agent.raise_(None)
item.get_data("path_object").request_update()

item.request_update()
else:
x = point_map["/" + client_map[each]["agent"]][0]
y = point_map["/" + client_map[each]["agent"]][1]
item = create_focus_elipse (canvas, x, y, 15, 15, color, "client-" + each)
item = create_focus_image (canvas, x, y, "client.svg", "client-" + each)

agent = agent_item_map["/" + client_map[each]["agent"]]

Expand All @@ -309,8 +309,8 @@ def update_canvas (canvas):
item.set_data ("my_coords", (x, y))
path.props.visibility = goocanvas.ITEM_INVISIBLE

agent.raise_(None)
item.raise_(None)
#item.raise_(None)
#agent.raise_(None)

client_item_map[each] = item
point_map["/" + client_map[each]["agent"]][1] += 60
Expand Down

0 comments on commit df24803

Please sign in to comment.