From 65118178159d7f09fb3c698acd2dc07047131fc1 Mon Sep 17 00:00:00 2001 From: Vitor Garbellini Date: Sat, 20 Sep 2014 14:58:05 -0300 Subject: [PATCH 1/3] SW-160. Rename "Topology" -> "Map" --- .../openVisualizerApp/openVisualizerWeb.py | 34 +++++++------- .../templates/{topology.tmpl => map.tmpl} | 46 +++++++++---------- .../web_files/templates/navbar.tmpl | 2 +- 3 files changed, 41 insertions(+), 41 deletions(-) rename software/openvisualizer/bin/openVisualizerApp/web_files/templates/{topology.tmpl => map.tmpl} (94%) diff --git a/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py b/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py index cbcd2df58..2331f7e9c 100644 --- a/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py +++ b/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py @@ -97,13 +97,13 @@ def _defineRoutes(self): self.websrv.route(path='/eventdata', callback=self._getEventData) self.websrv.route(path='/wiresharkDebug/:enabled', callback=self._setWiresharkDebug) self.websrv.route(path='/gologicDebug/:enabled', callback=self._setGologicDebug) - self.websrv.route(path='/topology', callback=self._topologyPage) - self.websrv.route(path='/topology/data', callback=self._topologyData) - self.websrv.route(path='/topology/motes', method='POST', callback=self._topologyMotesUpdate) - self.websrv.route(path='/topology/connections', method='PUT', callback=self._topologyConnectionsCreate) - self.websrv.route(path='/topology/connections', method='POST', callback=self._topologyConnectionsUpdate) - self.websrv.route(path='/topology/connections', method='DELETE',callback=self._topologyConnectionsDelete) - self.websrv.route(path='/topology/route', method='GET', callback=self._topologyRouteRetrieve) + self.websrv.route(path='/map', callback=self._mapPage) + self.websrv.route(path='/map/data', callback=self._mapData) + self.websrv.route(path='/map/motes', method='POST', callback=self._mapMotesUpdate) + self.websrv.route(path='/map/connections', method='PUT', callback=self._mapConnectionsCreate) + self.websrv.route(path='/map/connections', method='POST', callback=self._mapConnectionsUpdate) + self.websrv.route(path='/map/connections', method='DELETE',callback=self._mapConnectionsDelete) + self.websrv.route(path='/map/route', method='GET', callback=self._mapRouteRetrieve) self.websrv.route(path='/static/', callback=self._serverStatic) @view('moteview.tmpl') @@ -202,24 +202,24 @@ def _showEventBus(self): return self._getEventData() def _showDAG(self): - states,edges = self.app.topology.getDAG() + states,edges = self.app.map.getDAG() return { 'states': states, 'edges': edges } @view('routing.tmpl') def _showRouting(self): return {} - @view('topology.tmpl') - def _topologyPage(self): + @view('map.tmpl') + def _mapPage(self): ''' Retrieve the HTML/JS page. ''' return {} - def _topologyData(self): + def _mapData(self): ''' - Retrieve the topology data, in JSON format. + Retrieve the map data, in JSON format. ''' # motes @@ -251,7 +251,7 @@ def _topologyData(self): return data - def _topologyMotesUpdate(self): + def _mapMotesUpdate(self): motesTemp = {} for (k,v) in bottle.request.forms.items(): @@ -274,7 +274,7 @@ def _topologyMotesUpdate(self): mh = self.engine.getMoteHandlerById(v['id']) mh.setLocation(v['lat'],v['lon']) - def _topologyConnectionsCreate(self): + def _mapConnectionsCreate(self): data = bottle.request.forms assert sorted(data.keys())==sorted(['fromMote', 'toMote']) @@ -284,7 +284,7 @@ def _topologyConnectionsCreate(self): self.engine.propagation.createConnection(fromMote,toMote) - def _topologyConnectionsUpdate(self): + def _mapConnectionsUpdate(self): data = bottle.request.forms assert sorted(data.keys())==sorted(['fromMote', 'toMote', 'pdr']) @@ -294,7 +294,7 @@ def _topologyConnectionsUpdate(self): self.engine.propagation.updateConnection(fromMote,toMote,pdr) - def _topologyConnectionsDelete(self): + def _mapConnectionsDelete(self): data = bottle.request.forms assert sorted(data.keys())==sorted(['fromMote', 'toMote']) @@ -304,7 +304,7 @@ def _topologyConnectionsDelete(self): self.engine.propagation.deleteConnection(fromMote,toMote) - def _topologyRouteRetrieve(self): + def _mapRouteRetrieve(self): data = bottle.request.query diff --git a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/topology.tmpl b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/map.tmpl similarity index 94% rename from software/openvisualizer/bin/openVisualizerApp/web_files/templates/topology.tmpl rename to software/openvisualizer/bin/openVisualizerApp/web_files/templates/map.tmpl index 633a6a8a9..f6ff5cccc 100644 --- a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/topology.tmpl +++ b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/map.tmpl @@ -41,7 +41,7 @@ var busyDrawingConnection = false; /** - \brief Initialize the topology display + \brief Initialize the map display */ function initialize() { @@ -88,30 +88,30 @@ ) // load mote data - getTopologyData(); + getMapData(); } /** - \brief Retrieve the topology data from the server. + \brief Retrieve the map data from the server. */ - function getTopologyData() { + function getMapData() { if (mapLock==false) { $.ajax({ type: "GET", - url: "/topology/data", + url: "/map/data", success: handleNewData, }) .fail(function() { - console.log("ERROR: could not GET topology data"); + console.log("ERROR: could not GET map data"); }); } - window.setTimeout(getTopologyData,DATA_LOAD_PERIOD); + window.setTimeout(getMapData,DATA_LOAD_PERIOD); } /** - \brief Update the topology using the new data. + \brief Update the map using the new data. */ function handleNewData(newData) { var i; @@ -342,7 +342,7 @@ $.ajax({ type: "POST", - url: "/topology/motes", + url: "/map/motes", data: { 'motes': tempMotes, } @@ -351,18 +351,18 @@ console.log("INFO: new motePositions successfully POSTed to server."); }) .fail(function() { - console.log("ERROR: could not POST updated topology data."); + console.log("ERROR: could not POST updated map data."); }) .always(function() { // get new data from server $.ajax({ type: "GET", - url: "/topology/data", + url: "/map/data", success: handleNewData, }) .fail(function() { - console.log("ERROR: could not GET topology data"); + console.log("ERROR: could not GET map data"); }) .always(function() { @@ -375,7 +375,7 @@ function getRoute(id) { $.ajax({ type: "GET", - url: "/topology/route", + url: "/map/route", data: { 'destination': id, }, @@ -464,7 +464,7 @@ $.ajax({ type: "PUT", - url: "/topology/connections", + url: "/map/connections", data: { 'fromMote': fromMote, 'toMote': toMote, @@ -481,11 +481,11 @@ // get new data from server $.ajax({ type: "GET", - url: "/topology/data", + url: "/map/data", success: handleNewData, }) .fail(function() { - console.log("ERROR: could not GET topology data"); + console.log("ERROR: could not GET map data"); }) .always(function() { @@ -527,7 +527,7 @@ // send to server $.ajax({ type: "POST", - url: "/topology/connections", + url: "/map/connections", data: { 'fromMote': fromMote, 'toMote': toMote, @@ -545,11 +545,11 @@ // get new data from server $.ajax({ type: "GET", - url: "/topology/data", + url: "/map/data", success: handleNewData, }) .fail(function() { - console.log("ERROR: could not GET topology data"); + console.log("ERROR: could not GET map data"); }) .always(function() { @@ -567,7 +567,7 @@ // send to server $.ajax({ type: "DELETE", - url: "/topology/connections", + url: "/map/connections", data: { 'fromMote': fromMote, 'toMote': toMote, @@ -584,11 +584,11 @@ // get new data from server $.ajax({ type: "GET", - url: "/topology/data", + url: "/map/data", success: handleNewData, }) .fail(function() { - console.log("ERROR: could not GET topology data"); + console.log("ERROR: could not GET map data"); }) .always(function() { @@ -613,7 +613,7 @@
-

