|
|
|
|
|
|
|
|
""" |
|
|
""" |
|
|
Created on Fri Sep 4 11:36:24 2020 |
|
|
Created on Fri Sep 4 11:36:24 2020 |
|
|
|
|
|
|
|
|
@author: |
|
|
|
|
|
|
|
|
@author: |
|
|
V0.1 Matthias Eidel |
|
|
V0.1 Matthias Eidel |
|
|
V0.2 Igor Beloschapkin |
|
|
V0.2 Igor Beloschapkin |
|
|
V0.3 Igor Beloschapkin |
|
|
V0.3 Igor Beloschapkin |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
from Tkinter import * |
|
|
|
|
|
import tkFont |
|
|
|
|
|
import tkMessageBox |
|
|
|
|
|
|
|
|
from tkinter import * |
|
|
|
|
|
import tkinter.font as tkFont |
|
|
|
|
|
#import tkMessageBox |
|
|
import os |
|
|
import os |
|
|
|
|
|
|
|
|
# own code: |
|
|
# own code: |
|
|
|
|
|
|
|
|
class App: |
|
|
class App: |
|
|
|
|
|
|
|
|
def __init__(self, master): |
|
|
def __init__(self, master): |
|
|
global lastType |
|
|
|
|
|
lastType = "NONE" |
|
|
|
|
|
self.paradigmText = sys.argv[1] |
|
|
|
|
|
App.paradigmText = sys.argv[1] |
|
|
|
|
|
#print sys.argv[1] |
|
|
|
|
|
pathOrigin = os.path.dirname(os.path.realpath(__file__)) |
|
|
|
|
|
|
|
|
|
|
|
global pathSave |
|
|
|
|
|
pathSave = "\\questions\\" + self.paradigmText |
|
|
|
|
|
pathSave = os.getcwd() + pathSave |
|
|
|
|
|
|
|
|
# self.paradigmText = sys.argv[1] |
|
|
|
|
|
# App.paradigmText = sys.argv[1] |
|
|
|
|
|
# print sys.argv[1] |
|
|
|
|
|
# pathOrigin = os.path.dirname(os.path.realpath(__file__)) |
|
|
|
|
|
|
|
|
|
|
|
# global pathSave |
|
|
|
|
|
# pathSave = "\\questions\\" + self.paradigmText |
|
|
|
|
|
# pathSave = os.getcwd() + pathSave |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textH = 2 |
|
|
textH = 2 |
|
|
textHsmall = 2 |
|
|
textHsmall = 2 |
|
|
textW = 8 |
|
|
textW = 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def makeBtn(self, text, bg, command, side): |
|
|
def makeBtn(self, text, bg, command, side): |
|
|
self.button = Button(frame, text=text, bg=bg, command=command) |
|
|
self.button = Button(frame, text=text, bg=bg, command=command) |
|
|
self.button.config( height = textH, width = textW ) |
|
|
self.button.config( height = textH, width = textW ) |
|
|
|
|
|
|
|
|
self.button = Button(frame, text=text, bg=bg, command=command) |
|
|
self.button = Button(frame, text=text, bg=bg, command=command) |
|
|
self.button.config( height = textHsmall, width = textW ) |
|
|
self.button.config( height = textHsmall, width = textW ) |
|
|
self.button['font'] = tkFont.Font(family='Helvetica', size=16, weight='bold') |
|
|
self.button['font'] = tkFont.Font(family='Helvetica', size=16, weight='bold') |
|
|
self.button.pack(side=side) |
|
|
|
|
|
return self.button |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.button.pack(side=side) |
|
|
|
|
|
return self.button |
|
|
|
|
|
|
|
|
frame = Frame(master) |
|
|
frame = Frame(master) |
|
|
frame.pack() |
|
|
|
|
|
|
|
|
frame.pack() |
|
|
|
|
|
|
|
|
# button generation |
|
|
# button generation |
|
|
self.BtacControl = makeBtn(self, "1. Control", "lightblue", self.btn_tacControl, LEFT) |
|
|
|
|
|
|
|
|
self.Bfilter = makeBtn(self, "1. Filter", "lightblue", self.btn_filter, LEFT) |
|
|
self.BtacCal = makeBtn(self, "2. Calibrate", "lightblue", self.btn_tacCal, LEFT) |
|
|
self.BtacCal = makeBtn(self, "2. Calibrate", "lightblue", self.btn_tacCal, LEFT) |
|
|
self.Bp300 = makeBtn(self, "3. P300 Classifier", "lightblue", self.btn_p300, LEFT) |
|
|
self.Bp300 = makeBtn(self, "3. P300 Classifier", "lightblue", self.btn_p300, LEFT) |
|
|
self.BtacCopy = makeBtn(self, "Tactile Copy", "lightblue", self.btn_tacCopy, LEFT) |
|
|
self.BtacCopy = makeBtn(self, "Tactile Copy", "lightblue", self.btn_tacCopy, LEFT) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
self.BtacControl.grid(row=0, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
self.BtacCal.grid(row=1, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
self.Bp300.grid(row=2, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
self.BtacCopy.grid(row=3, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
self.BtacQuest.grid(row=4, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# self.Bfilter.grid(row=0, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
# self.BtacCal.grid(row=1, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
# self.Bp300.grid(row=2, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
# self.BtacCopy.grid(row=3, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
# self.BtacQuest.grid(row=4, column=0, columnspan=1, sticky='EWNS') |
|
|
|
|
|
|
|
|
# 1. FILTER ################################## |
|
|
# 1. FILTER ################################## |
|
|
def btn_tactorControl(self): |
|
|
|
|
|
|
|
|
def btn_filter(self): |
|
|
print('Starte TactileBCIFilter.exe') |
|
|
print('Starte TactileBCIFilter.exe') |
|
|
os.startfile(pathTactileBciFilter + '\TactileBCIFilter.exe') |
|
|
os.startfile(pathTactileBciFilter + '\TactileBCIFilter.exe') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.startQuestions("Tactile") |
|
|
self.startQuestions("Tactile") |
|
|
# def btn_audQuest(self): |
|
|
# def btn_audQuest(self): |
|
|
# root.destroy() |
|
|
# root.destroy() |
|
|
# self.startQuestions("Auditory") |
|
|
|
|
|
|
|
|
# self.startQuestions("Auditory") |
|
|
|
|
|
|
|
|
def startQuestions(self, para): |
|
|
def startQuestions(self, para): |
|
|
print('starte Fragebogen') |
|
|
print('starte Fragebogen') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def global_close(self, window): |
|
|
def global_close(self, window): |
|
|
print('quitting?') |
|
|
print('quitting?') |
|
|
if tkMessageBox.askokcancel("Quit", "Nach einer BCI Sitzung bitte an den Fragebogen denken! :) OK zum Beenden."): |
|
|
|
|
|
window.destroy() |
|
|
|
|
|
|
|
|
window.destroy() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
root = Tk() |
|
|
|
|
|
|
|
|
root = Tk() |
|
|
|
|
|
|
|
|
def on_closing(): |
|
|
|
|
|
#self.global_close(root) |
|
|
|
|
|
print('quitting?') |
|
|
|
|
|
root.destroy() |
|
|
|
|
|
|
|
|
root.protocol("WM_DELETE_WINDOW", on_closing) |
|
|
root.protocol("WM_DELETE_WINDOW", on_closing) |
|
|
app = App(root) |
|
|
app = App(root) |
|
|
root.mainloop() |
|
|
root.mainloop() |