def run_obci_gui(): opts, args = getopt.getopt(sys.argv[1:], '', ['tray', 'presets=']) presets = None for opt, arg in opts: if opt in ('--tray'): os.system('obci_x_tray &') elif opt == '--presets': presets = arg if checkpidfile('gui.pid'): sys.exit(0) app = QApplication([]) # p = QPixmap(os.path.join(settings.INSTALL_DIR, "gui/ugm/resources/obci+svarog.png")) # s = QSplashScreen(p) # s.show() # s.showMessage("OpenBCI - free as in freedom.") # s.finish(dialog) # commented by now - couses sometimes app.exec_ to hang forever ... dialog = ObciLauncherWindow(presets) dialog.start.connect(lambda name: sys.stderr.write('Start %s \n' % name)) dialog.stop.connect(lambda name: sys.stderr.write('Stop %s \n' % name)) sys.exit(app.exec_())
def __init__(self, parent=None): super(ServerController, self).__init__(parent) # Parsing command line options self.easyMode = False self.Gui = False self.autostartServer = False opts, args = getopt.getopt(sys.argv[1:], "egs", ['easy', 'gui', 'startserver']) for opt, arg in opts: if opt in ('--easy'): self.easyMode = True elif opt in ("--gui"): self.Gui = True elif opt in ("--startserver"): self.autostartServer = True instance = checkpidfile('tray.pid') if instance == True and self.Gui == True: os.execl('obci_gui', '') sys.exit(0) elif instance == True: sys.exit(1) self.process = QProcess() self.programName = 'obci srv' # self.process.started.connect(self.processStarted) self.startingStartTime = QTime.currentTime() self.terminatingStartTime = QTime.currentTime() self.lastResponseTime = QTime.currentTime() self.startingServer = False self.terminatingServer = False self.responding = False if self.autostartServer or self.easyMode: self.startServer() time.sleep(2) self.startPinging()
def __init__(self, parent=None): super(ServerController, self).__init__(parent) #Parsing command line options self.easyMode = False self.Gui = False self.autostartServer = False opts, args = getopt.getopt(sys.argv[1:],"egs",['easy','gui','startserver']) for opt, arg in opts: if opt in ('--easy'): self.easyMode = True elif opt in ("--gui"): self.Gui = True elif opt in ("--startserver"): self.autostartServer = True instance = checkpidfile('tray.pid') if instance == True and self.Gui == True: os.execl('obci_gui','') sys.exit(0) elif instance == True: sys.exit(1) self.process = QProcess() self.programName = 'obci srv' #self.process.started.connect(self.processStarted) self.startingStartTime = QTime.currentTime() self.terminatingStartTime = QTime.currentTime() self.lastResponseTime = QTime.currentTime() self.startingServer = False self.terminatingServer = False self.responding = False if self.autostartServer or self.easyMode: self.startServer() time.sleep(2) self.startPinging()
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) def accept(self): row = self.nearby_machines.currentRow() cur_ip = self.nearby_machines.item(row, 0) cur_host = self.nearby_machines.item(row, 1) self.chosen_machine = (cur_ip.text(), cur_host.text()) super(ConnectToMachine, self).accept() if __name__ == '__main__': opts, args = getopt.getopt(sys.argv[1:],"t",['tray']) for opt, arg in opts: if opt in ('--tray'): os.system('obci_x_tray&') if checkpidfile('gui.pid'): sys.exit(0) app = QApplication([]) p = QPixmap(os.path.join(settings.INSTALL_DIR, "gui/ugm/resources/obci+svarog.png")) s = QSplashScreen(p) s.show() s.showMessage("OpenBCI - free as in freedom.") dialog = ObciLauncherWindow() import sys dialog.start.connect(lambda name:sys.stderr.write('Start %s \n' % name)) dialog.stop.connect(lambda name:sys.stderr.write('Stop %s \n' % name)) s.finish(dialog) sys.exit(app.exec_())
path = amp['amplifier_peer_info']['path'] params = {} params['driver_executable'] = amp['amplifier_peer_info']['driver_executable'] params['bluetooth_device'] = amp['amplifier_params']['additional_params'].get('bluetooth_device', '') params['usb_device'] = amp['amplifier_params']['additional_params'].get('usb_device', '') self.path = path self.params = params super(SelectAmplifierDialog, self).accept() if __name__ == '__main__': opts, args = getopt.getopt(sys.argv[1:],"t",['tray']) for opt, arg in opts: if opt in ('--tray'): os.system('obci_x_tray&') if checkpidfile('gui.pid'): sys.exit(0) app = QApplication([]) p = QPixmap(os.path.join(settings.INSTALL_DIR, "gui/ugm/resources/obci+svarog.png")) s = QSplashScreen(p) s.show() s.showMessage("OpenBCI - free as in freedom.") dialog = ObciLauncherWindow() import sys dialog.start.connect(lambda name:sys.stderr.write('Start %s \n' % name)) dialog.stop.connect(lambda name:sys.stderr.write('Stop %s \n' % name)) s.finish(dialog) sys.exit(app.exec_())