Path nach ausen
This commit is contained in:
parent
7028038643
commit
29e2cf8850
@ -1,6 +0,0 @@
|
|||||||
<OpenViBE-SettingsOverride>
|
|
||||||
<SettingValue>-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 </SettingValue>
|
|
||||||
<SettingValue>2</SettingValue>
|
|
||||||
<SettingValue>16</SettingValue>
|
|
||||||
<SettingValue></SettingValue>
|
|
||||||
</OpenViBE-SettingsOverride>
|
|
@ -1,5 +1,5 @@
|
|||||||
import UIModellVisuell as modelVisuell
|
from UIModellVisuell import *
|
||||||
import UIModellTaktil as modelsTaktil
|
from UIModellTaktil import *
|
||||||
import UIViewTKinter as viewTkinter
|
import UIViewTKinter as viewTkinter
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
|
|
||||||
@ -7,10 +7,12 @@ from shutil import copyfile
|
|||||||
|
|
||||||
class Controller():
|
class Controller():
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, pathOVFile, path_ov, path_files, path_default):
|
||||||
self.view = viewTkinter.View(self)
|
self.view = viewTkinter.View(self, path_default)
|
||||||
self.modi = "visuellesBCI"
|
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.infotext = ""
|
||||||
|
|
||||||
self.commands = {
|
self.commands = {
|
||||||
@ -82,9 +84,9 @@ class Controller():
|
|||||||
def test(self):
|
def test(self):
|
||||||
self.file = self.view.savefiledialog()
|
self.file = self.view.savefiledialog()
|
||||||
if(self.modi == "taktilesBCI"):
|
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"):
|
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.setFunktion(self.model.trainXDawn)
|
||||||
self.model.start()
|
self.model.start()
|
||||||
|
|
||||||
@ -92,36 +94,36 @@ class Controller():
|
|||||||
def commandoCopySpelling(self):
|
def commandoCopySpelling(self):
|
||||||
self.file = self.view.savefiledialog()
|
self.file = self.view.savefiledialog()
|
||||||
if(self.modi == "taktilesBCI"):
|
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"):
|
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.setFunktion(self.model.startCopySpelling)
|
||||||
self.model.start()
|
self.model.start()
|
||||||
|
|
||||||
#wird durch Copy-Speller Thread copystelling gestartet -> startete filtern als thread
|
#wird durch Copy-Speller Thread copystelling gestartet -> startete filtern als thread
|
||||||
def filterXdawn(self):
|
def filterXdawn(self):
|
||||||
if(self.modi == "taktilesBCI"):
|
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"):
|
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.setFunktion(self.model.trainXDawn)
|
||||||
self.model.start()
|
self.model.start()
|
||||||
|
|
||||||
#wird durch XDawn-Thread copystelling gestartet -> startete filtern als thread
|
#wird durch XDawn-Thread copystelling gestartet -> startete filtern als thread
|
||||||
def filterClassic(self):
|
def filterClassic(self):
|
||||||
if(self.modi == "taktilesBCI"):
|
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"):
|
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.setFunktion(self.model.trainClassifier)
|
||||||
self.model.start()
|
self.model.start()
|
||||||
|
|
||||||
def commandFreeSpelling(self):
|
def commandFreeSpelling(self):
|
||||||
print("freespelling")
|
print("freespelling")
|
||||||
if(self.modi == "taktilesBCI"):
|
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"):
|
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.setFunktion(self.model.freeSpelling)
|
||||||
self.model.start()
|
self.model.start()
|
||||||
|
|
||||||
|
Binary file not shown.
27
Masterarbeit/UIModell.py
Normal file
27
Masterarbeit/UIModell.py
Normal file
@ -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
|
Binary file not shown.
@ -1,14 +1,15 @@
|
|||||||
from subprocess import *
|
from subprocess import *
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import time
|
import time
|
||||||
|
from UIModell import *
|
||||||
|
|
||||||
class Modell(Thread):
|
class ModellTaktil(Modell):
|
||||||
PATH_OV = 'meta/dist/designer-Release/openvibe-designer.sh'
|
|
||||||
PATH_FILES = 'Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/'
|
|
||||||
|
|
||||||
def __init__(self,c):
|
def __init__(self,c, path_ov, path_files):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
self.controller = c
|
Modell.__init__(self, c)
|
||||||
|
self.PATH_FILES = path_files
|
||||||
|
self.PATH_OV = path_ov
|
||||||
self.aktiv= True
|
self.aktiv= True
|
||||||
self.openVibeAktiv = False
|
self.openVibeAktiv = False
|
||||||
|
|
||||||
|
Binary file not shown.
@ -2,13 +2,15 @@ from subprocess import *
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
import time
|
import time
|
||||||
|
|
||||||
class Modell(Thread):
|
from UIModell import Modell
|
||||||
PATH_OV = 'meta/dist/designer-Release/openvibe-designer.sh'
|
|
||||||
PATH_FILES = 'Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/'
|
|
||||||
|
|
||||||
def __init__(self,c):
|
class ModellVisuell(Modell):
|
||||||
|
|
||||||
|
def __init__(self,c, path_ov, path_files):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
self.controller = c
|
Modell.__init__(self, c)
|
||||||
|
self.PATH_FILES = path_files
|
||||||
|
self.PATH_OV = path_ov
|
||||||
self.aktiv= True
|
self.aktiv= True
|
||||||
self.openVibeAktiv = False
|
self.openVibeAktiv = False
|
||||||
|
|
||||||
|
Binary file not shown.
@ -11,9 +11,10 @@ from UIController import *
|
|||||||
|
|
||||||
|
|
||||||
class View(Tk):
|
class View(Tk):
|
||||||
def __init__(self, c, *args, **kwargs):
|
def __init__(self, c, path_default, *args, **kwargs):
|
||||||
Tk.__init__(self, *args, **kwargs)
|
Tk.__init__(self, *args, **kwargs)
|
||||||
self.controller = c
|
self.controller = c
|
||||||
|
self.PATH_DEFAULT = path_default
|
||||||
self.title("Visuelles Spelling")
|
self.title("Visuelles Spelling")
|
||||||
self.h = 800
|
self.h = 800
|
||||||
self.w = 1000
|
self.w = 1000
|
||||||
@ -119,12 +120,12 @@ class View(Tk):
|
|||||||
self.changeBtn["text"] = text
|
self.changeBtn["text"] = text
|
||||||
|
|
||||||
def openfiledialog(self):
|
def openfiledialog(self):
|
||||||
path = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets"
|
path = self.PATH_DEFAULT
|
||||||
file = fd.askopenfilename(initialdir=path)
|
file = fd.askopenfilename(initialdir=path)
|
||||||
return file
|
return file
|
||||||
|
|
||||||
def savefiledialog(self):
|
def savefiledialog(self):
|
||||||
path = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets"
|
path = self.PATH_DEFAULT
|
||||||
file = fd.asksaveasfilename(initialdir=path)
|
file = fd.asksaveasfilename(initialdir=path)
|
||||||
return file
|
return file
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1,7 +1,8 @@
|
|||||||
from UIController import *
|
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 = Controller(pathOVFile= pathOVFile, path_ov= PATH_OV, path_files = PATH_FILES, path_default=PATH_DEFAULT)
|
||||||
|
|
||||||
|
|
||||||
#controller.test()
|
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
try:
|
from subprocess import *
|
||||||
from Tkinter import *
|
|
||||||
except ImportError:
|
|
||||||
from tkinter import *
|
|
||||||
|
|
||||||
root = Tk()
|
name = "firefox"
|
||||||
root.geometry('300x200')
|
positionX = 350
|
||||||
root.columnconfigure(0, weight=1) # Set weight to row and
|
positionY = 150
|
||||||
root.rowconfigure(0, weight=1) # column where the widget is
|
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()
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user