123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- from UIModell import *
- import UIViewTKinter as viewTkinter
- import UIViewPySide as viewPySide
- from threading import Thread
-
-
- class Controller():
-
- 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.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.thread = Thread(target=self.model.trainXDawn)
- self.thread.start()
- #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()
- self.thread.join()
-
|