Show
Ignore:
Timestamp:
04/04/12 17:07:03 (14 months ago)
Author:
edent
Message:

add ports and ip when loading node

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/jsnyder/trunk/tools/cornetApps/HtmlPages/views.py

    r11091 r11092  
    1414""" 
    1515Returns 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""" 
     18def 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""" 
     26Returns the floor_list array which stores the status of the node as ip of the node. 
    1627@return the floor_list array that has the ip address of the node. 
    1728""" 
    18 def setFloorNodes(): 
     29def setFloorNodeIP(): 
    1930        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""" 
     39Get status of nodes 
     40""" 
     41def getNodeStatus(): 
    2042        floor1_usrp_status=[0,0,0,1,0,0,0,0,0,1,0,0] 
    2143        floor2_usrp_status=[1,1,0,1,0,1,0,1,0,0,1,0] 
     
    2345        floor4_usrp_status=[1,0,1,1,0,0,1,0,0,1,0,0] 
    2446        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 += 12 
    2947        return floor_list 
    3048         
     
    4664        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)) 
    4765        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 = setFloorNodes() 
     66        floor_list = setFloorNodeIP() 
    4967        return render_to_response("HtmlPages/map.html", locals(), context_instance=RequestContext(request)) 
    5068 
     
    6280""" 
    6381def 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),] 
    7083        return render_to_response("HtmlPages/node_menu.html", locals(), context_instance=RequestContext(request)) 
    71  
    72 #@login_required 
    73 def loadNode(request, node_num): 
    74         return render_to_response("HtmlPages/nodes.html", locals(), context_instance=RequestContext(request)) 
    7584 
    7685def properties_page(request):