Ejemplo n.º 1
0
 def run(self):
     time.sleep(self.sleep_time_s)
     self.logger.info(''.join(
         ['[', str(self.config.peer_id), '] SEND CONTROL!']))
     self.logger.info("T-before: " + repr(time.time()))
     acquisition_helper.finish_saving()
     self.logger.info("T-after: " + repr(time.time()))
Ejemplo n.º 2
0
 def stop_storing(self, client):
     join_response = client.join_experiment(self.uuid, "dummy_module_"+str(time.time()), "")
     if join_response is None:
         print "experiment engine info - ERROR - connection timeout on stop signal storing!"
         return
     if not join_response.type == "rq_ok":
         print "experiment engine info - ERROR - join error on stop signal storing!"            
         return
     mx_addr = join_response.params["mx_addr"].split(':')
     #hang and wait ...
     acquisition_helper.finish_saving([(mx_addr[0], int(mx_addr[1]))])
Ejemplo n.º 3
0
    def __init__(self, addresses):
        super(LogicVenturesExperiment, self).__init__(addresses=addresses,
                                                      type=peers.CLIENT)
        #initialise game engin for current user
        user_id = self.get_param('user_id')
        self.logger.info("Starting maze for user: "******"Unknown session name - abort")
        #initialise server to receive wii analysis messages from experiment server via udpServer
        srv = UdpServer(engine, self.get_param('internal_ip'))
        self.set_param('internal_port', str(srv.socket.getsockname()[1]))
        thread.start_new_thread(srv.run, ())

        self.ready()
        engine.run()

        self.logger.info("Gui closed. Wait for finish saving..")
        acquisition_helper.finish_saving(addresses, ['wii'])
        self.logger.info("Finish saving ended! Exiting app ...")
        sys.exit(0)
Ejemplo n.º 4
0
 def stop_storing(self, client):
     join_response = client.join_experiment(self.uuid, "dummy_module_" + str(time.time()), "")
     if join_response is None:
         print "experiment engine info - ERROR - connection timeout on stop signal storing!"
         return
     if not join_response.type == "rq_ok":
         print "experiment engine info - ERROR - join error on stop signal storing!"
         return
     mx_addr = join_response.params["mx_addr"].split(':')
     # hang and wait ...
     acquisition_helper.finish_saving([(mx_addr[0], int(mx_addr[1]))])
Ejemplo n.º 5
0
 def finish_saving(self, wait=True):
     if wait:
         acquisition_helper.finish_saving()
     else:
         acquisition_helper.send_finish_saving(self.tagger.conn)
Ejemplo n.º 6
0
	def run(self):
		time.sleep(self.sleep_time_s)
	        self.logger.info(''.join(['[', str(self.config.peer_id), '] SEND CONTROL!']))
		self.logger.info("T-before: "+repr(time.time()))
		acquisition_helper.finish_saving()
		self.logger.info("T-after: "+repr(time.time()))
Ejemplo n.º 7
0
 def finish_saving(self, wait=True):
     if wait:
         acquisition_helper.finish_saving()
     else:
         acquisition_helper.send_finish_saving(self.tagger.conn)