- Timestamp:
- 04/04/12 17:07:03 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/jsnyder/trunk/tools/cornetApps/HtmlPages/views.py
r11091 r11092 14 14 """ 15 15 Returns the floor_list array which stores the status of the node as ip of the node. 16 @return the floor_list array that has the number of the node. 17 """ 18 def setFloorNodes(): 19 floor_list=getNodeStatus() 20 for floor in floor_list: 21 for index in range(len(floor)): 22 floor[index] = floor[index]*(index+1) 23 return floor_list 24 25 """ 26 Returns the floor_list array which stores the status of the node as ip of the node. 16 27 @return the floor_list array that has the ip address of the node. 17 28 """ 18 def setFloorNode s():29 def setFloorNodeIP(): 19 30 floorBuffer = 10 #used to calculate the ip address of the node 31 floor_list=getNodeStatus() 32 for floor in floor_list: 33 for index in range(len(floor)): 34 floor[index] = floor[index]*(index+1+floorBuffer) 35 floorBuffer += 12 36 return floor_list 37 38 """ 39 Get status of nodes 40 """ 41 def getNodeStatus(): 20 42 floor1_usrp_status=[0,0,0,1,0,0,0,0,0,1,0,0] 21 43 floor2_usrp_status=[1,1,0,1,0,1,0,1,0,0,1,0] … … 23 45 floor4_usrp_status=[1,0,1,1,0,0,1,0,0,1,0,0] 24 46 floor_list=[floor1_usrp_status, floor2_usrp_status, floor3_usrp_status, floor4_usrp_status] 25 for floor in floor_list:26 for index in range(len(floor)):27 floor[index] = floor[index]*(index+1+floorBuffer)28 floorBuffer += 1229 47 return floor_list 30 48 … … 46 64 node_position_3 = ((175,705),(175,653),(175,598),(206,558),(175,518),(209,452),(236,404),(158,377),(209,333),(210,285),(209,250),(207,206)) 47 65 node_position_4 = ((184,712),(184,666),(184,613),(219,557),(184,517),(222,437),(248,405),(168,372),(221,335),(220,275),(214,226),(219,190)) 48 floor_list = setFloorNode s()66 floor_list = setFloorNodeIP() 49 67 return render_to_response("HtmlPages/map.html", locals(), context_instance=RequestContext(request)) 50 68 … … 62 80 """ 63 81 def node_menu(request): 64 nodes=[Node(id=3-1, ip=33), 65 Node(id=3-2, ip=34), 66 Node(id=3-3, ip=35), 67 Node(id=3-4, ip=36), 68 Node(id=3-5, ip=37), 69 Node(id=3-6, ip=38)] 82 nodes=[Node(id=3-1, ip=33),] 70 83 return render_to_response("HtmlPages/node_menu.html", locals(), context_instance=RequestContext(request)) 71 72 #@login_required73 def loadNode(request, node_num):74 return render_to_response("HtmlPages/nodes.html", locals(), context_instance=RequestContext(request))75 84 76 85 def properties_page(request):