def _run_scenario(self, path):
     if len(path) > 0:
         logic_helper.restart_scenario(self.conn, path,
                                       leave_on=['amplifier'])
     else:
         self.logger.info("NO NEXT SCENARIO!!! Finish!!!")
         sys.exit(0)
 def _run_next_scenario(self):
     path = self.config.get_param('next_scenario_path')
     if len(path) > 0:
         logic_helper.restart_scenario(self.conn, path, leave_on=['amplifier'])
     else:
         self.logger.info("NO NEXT SCENARIO!!! Finish!!!")
         sys.exit(0)
 def _run_next_scenario(self):
     path = self.config.get_param('next_scenario_path')
     if len(path) > 0:
         logic_helper.restart_scenario(path)
     else:
         self.logger.info("NO NEXT SCENARIO!!! Finish!!!")
         sys.exit(0)
 def _run_next_scenario(self):
     path = self.config.get_param("next_scenario_path")
     if len(path) > 0:
         logic_helper.restart_scenario(path)
     else:
         self.logger.info("NO NEXT SCENARIO!!! Finish!!!")
         sys.exit(0)
 def _run_scenario(self, path):
     if len(path) > 0:
         logic_helper.restart_scenario(self.conn,
                                       path,
                                       leave_on=['amplifier'])
     else:
         self.logger.info("NO NEXT SCENARIO!!! Finish!!!")
         sys.exit(0)
 def _run_next_scenario(self):
     path = self.config.get_param('next_scenario_path')
     if len(path) > 0:
         logic_helper.restart_scenario(self.conn,
                                       path,
                                       leave_on=['amplifier'])
     else:
         LOGGER.info("NO NEXT SCENARIO!!! Finish!!!")
         sys.exit(0)
Beispiel #7
0
 def transform_scenario(self, to_interface):
     if self._current_interface == to_interface:
         return
     elif not self._is_transforming:#can fire only once...
         self._is_transforming = True
         self._current_interface = to_interface
         time.sleep(0.3)# wait a moment, maybe gui wants to take a while before hiding
         #restarting takes many seconds anyway...
         self.logger.info("Restart scenario!!!")
         ugm_helper.send_hide(self.conn)
         logic_helper.restart_scenario(self.conn, self._configs[to_interface],
                                       leave_on=['amplifier'])
Beispiel #8
0
 def __init__(self, addresses):
     super(TestServer2, self).__init__(addresses=addresses, type=peers.CONFIGURER)
     self.ready()
     print "RRRRRRRRRRRREADY!!!"
     time.sleep(2)
     logic_helper.restart_scenario(self.conn, "scenarios/morph_test_b.ini",
                                     leave_on=['peer1', 'amplifier'],
                                         overwrites=dict(
                                             peer2=['-p', 'text', 'dupa dupa dupa',
                                                 '-p', 'zzz', '12345'],
                                             peer3=['-f', 'control/test/custom_peer_b.ini']
                                             ))
Beispiel #9
0
 def __init__(self, addresses):
     super(TestServer2, self).__init__(addresses=addresses, type=peers.CONFIGURER)
     self.ready()
     print "RRRRRRRRRRRREADY!!!"
     time.sleep(5)
     logic_helper.restart_scenario(self.conn, self.get_param('transform_to'),
                                     leave_on=['peer1', 'amplifier'],
                                         overwrites=dict(
                                             peer2=['-p', 'text', 'dupa dupa dupa',
                                                  '-p', 'zzz', '12345'],
                                             peer3=['-f', os.path.join('control', 'test', 'custom_peer_b.ini')]
                                             ))
Beispiel #10
0
 def handle_message(self, mxmsg):
     if (mxmsg.type == types.SWITCH_MESSAGE  and time.time() - self.time > 5):
         self.time = time.time()
         self.logger.info("Got switch message, transform scenario!")
         if int(self.config.get_param('finish_saving')):
             self.logger.info("But first send finish saving ...")
             acquisition_helper.send_finish_saving(self.conn)
         time.sleep(3)
         logic_helper.restart_scenario(
             self.conn, 
             self.config.get_param('new_scenario'), 
             leave_on=self.config.get_param('leave_modules').split(';'))
     else:
         self.logger.debug("Got unrecognised message: "+str(mxmsg.type))
     self.no_response()
Beispiel #11
0
 def transform_scenario(self, to_interface):
     if self._current_interface == to_interface:
         return
     elif not self._is_transforming:  #can fire only once...
         self._is_transforming = True
         self._current_interface = to_interface
         time.sleep(
             0.3
         )  # wait a moment, maybe gui wants to take a while before hiding
         #restarting takes many seconds anyway...
         self.logger.info("Restart scenario!!!")
         ugm_helper.send_hide(self.conn)
         logic_helper.restart_scenario(self.conn,
                                       self._configs[to_interface],
                                       leave_on=['amplifier'])
 def handle_message(self, mxmsg):
     if (mxmsg.type == types.SWITCH_MESSAGE  and time.time() - self.time > 5):
         self.time = time.time()
         self.logger.info("Got switch message, transform scenario!")
         if int(self.config.get_param('finish_saving')):
             self.logger.info("But first send finish saving ...")
             acquisition_helper.send_finish_saving(self.conn)
         time.sleep(3)
         logic_helper.restart_scenario(
             self.conn, 
             self.config.get_param('new_scenario'), 
             leave_on=self.config.get_param('leave_modules').split(';'))
     else:
         self.logger.warning("Got unrecognised message: "+str(mxmsg.type))
     self.no_response()
Beispiel #13
0
 def __init__(self, addresses):
     super(TestServer2, self).__init__(addresses=addresses,
                                       type=peers.CONFIGURER)
     self.ready()
     print "RRRRRRRRRRRREADY!!!"
     time.sleep(5)
     logic_helper.restart_scenario(
         self.conn,
         self.get_param('transform_to'),
         leave_on=['peer1', 'amplifier'],
         overwrites=dict(
             peer2=['-p', 'text', 'dupa dupa dupa', '-p', 'zzz', '12345'],
             peer3=[
                 '-f',
                 os.path.join('control', 'test', 'custom_peer_b.ini')
             ]))