diff --git a/Masterarbeit/Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-spatial-filter.cfg b/Masterarbeit/Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-spatial-filter.cfg index 304c1f8..e69de29 100644 --- a/Masterarbeit/Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-spatial-filter.cfg +++ b/Masterarbeit/Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-spatial-filter.cfg @@ -1,6 +0,0 @@ - - -9.854506e-03 4.490459e-02 -2.235728e-02 3.564301e-02 -7.770992e-03 6.771856e-02 -1.015223e-02 1.494322e-03 6.786301e-02 1.430098e-01 5.039326e-02 -4.353548e-01 -5.419809e-01 2.169224e-01 3.499630e-01 -3.175689e-03 1.135831e-01 -2.099687e-01 2.703752e-01 -1.665248e-01 2.137575e-01 1.187045e-01 -1.959052e-01 -5.080815e-02 1.121617e-02 -2.612318e-01 -7.263354e-01 6.296948e-01 -3.519859e-01 -4.575292e-02 5.313071e-01 -2.527051e-02 - 2 - 16 - - \ No newline at end of file diff --git a/Masterarbeit/UIController.py b/Masterarbeit/UIController.py index 7371559..f3c0888 100644 --- a/Masterarbeit/UIController.py +++ b/Masterarbeit/UIController.py @@ -1,5 +1,5 @@ -import UIModellVisuell as modelVisuell -import UIModellTaktil as modelsTaktil +from UIModellVisuell import * +from UIModellTaktil import * import UIViewTKinter as viewTkinter from shutil import copyfile @@ -7,10 +7,12 @@ from shutil import copyfile class Controller(): - def __init__(self): - self.view = viewTkinter.View(self) + def __init__(self, pathOVFile, path_ov, path_files, path_default): + self.view = viewTkinter.View(self, path_default) self.modi = "visuellesBCI" - self.pathOVFile = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/signals/p300-xdawn-train2.ov" + self.pathOVFile = pathOVFile + self.PATH_OV = path_ov + self.PATH_FILES = path_files self.infotext = "" self.commands = { @@ -82,9 +84,9 @@ class Controller(): def test(self): self.file = self.view.savefiledialog() if(self.modi == "taktilesBCI"): - self.model = modelsTaktil.Modell(self) + self.model = ModellTaktil(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) elif(self.modi == "visuellesBCI"): - self.model = modelVisuell.Modell(self) + self.model = ModellVisuell(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) self.model.setFunktion(self.model.trainXDawn) self.model.start() @@ -92,36 +94,36 @@ class Controller(): def commandoCopySpelling(self): self.file = self.view.savefiledialog() if(self.modi == "taktilesBCI"): - self.model = modelsTaktil.Modell(self) + self.model = ModellTaktil(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) elif(self.modi == "visuellesBCI"): - self.model = modelVisuell.Modell(self) + self.model = ModellVisuell(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) self.model.setFunktion(self.model.startCopySpelling) self.model.start() #wird durch Copy-Speller Thread copystelling gestartet -> startete filtern als thread def filterXdawn(self): if(self.modi == "taktilesBCI"): - self.model = modelsTaktil.Modell(self) + self.model = ModellTaktil(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) elif(self.modi == "visuellesBCI"): - self.model = modelVisuell.Modell(self) + self.model = ModellVisuell(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) self.model.setFunktion(self.model.trainXDawn) self.model.start() #wird durch XDawn-Thread copystelling gestartet -> startete filtern als thread def filterClassic(self): if(self.modi == "taktilesBCI"): - self.model = modelsTaktil.Modell(self) + self.model = ModellTaktil(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) elif(self.modi == "visuellesBCI"): - self.model = modelVisuell.Modell(self) + self.model = ModellVisuell(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) self.model.setFunktion(self.model.trainClassifier) self.model.start() def commandFreeSpelling(self): print("freespelling") if(self.modi == "taktilesBCI"): - self.model = modelsTaktil.Modell(self) + self.model = ModellTaktil(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) elif(self.modi == "visuellesBCI"): - self.model = modelVisuell.Modell(self) + self.model = ModellVisuell(self, path_files= self.PATH_FILES, path_ov= self.PATH_OV) self.model.setFunktion(self.model.freeSpelling) self.model.start() diff --git a/Masterarbeit/UIController.pyc b/Masterarbeit/UIController.pyc index e11752c..8e53c1c 100644 Binary files a/Masterarbeit/UIController.pyc and b/Masterarbeit/UIController.pyc differ diff --git a/Masterarbeit/UIModell.py b/Masterarbeit/UIModell.py new file mode 100644 index 0000000..3f6ab25 --- /dev/null +++ b/Masterarbeit/UIModell.py @@ -0,0 +1,27 @@ +from subprocess import * +from threading import Thread +import time + +class Modell(Thread): + + def __init__(self,c): + Thread.__init__(self) + self.controller = c + + def setFunktion(self, func, args=None, kwargs=None): + pass + + def startCopySpelling(self): + pass + + def trainXDawn(self): + pass + + def trainClassifier(self): + pass + + def freeSpelling(self): + pass + + def killProzess(self): + pass \ No newline at end of file diff --git a/Masterarbeit/UIModell.pyc b/Masterarbeit/UIModell.pyc index f48851e..468f695 100644 Binary files a/Masterarbeit/UIModell.pyc and b/Masterarbeit/UIModell.pyc differ diff --git a/Masterarbeit/UIModellTaktil.py b/Masterarbeit/UIModellTaktil.py index 5eb4d0b..034349b 100644 --- a/Masterarbeit/UIModellTaktil.py +++ b/Masterarbeit/UIModellTaktil.py @@ -1,14 +1,15 @@ from subprocess import * from threading import Thread import time +from UIModell import * -class Modell(Thread): - PATH_OV = 'meta/dist/designer-Release/openvibe-designer.sh' - PATH_FILES = 'Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/' +class ModellTaktil(Modell): - def __init__(self,c): + def __init__(self,c, path_ov, path_files): Thread.__init__(self) - self.controller = c + Modell.__init__(self, c) + self.PATH_FILES = path_files + self.PATH_OV = path_ov self.aktiv= True self.openVibeAktiv = False diff --git a/Masterarbeit/UIModellTaktil.pyc b/Masterarbeit/UIModellTaktil.pyc index 8f8d5ee..102e8bb 100644 Binary files a/Masterarbeit/UIModellTaktil.pyc and b/Masterarbeit/UIModellTaktil.pyc differ diff --git a/Masterarbeit/UIModellVisuell.py b/Masterarbeit/UIModellVisuell.py index fdc5d21..3314854 100644 --- a/Masterarbeit/UIModellVisuell.py +++ b/Masterarbeit/UIModellVisuell.py @@ -2,13 +2,15 @@ from subprocess import * from threading import Thread import time -class Modell(Thread): - PATH_OV = 'meta/dist/designer-Release/openvibe-designer.sh' - PATH_FILES = 'Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/' +from UIModell import Modell - def __init__(self,c): +class ModellVisuell(Modell): + + def __init__(self,c, path_ov, path_files): Thread.__init__(self) - self.controller = c + Modell.__init__(self, c) + self.PATH_FILES = path_files + self.PATH_OV = path_ov self.aktiv= True self.openVibeAktiv = False diff --git a/Masterarbeit/UIModellVisuell.pyc b/Masterarbeit/UIModellVisuell.pyc index 79ff731..c26db71 100644 Binary files a/Masterarbeit/UIModellVisuell.pyc and b/Masterarbeit/UIModellVisuell.pyc differ diff --git a/Masterarbeit/UIViewTKinter.py b/Masterarbeit/UIViewTKinter.py index 4ccf236..9b841fb 100644 --- a/Masterarbeit/UIViewTKinter.py +++ b/Masterarbeit/UIViewTKinter.py @@ -11,9 +11,10 @@ from UIController import * class View(Tk): - def __init__(self, c, *args, **kwargs): + def __init__(self, c, path_default, *args, **kwargs): Tk.__init__(self, *args, **kwargs) self.controller = c + self.PATH_DEFAULT = path_default self.title("Visuelles Spelling") self.h = 800 self.w = 1000 @@ -119,12 +120,12 @@ class View(Tk): self.changeBtn["text"] = text def openfiledialog(self): - path = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets" + path = self.PATH_DEFAULT file = fd.askopenfilename(initialdir=path) return file def savefiledialog(self): - path = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets" + path = self.PATH_DEFAULT file = fd.asksaveasfilename(initialdir=path) return file diff --git a/Masterarbeit/UIViewTKinter.pyc b/Masterarbeit/UIViewTKinter.pyc index 537d1a2..2a563b8 100644 Binary files a/Masterarbeit/UIViewTKinter.pyc and b/Masterarbeit/UIViewTKinter.pyc differ diff --git a/Masterarbeit/gui.py b/Masterarbeit/gui.py index c2bae15..adb160f 100644 --- a/Masterarbeit/gui.py +++ b/Masterarbeit/gui.py @@ -1,7 +1,8 @@ from UIController import * +PATH_OV = 'meta/dist/designer-Release/openvibe-designer.sh' +PATH_FILES = 'Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/' +pathOVFile = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/signals/p300-xdawn-train2.ov" +PATH_DEFAULT = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets" -controller = Controller() - - -#controller.test() \ No newline at end of file +controller = Controller(pathOVFile= pathOVFile, path_ov= PATH_OV, path_files = PATH_FILES, path_default=PATH_DEFAULT) diff --git a/Masterarbeit/test.py b/Masterarbeit/test.py index c139d2e..b427f67 100644 --- a/Masterarbeit/test.py +++ b/Masterarbeit/test.py @@ -1,22 +1,16 @@ -try: - from Tkinter import * -except ImportError: - from tkinter import * +from subprocess import * -root = Tk() -root.geometry('300x200') -root.columnconfigure(0, weight=1) # Set weight to row and -root.rowconfigure(0, weight=1) # column where the widget is +name = "firefox" +positionX = 350 +positionY = 150 +width = 500 +height = 400 +windowID = Popen(["xdotool", "search", "--onlyvisible", "--name", name], stdout=PIPE).communicate()[0].strip() +Popen(["xdotool", "windowsize", windowID, str(width), str(height)], stdout=PIPE).communicate() +Popen(["xdotool", "windowmove", windowID, str(positionX), str(positionY)], stdout=PIPE).communicate() +Popen(["xdotool", "windowactivate", windowID], stdout=PIPE).communicate()[0].strip() + +#windowminimize ums ein fenster klein zu machen -container = Frame(root, bg='tan') # bg color to show extent -container.grid(row=0, column=0) # Grid cell with weight - -# A couple of widgets to illustrate the principle. -b1 = Button(container, text='First', width=10) -b1.grid() -b2 = Button(container, text='second', width=10) -b2.grid() - -root.mainloop()