Topology

+

Map

diff --git a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl index 85db96762..296d75423 100644 --- a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl +++ b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl @@ -54,7 +54,7 @@
  • Event Bus
  • -
  • Topology
  • +
  • Map
  • Routing
  • From f65f0695749609c8a82fde0705b0d5b5f1433ad5 Mon Sep 17 00:00:00 2001 From: Vitor Garbellini Date: Sat, 20 Sep 2014 15:23:21 -0300 Subject: [PATCH 2/3] SW-160. Rename "Routing" -> "Topology" --- .../bin/openVisualizerApp/openVisualizerWeb.py | 10 +++++----- .../web_files/templates/navbar.tmpl | 2 +- .../templates/{routing.tmpl => topology.tmpl} | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) rename software/openvisualizer/bin/openVisualizerApp/web_files/templates/{routing.tmpl => topology.tmpl} (87%) diff --git a/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py b/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py index 2331f7e9c..003c93229 100644 --- a/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py +++ b/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py @@ -92,8 +92,8 @@ def _defineRoutes(self): self.websrv.route(path='/motedata/:moteid', callback=self._getMoteData) self.websrv.route(path='/toggle_root/:moteid', callback=self._toggleRoot) self.websrv.route(path='/eventBus', callback=self._showEventBus) - self.websrv.route(path='/routing', callback=self._showRouting) - self.websrv.route(path='/routing/dag', callback=self._showDAG) + self.websrv.route(path='/topology', callback=self._showTopology) + self.websrv.route(path='/topology/dag', callback=self._showDAG) self.websrv.route(path='/eventdata', callback=self._getEventData) self.websrv.route(path='/wiresharkDebug/:enabled', callback=self._setWiresharkDebug) self.websrv.route(path='/gologicDebug/:enabled', callback=self._setGologicDebug) @@ -202,11 +202,11 @@ def _showEventBus(self): return self._getEventData() def _showDAG(self): - states,edges = self.app.map.getDAG() + states,edges = self.app.topology.getDAG() return { 'states': states, 'edges': edges } - @view('routing.tmpl') - def _showRouting(self): + @view('topology.tmpl') + def _showTopology(self): return {} @view('map.tmpl') diff --git a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl index 296d75423..28345e650 100644 --- a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl +++ b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/navbar.tmpl @@ -56,7 +56,7 @@
  • Map
  • -
  • Routing
  • +
  • Topology
  • Documentation
  • diff --git a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/routing.tmpl b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/topology.tmpl similarity index 87% rename from software/openvisualizer/bin/openVisualizerApp/web_files/templates/routing.tmpl rename to software/openvisualizer/bin/openVisualizerApp/web_files/templates/topology.tmpl index f7be3159a..cbe10aaa1 100644 --- a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/routing.tmpl +++ b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/topology.tmpl @@ -13,7 +13,7 @@
    -

    Routing

    +

    Topology

    @@ -22,7 +22,7 @@ $( document ).ready(function() { $.ajax({ dataType: "json", - url: "/routing/dag", + url: "/topology/dag", success: updateForData, error: errorOnAjax }); @@ -42,7 +42,7 @@ if (hasJson) { if(json.states.length > 0 && json.edges.length > 0) { - $("#routing_status").text(""); + $("#topology_status").text(""); var states = json.states; var edges = json.edges; var g = new dagreD3.Digraph(); @@ -59,14 +59,14 @@ n_dots++; if (n_dots > 3) n_dots = 1; - $("#routing_status").text("Waiting routing information " + dots); + $("#topology_status").text("Waiting topology information " + dots); } } timeoutId = setTimeout(function() { $.ajax({ dataType: "json", - url: "/routing/dag", + url: "/topology/dag", success: updateForData, error: errorOnAjax }); @@ -83,8 +83,8 @@
    -
    Current RPL Routing
    -
    +
    Current RPL Topology
    +
    From 0f67c332723c6fbfcd8cb5cd33a57336f79bb859 Mon Sep 17 00:00:00 2001 From: Vitor Garbellini Date: Sat, 20 Sep 2014 15:39:06 -0300 Subject: [PATCH 3/3] FW-255. Add "synchronized" field to moteview page --- .../web_files/templates/moteview.tmpl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl index bb10aff8a..72dc6aa76 100644 --- a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl +++ b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl @@ -89,7 +89,7 @@