Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename "Topology--> Map", "Routing-->Topology" and add "syncronized" field to moteview page #88

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ 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)
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/<filepath:path>', callback=self._serverStatic)

@view('moteview.tmpl')
Expand Down Expand Up @@ -205,21 +205,21 @@ def _showDAG(self):
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('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
Expand Down Expand Up @@ -251,7 +251,7 @@ def _topologyData(self):

return data

def _topologyMotesUpdate(self):
def _mapMotesUpdate(self):

motesTemp = {}
for (k,v) in bottle.request.forms.items():
Expand All @@ -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'])
Expand All @@ -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'])

Expand All @@ -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'])
Expand All @@ -304,7 +304,7 @@ def _topologyConnectionsDelete(self):

self.engine.propagation.deleteConnection(fromMote,toMote)

def _topologyRouteRetrieve(self):
def _mapRouteRetrieve(self):

data = bottle.request.query

Expand Down
Loading