コード例 #1
0
ファイル: Commander.py プロジェクト: cu-madc/vacuum
    # create a commander object.
    @staticmethod
    def spawnCommander() :
	commander = Commander()
	channel = commander.initializeChannel()
	channel.setCommander(commander)
	return(commander)



if (__name__ =='__main__') :
    from Vacuum import Vacuum
    
    commander = Commander()
    commander = Commander.spawnCommander()
    commander.setHostInformation(Router.PLANNER,  "10.0.1.11",10001,None)
    commander.setHostInformation(Router.COMMANDER,"10.0.1.12",10002,None)
    commander.setHostname("10.0.1.12")
    commander.setPort(10002)

    commander.getChannel().setNumberVacuums(1)

    vacuum = Vacuum.spawnVacuum(0,0)
    vacuum.getChannel().setNumberVacuums(1)
    vacuum.setRouterChannel(Router.COMMANDER,commander.getChannel())
    commander.setVacuumRouterInformation(vacuum.getChannel(),0,0,0)

    commander.start()
    print("The commander is running")
    commander.join()