You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UIController.py 989B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from UIModell import *
  2. import UIViewTKinter as viewTkinter
  3. import UIViewPySide as viewPySide
  4. class Controller():
  5. def __init__(self):
  6. self.model = Modell(self)
  7. self.view = viewTkinter.View(self)
  8. self.commands = {
  9. "copySpelling": self.commandoCopySpelling,
  10. "stop": self.commandStop,
  11. "freeSpelling": self.commandFreeSpelling,
  12. "test": self.test
  13. }
  14. self.view.mainloop()
  15. def actionPerformed(self, action):
  16. func = self.commands.get(action)
  17. if(func is not None):
  18. func()
  19. else:
  20. print("Kommado existiert nicht")
  21. def test(self):
  22. self.model.trainXDawn()
  23. def commandoCopySpelling(self):
  24. self.model.startCopySpelling()
  25. self.model.trainXDawn()
  26. self.model.rainClassifier()
  27. def commandFreeSpelling(self):
  28. self.model.freeSpelling()
  29. def commandStop(self):
  30. self.model.killProzess()