Browse Source

Add FilePicker for config.ini

master
bci 4 years ago
parent
commit
e8711ad7f9
2 changed files with 21 additions and 17 deletions
  1. 18
    14
      app.py
  2. 3
    3
      config.ini

+ 18
- 14
app.py View File

self.BtacCopy = makeBtn(self, "4. Freies Buchstabieren", "lightblue", self.btn_tacCopy, TOP) self.BtacCopy = makeBtn(self, "4. Freies Buchstabieren", "lightblue", self.btn_tacCopy, TOP)
self.BtacSimul = makeBtn(self, "5. Rollstuhlsimulator", "pink", self.btn_tacSimul, TOP) self.BtacSimul = makeBtn(self, "5. Rollstuhlsimulator", "pink", self.btn_tacSimul, TOP)
# self.BtacQuest = makeBtnSmall(self, "6. Fragebogen", "green", self.btn_tacQuest, TOP) # self.BtacQuest = makeBtnSmall(self, "6. Fragebogen", "green", self.btn_tacQuest, TOP)
self.BtacConfig = makeBtnSmall(self, "Einstellungen", "gray", self.btn_config, TOP)
self.BtacConfig = makeBtnSmall(self, "Konfiguration", "gray", self.btn_config, TOP)


frame.rowconfigure((0,1), weight=1) # make buttons stretch when frame.rowconfigure((0,1), weight=1) # make buttons stretch when
frame.columnconfigure((0,2), weight=1) # when window is resized frame.columnconfigure((0,2), weight=1) # when window is resized
# 1. FILTER ################################## # 1. FILTER ##################################
def btn_filter(self): def btn_filter(self):
print('Starte TactileBCIFilter.exe') print('Starte TactileBCIFilter.exe')
subprocess.Popen(config['PATH']['TactileBCIFilter'] + '\TactileBCIFilter.exe')
subprocess.Popen(config['PATH']['tactilebcifilter'] + '\TactileBCIFilter.exe')


# 2. KALIBIERUNGEN ########################### # 2. KALIBIERUNGEN ###########################
def btn_tacCal(self): def btn_tacCal(self):
print('starte taktile Kalibrierung') print('starte taktile Kalibrierung')
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\Operator.exe', '--OnConnect', '-LOAD PARAMETERFILE TactileCalibration.prm'])
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\gUSBampSource.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\P3SignalProcessing.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\P3Speller.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\Operator.exe', '--OnConnect', '-LOAD PARAMETERFILE TactileCalibration.prm'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\gUSBampSource.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\P3SignalProcessing.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\P3Speller.exe', '127.0.0.1'])
# TODO Lock einführen und bei Returnwert Lock öffnen # TODO Lock einführen und bei Returnwert Lock öffnen


# 3. P300 Classifier ######################### # 3. P300 Classifier #########################
def btn_p300(self): def btn_p300(self):
print('Starte P300Classifier.exe') print('Starte P300Classifier.exe')
subprocess.Popen(config['PATH']['P300Classifier'] + '\P300Classifier.exe')
subprocess.Popen(config['PATH']['bci2000'] + r'\tools\P300Classifier\P300Classifier.exe')


# 4. COPYSPELL ########################### # 4. COPYSPELL ###########################
def btn_tacCopy(self): def btn_tacCopy(self):
print('Starte taktilen Copyspeller') print('Starte taktilen Copyspeller')
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\Operator.exe', '--OnConnect', '-LOAD PARAMETERFILE TactileCopy.prm'])
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\gUSBampSource.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\P3SignalProcessing.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['BCI2000'] + '\prog\P3Speller.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\Operator.exe', '--OnConnect', '-LOAD PARAMETERFILE TactileCopy.prm'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\gUSBampSource.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\P3SignalProcessing.exe', '127.0.0.1'])
subprocess.Popen([config['PATH']['bci2000'] + r'\prog\P3Speller.exe', '127.0.0.1'])
# 5. WHEELCHAIR SIMULATOR ########################### # 5. WHEELCHAIR SIMULATOR ###########################
def btn_tacSimul(self): def btn_tacSimul(self):


# X. Settings ######################### # X. Settings #########################
def btn_config(self): def btn_config(self):
print('Einstellungen')
# tk_chooseDirectory
# tk_getOpenFile
print('Konfiguration')
messagebox.showinfo('Konfiguration', 'Bitte wählen Sie nun den BCI2000 Ordner aus, in dem sich die Ordner "batch", "data", "icons", "parms", "prog" und "tools" befinden.')
config['PATH']['bci2000'] = filedialog.askdirectory()
messagebox.showinfo('Konfiguration', 'Bitte wählen Sie nun den Ordner aus, in dem sich die TactileBCIfilter.exe befindet.')
config['PATH']['tactilebcifilter'] = filedialog.askdirectory()
config.write(open('config.ini','w'))
# TODO Catch errors falls falsche Ordner gewählt wurden


def global_close(self, window): def global_close(self, window):
print('Beenden') print('Beenden')

+ 3
- 3
config.ini View File

[PATH] [PATH]
BCI2000 = C:\BCI2000\BCI2000 v3.6.beta.R5570\BCI2000.x64
TactileBCIFilter = C:\Users\bci\Desktop\Qt Filter Program\build-TactileBCIFilter-Desktop_Qt_5_15_0_MinGW_32_bit-Release\release
P300Classifier = C:\Users\bci\Desktop\Igor\PythonBCIgui_v0.2\bin
bci2000 = C:/BCI2000/BCI2000 v3.6.beta.R5570/BCI2000.x64
tactilebcifilter = C:/Users/bci/Desktop/Qt Filter Program/build-TactileBCIFilter-Desktop_Qt_5_15_0_MinGW_32_bit-Release/release

Loading…
Cancel
Save