コード例 #1
0
def main():

    moteProbe_handlers = []
    moteConnector_handlers = []
    moteState_handlers = []

    # create a moteProbe for each mote connected to this computer
    serialPorts = moteProbe.utils.findSerialPorts()
    tcpPorts = [TCP_PORT_START + i for i in range(len(serialPorts))]
    for (serialPort, tcpPort) in zip(serialPorts, tcpPorts):
        moteProbe_handlers.append(moteProbe.moteProbe(serialPort, tcpPort))

    # create a moteConnector for each moteProbe
    for mp in moteProbe_handlers:
        moteConnector_handlers.append(moteConnector.moteConnector(LOCAL_ADDRESS, mp.getTcpPort()))

    # create a moteState for each moteConnector
    for mc in moteConnector_handlers:
        moteState_handlers.append(moteState.moteState(mc))

    # create an open CLI
    cli = MoteStateCli(moteProbe_handlers, moteConnector_handlers, moteState_handlers)

    # start threads
    for ms in moteState_handlers:
        ms.start()
    for mc in moteConnector_handlers:
        mc.start()
    cli.start()
コード例 #2
0
def main():
    
    moteProbe_handlers     = []
    moteConnector_handlers = []
    moteState_handlers     = []
    
    # create a moteProbe for each mote connected to this computer
    serialPorts    = moteProbe.utils.findSerialPorts()
    tcpPorts       = [TCP_PORT_START+i for i in range(len(serialPorts))]
    for (serialPort,tcpPort) in zip(serialPorts,tcpPorts):
        moteProbe_handlers.append(moteProbe.moteProbe(serialPort,tcpPort))
    
    # create a moteConnector for each moteProbe
    for mp in moteProbe_handlers:
       moteConnector_handlers.append(moteConnector.moteConnector(LOCAL_ADDRESS,mp.getTcpPort()))
    
    # create a moteState for each moteConnector
    for mc in moteConnector_handlers:
       moteState_handlers.append(moteState.moteState(mc))
    
    # create an openWeb
    web = MoteStateWeb(moteProbe_handlers,
                       moteConnector_handlers,
                       moteState_handlers)
    
    # start threads
    for ms in moteState_handlers:
       ms.start()
    for mc in moteConnector_handlers:
       mc.start()
    web.start()
コード例 #3
0
ファイル: moteStateGui.py プロジェクト: buguen/openwsn-sdk
 def __init__(self):
     self.moteProbe_handlers        = []
     self.moteConnector_handlers    = []
     self.moteState_handlers        = []
     self.networkState_handler      = None
     self.lbrClient_handler         = None
     
     # create a moteProbe for each mote connected to this computer
     serialPorts    = moteProbe.utils.findSerialPorts()
     tcpPorts       = [TCP_PORT_START+i for i in range(len(serialPorts))]
     for (serialPort,tcpPort) in zip(serialPorts,tcpPorts):
         self.moteProbe_handlers.append(moteProbe.moteProbe(serialPort,tcpPort))
     
     # create a moteConnector for each moteProbe
     for mp in self.moteProbe_handlers:
        self.moteConnector_handlers.append(moteConnector.moteConnector(LOCAL_ADDRESS,mp.getTcpPort()))
     
     # create a moteState for each moteConnector
     for mc in self.moteConnector_handlers:
        self.moteState_handlers.append(moteState.moteState(mc))
     
     # create one networkState
     self.networkState_handler = networkState.networkState()
     
     # create one lbrClient
     self.lbrClient_handler    = lbrClient.lbrClient()
     
     # create an open GUI
     gui = MoteStateGui(self.moteProbe_handlers,
                        self.moteConnector_handlers,
                        self.moteState_handlers,
                        self.lbrClient_handler,
                        self.indicateConnectParams)
     
     # start threads
     self.lbrClient_handler.start()
     for ms in self.moteState_handlers:
        ms.start()
     for mc in self.moteConnector_handlers:
        mc.start()
     gui.start()
コード例 #4
0
ファイル: moteStateGui.py プロジェクト: GiuX/giux-openwsn-sw
 def __init__(self):
     self.moteProbe_handlers        = []
     self.moteConnector_handlers    = []
     self.moteState_handlers        = []
     self.networkState_handler      = None
     self.lbrClient_handler         = None
     
     # create a moteProbe for each mote connected to this computer
     serialPorts    = moteProbe.utils.findSerialPorts()
     tcpPorts       = [TCP_PORT_START+i for i in range(len(serialPorts))]
     for (serialPort,tcpPort) in zip(serialPorts,tcpPorts):
         self.moteProbe_handlers.append(moteProbe.moteProbe(serialPort,tcpPort))
     
     # create a moteConnector for each moteProbe
     for mp in self.moteProbe_handlers:
        self.moteConnector_handlers.append(moteConnector.moteConnector(LOCAL_ADDRESS,mp.getTcpPort()))
     
     # create a moteState for each moteConnector
     for mc in self.moteConnector_handlers:
        self.moteState_handlers.append(moteState.moteState(mc))
     
     # create one networkState
     self.networkState_handler = networkState.networkState()
     
     # create one lbrClient
     self.lbrClient_handler    = lbrClient.lbrClient()
     
     # create an open GUI
     gui = MoteStateGui(self.moteProbe_handlers,
                        self.moteConnector_handlers,
                        self.moteState_handlers,
                        self.lbrClient_handler,
                        self.indicateConnectParams)
     
     # start threads
     self.lbrClient_handler.start()
     for ms in self.moteState_handlers:
        ms.start()
     for mc in self.moteConnector_handlers:
        mc.start()
     gui.start()