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))
def _setup(self): self.comm.put([Spike.setup()]) self.visual.setup()
def setup(self): for q in self.sig_queues.values(): try: q.put_nowait(Spike.setup()) except Full: logger.warning('Signal queue' + q.name + 'is full')