|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- from UIModell import *
- import UIViewTKinter as viewTkinter
- import UIViewPySide as viewPySide
- from threading import Thread
-
-
- class Controller():
-
- def __init__(self):
- self.view = viewTkinter.View(self)
-
- self.commands = {
- "copySpelling": self.commandoCopySpelling,
- "stop": self.commandStop,
- "freeSpelling": self.commandFreeSpelling,
- "test": self.test
- }
-
- self.pages = {
- "stop": "StartPage",
- "copySpelling": "WorkingPage",
- "freeSpelling": "WorkingPage",
- "test": "WorkingPage"
- }
- self.view.mainloop()
-
- def actionPerformed(self, action):
- self.view.changeFrame(self.pages.get(action))
- func = self.commands.get(action)
- if(func is not None):
- func()
- else:
- print("Kommado existiert nicht")
-
-
-
- def test(self):
- self.model = Modell(self)
- self.model.setFunktion(self.model.trainXDawn)
- self.model.start()
-
- #wird durch Btn gestartet -> startet copyspelling als thread
- def commandoCopySpelling(self):
- self.model = Modell(self)
- self.model.setFunktion(self.model.startCopySpelling)
- self.model.start()
-
- #wird durch Copy-Speller Thread copystelling gestartet -> startete filtern als thread
- def filterXdawn(self):
- #self.setTitle("start training Xdawn")
- #self.setInfos("start training Xdawn")
- self.model = Modell(self)
- self.model.setFunktion(self.model.trainXDawn)
- self.model.start()
-
- #wird durch XDawn-Thread copystelling gestartet -> startete filtern als thread
- def filterClassic(self):
- self.model = Modell(self)
- self.model.setFunktion(self.model.trainClassifier)
- self.model.start()
-
- def commandFreeSpelling(self):
- self.model.freeSpelling()
-
- def commandStop(self):
- self.model.stop()
- self.model.join()
- self.model.killProzess()
- self.mode = None
-
- def setInfos(self,text):
- self.view.setInfoText(text)
-
- def setTitle(self,text):
- self.view.setTitleText(text)
-
-
-
|