Browse Source

Implement Python3 Functionality Fixes

master
bci 4 years ago
parent
commit
237ce7e164
1 changed files with 35 additions and 32 deletions
  1. 35
    32
      app.py

+ 35
- 32
app.py View File

@@ -2,15 +2,15 @@
"""
Created on Fri Sep 4 11:36:24 2020

@author:
@author:
V0.1 Matthias Eidel
V0.2 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

# own code:
@@ -37,22 +37,20 @@ pathP300Classifier = r'C:\Users\bci\Desktop\Igor\PythonBCIgui_v0.2\bin'
class App:

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
textHsmall = 2
textW = 8
def makeBtn(self, text, bg, command, side):
self.button = Button(frame, text=text, bg=bg, command=command)
self.button.config( height = textH, width = textW )
@@ -64,14 +62,14 @@ class App:
self.button = Button(frame, text=text, bg=bg, command=command)
self.button.config( height = textHsmall, width = textW )
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.pack()
frame.pack()

# 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.Bp300 = makeBtn(self, "3. P300 Classifier", "lightblue", self.btn_p300, LEFT)
self.BtacCopy = makeBtn(self, "Tactile Copy", "lightblue", self.btn_tacCopy, LEFT)
@@ -79,15 +77,15 @@ class App:

frame.rowconfigure((0,1), weight=1) # make buttons stretch when
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 ##################################
def btn_tactorControl(self):
def btn_filter(self):
print('Starte TactileBCIFilter.exe')
os.startfile(pathTactileBciFilter + '\TactileBCIFilter.exe')

@@ -116,7 +114,7 @@ class App:
self.startQuestions("Tactile")
# def btn_audQuest(self):
# root.destroy()
# self.startQuestions("Auditory")
# self.startQuestions("Auditory")

def startQuestions(self, para):
print('starte Fragebogen')
@@ -130,11 +128,16 @@ class App:

def global_close(self, window):
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)
app = App(root)
root.mainloop()

Loading…
Cancel
Save