BCIgui/Masterarbeit/UIController.py

44 lines
989 B
Python
Raw Normal View History

2021-10-14 11:47:35 +00:00
from UIModell import *
2021-10-20 10:44:18 +00:00
import UIViewTKinter as viewTkinter
import UIViewPySide as viewPySide
2021-10-14 11:47:35 +00:00
class Controller():
2021-10-20 10:44:18 +00:00
def __init__(self):
self.model = Modell(self)
self.view = viewTkinter.View(self)
self.commands = {
"copySpelling": self.commandoCopySpelling,
"stop": self.commandStop,
"freeSpelling": self.commandFreeSpelling,
"test": self.test
}
self.view.mainloop()
def actionPerformed(self, action):
func = self.commands.get(action)
if(func is not None):
func()
else:
print("Kommado existiert nicht")
2021-10-14 11:47:35 +00:00
def test(self):
self.model.trainXDawn()
def commandoCopySpelling(self):
self.model.startCopySpelling()
self.model.trainXDawn()
self.model.rainClassifier()
def commandFreeSpelling(self):
self.model.freeSpelling()
def commandStop(self):
self.model.killProzess()