コード例 #1
0
 def processActorSignal(self, sig, name):
     if sig is not None:
         logger.info('Received signal ' + str(sig[0]) + ' from ' + name)
         if sig[0] == Spike.ready():
             self.actorStates[name.split('_')[0]] = sig[0]
             if all(val == Spike.ready()
                    for val in self.actorStates.values()):
                 self.allowStart = True  #TODO: replace with q_sig to FE/Visual
                 logger.info('Allowing start')
コード例 #2
0
ファイル: visual_model.py プロジェクト: pearsonlab/improv
 def run(self):
     logger.info('Loading FrontEnd')
     self.app = QtWidgets.QApplication([])
     self.rasp = FrontEnd(self.visual, self.q_comm)
     self.rasp.show()
     logger.info('GUI ready')
     self.q_comm.put([Spike.ready()])
     self.visual.q_comm.put([Spike.ready()])
     self.app.exec_()
     logger.info('Done running GUI')
コード例 #3
0
 def processGuiSignal(self, flag, name):
     '''Receive flags from the Front End as user input
         TODO: Not all needed
     '''
     name = name.split('_')[0]
     logger.info('Received signal from GUI: ' + flag[0])
     if flag[0]:
         if flag[0] == Spike.run():
             logger.info('Begin run!')
             #self.flags['run'] = True
             self.run()
         elif flag[0] == Spike.setup():
             logger.info('Running setup')
             self.setup()
         elif flag[0] == Spike.ready():
             logger.info('GUI ready')
             self.actorStates[name] = flag[0]
         elif flag[0] == Spike.quit():
             logger.warning('Quitting the program!')
             self.flags['quit'] = True
             self.quit()
         elif flag[0] == Spike.load():
             logger.info('Loading Tweak config from file ' + flag[1])
             self.loadTweak(flag[1])
         elif flag[0] == Spike.pause():
             logger.info('Pausing processes')
             # TODO. Alsoresume, reset
     else:
         logger.error(
             'Signal received from Nexus but cannot identify {}'.format(
                 flag))