addFilemanagment
This commit is contained in:
parent
9a08c137d1
commit
7028038643
@ -0,0 +1,2 @@
|
|||||||
|
# OpenViBE_visual_BCI
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,7 @@
|
|||||||
import UIModellVisuell as modelVisuell
|
import UIModellVisuell as modelVisuell
|
||||||
import UIModellTaktil as modelsTaktil
|
import UIModellTaktil as modelsTaktil
|
||||||
import UIViewTKinter as viewTkinter
|
import UIViewTKinter as viewTkinter
|
||||||
|
from shutil import copyfile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -9,6 +10,8 @@ class Controller():
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.view = viewTkinter.View(self)
|
self.view = viewTkinter.View(self)
|
||||||
self.modi = "visuellesBCI"
|
self.modi = "visuellesBCI"
|
||||||
|
self.pathOVFile = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/signals/p300-xdawn-train2.ov"
|
||||||
|
self.infotext = ""
|
||||||
|
|
||||||
self.commands = {
|
self.commands = {
|
||||||
"copySpelling": self.commandoCopySpelling,
|
"copySpelling": self.commandoCopySpelling,
|
||||||
@ -16,12 +19,13 @@ class Controller():
|
|||||||
"freeSpelling": self.commandFreeSpelling,
|
"freeSpelling": self.commandFreeSpelling,
|
||||||
"test": self.test,
|
"test": self.test,
|
||||||
"wechsel": self.wechsel,
|
"wechsel": self.wechsel,
|
||||||
"speicherort": self.speicherort
|
"speicherort": self.setDataset
|
||||||
}
|
}
|
||||||
|
|
||||||
self.nexts = {
|
self.nexts = {
|
||||||
"filterXdawn" : self.filterXdawn,
|
"filterXdawn" : self.filterXdawn,
|
||||||
"filterClassic": self.filterClassic
|
"filterClassic": self.filterClassic,
|
||||||
|
"save": self.speichern
|
||||||
}
|
}
|
||||||
|
|
||||||
self.pagesTaktil = {
|
self.pagesTaktil = {
|
||||||
@ -66,11 +70,17 @@ class Controller():
|
|||||||
self.view.setChangeBtnText("Wechsel zu visuellen BCI")
|
self.view.setChangeBtnText("Wechsel zu visuellen BCI")
|
||||||
self.modi = "taktilesBCI"
|
self.modi = "taktilesBCI"
|
||||||
|
|
||||||
def speicherort(self):
|
def speichern(self):
|
||||||
pass
|
print("saveFile")
|
||||||
|
copyfile(self.pathOVFile, self.file)
|
||||||
|
|
||||||
|
def setDataset(self):
|
||||||
|
file = self.view.openfiledialog()
|
||||||
|
copyfile(file, self.pathOVFile)
|
||||||
|
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
|
self.file = self.view.savefiledialog()
|
||||||
if(self.modi == "taktilesBCI"):
|
if(self.modi == "taktilesBCI"):
|
||||||
self.model = modelsTaktil.Modell(self)
|
self.model = modelsTaktil.Modell(self)
|
||||||
elif(self.modi == "visuellesBCI"):
|
elif(self.modi == "visuellesBCI"):
|
||||||
@ -80,6 +90,7 @@ class Controller():
|
|||||||
|
|
||||||
#wird durch Btn gestartet -> startet copyspelling als thread
|
#wird durch Btn gestartet -> startet copyspelling als thread
|
||||||
def commandoCopySpelling(self):
|
def commandoCopySpelling(self):
|
||||||
|
self.file = self.view.savefiledialog()
|
||||||
if(self.modi == "taktilesBCI"):
|
if(self.modi == "taktilesBCI"):
|
||||||
self.model = modelsTaktil.Modell(self)
|
self.model = modelsTaktil.Modell(self)
|
||||||
elif(self.modi == "visuellesBCI"):
|
elif(self.modi == "visuellesBCI"):
|
||||||
@ -116,7 +127,7 @@ class Controller():
|
|||||||
|
|
||||||
def commandStop(self):
|
def commandStop(self):
|
||||||
if(self.model is not None):
|
if(self.model is not None):
|
||||||
self.setInfos("Action: STOP-Command")
|
self.addInfoText("Action: STOP-Command")
|
||||||
self.model.stop()
|
self.model.stop()
|
||||||
self.model.join()
|
self.model.join()
|
||||||
self.model.killProzess()
|
self.model.killProzess()
|
||||||
@ -133,8 +144,12 @@ class Controller():
|
|||||||
func = self.nexts.get(next)
|
func = self.nexts.get(next)
|
||||||
func()
|
func()
|
||||||
|
|
||||||
def setInfos(self,text):
|
def addInfoText(self,text):
|
||||||
self.view.setInfoText(text)
|
self.infotext = self.infotext + text
|
||||||
|
self.view.setInfoText(self.infotext)
|
||||||
|
|
||||||
|
def resetInfo(self):
|
||||||
|
self.infotext = ""
|
||||||
|
|
||||||
def setTitle(self,text):
|
def setTitle(self,text):
|
||||||
self.view.setTitleText(text)
|
self.view.setTitleText(text)
|
||||||
|
Binary file not shown.
@ -11,7 +11,6 @@ class Modell(Thread):
|
|||||||
self.controller = c
|
self.controller = c
|
||||||
self.aktiv= True
|
self.aktiv= True
|
||||||
self.openVibeAktiv = False
|
self.openVibeAktiv = False
|
||||||
self.infoText = ''
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
print("stop thread")
|
print("stop thread")
|
||||||
@ -35,8 +34,8 @@ class Modell(Thread):
|
|||||||
|
|
||||||
def startCopySpelling(self):
|
def startCopySpelling(self):
|
||||||
print("start copySpelling")
|
print("start copySpelling")
|
||||||
self.infoText = 'start copyspelling -- '
|
self.controller.resetInfo()
|
||||||
self.controller.setInfos(self.infoText)
|
self.controller.addInfoText('start copyspelling -- ')
|
||||||
self.controller.setTitle("Copy Spelling")
|
self.controller.setTitle("Copy Spelling")
|
||||||
path = self.PATH_FILES + 'p300-visual-1-acquisition.xml'
|
path = self.PATH_FILES + 'p300-visual-1-acquisition.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
@ -51,14 +50,13 @@ class Modell(Thread):
|
|||||||
if(x != -1):
|
if(x != -1):
|
||||||
print("Training finished")
|
print("Training finished")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.infoText = self.infoText + 'finished Copyspelling\n'
|
self.controller.addInfoText('finished Copyspelling\n')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
self.controller.stop("filterXdawn")
|
self.controller.stop("filterXdawn")
|
||||||
break
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim Copyspelling aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim Copyspelling aufgetaucht\n")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
break
|
break
|
||||||
@ -70,8 +68,7 @@ class Modell(Thread):
|
|||||||
|
|
||||||
def trainXDawn(self):
|
def trainXDawn(self):
|
||||||
print("start training Xdawn")
|
print("start training Xdawn")
|
||||||
self.infoText = self.infoText + 'start training XDawn -- '
|
self.controller.addInfoText('start training XDawn -- ')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
path = self.PATH_FILES + 'p300-visual-2-train-xDAWN.xml'
|
path = self.PATH_FILES + 'p300-visual-2-train-xDAWN.xml'
|
||||||
#path = 'Projekte/test.xml'
|
#path = 'Projekte/test.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
@ -86,14 +83,13 @@ class Modell(Thread):
|
|||||||
if(x != -1):
|
if(x != -1):
|
||||||
print("Training finished")
|
print("Training finished")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.infoText = self.infoText + 'finished Training\n'
|
self.controller.addInfoText('finished Training\n')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
self.controller.stop("filterClassic")
|
self.controller.stop("filterClassic")
|
||||||
break
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim XDawn Training aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim XDawn Training aufgetaucht\n")
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
process.terminate()
|
process.terminate()
|
||||||
break
|
break
|
||||||
@ -105,8 +101,7 @@ class Modell(Thread):
|
|||||||
|
|
||||||
def trainClassifier(self):
|
def trainClassifier(self):
|
||||||
print("start training Classifier")
|
print("start training Classifier")
|
||||||
self.infoText = self.infoText + "start training with Classifier -- "
|
self.controller.addInfoText("start training with Classifier -- ")
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
|
|
||||||
path = self.PATH_FILES + 'p300-visual-3-train-classifier.xml'
|
path = self.PATH_FILES + 'p300-visual-3-train-classifier.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
@ -125,14 +120,14 @@ class Modell(Thread):
|
|||||||
#counter = 18
|
#counter = 18
|
||||||
if(counter >= 17):
|
if(counter >= 17):
|
||||||
print("Training finished")
|
print("Training finished")
|
||||||
self.infoText = self.infoText + 'finished Training\n'
|
self.controller.addInfoText('finished Training\n')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
process.terminate()
|
process.terminate()
|
||||||
|
self.controller.stop("save")
|
||||||
break
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim Classifier Training aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim Classifier Training aufgetaucht\n")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
break
|
break
|
||||||
elif(accuracy != -1):
|
elif(accuracy != -1):
|
||||||
@ -144,8 +139,8 @@ class Modell(Thread):
|
|||||||
def freeSpelling(self):
|
def freeSpelling(self):
|
||||||
#bei error auch abrechen?
|
#bei error auch abrechen?
|
||||||
print("start freeSpelling")
|
print("start freeSpelling")
|
||||||
self.infoText = 'start free spelling -- '
|
self.controller.resetInfo()
|
||||||
self.controller.setInfos(self.infoText)
|
self.controller.addInfoText('start free spelling -- ')
|
||||||
path = self.PATH_FILES + 'p300-visual-4-online.xml'
|
path = self.PATH_FILES + 'p300-visual-4-online.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
stdout=PIPE,
|
stdout=PIPE,
|
||||||
@ -159,15 +154,14 @@ class Modell(Thread):
|
|||||||
if(x != -1):
|
if(x != -1):
|
||||||
print("End Spelling")
|
print("End Spelling")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.infoText = self.infoText + 'finished freespelling\n'
|
self.controller.addInfoText('finished freespelling\n')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
break
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim Freespelling aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim Freespelling aufgetaucht\n")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
break
|
break
|
||||||
|
Binary file not shown.
@ -11,7 +11,6 @@ class Modell(Thread):
|
|||||||
self.controller = c
|
self.controller = c
|
||||||
self.aktiv= True
|
self.aktiv= True
|
||||||
self.openVibeAktiv = False
|
self.openVibeAktiv = False
|
||||||
self.infoText = ''
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
print("stop thread")
|
print("stop thread")
|
||||||
@ -35,14 +34,14 @@ class Modell(Thread):
|
|||||||
|
|
||||||
def startCopySpelling(self):
|
def startCopySpelling(self):
|
||||||
print("start copySpelling")
|
print("start copySpelling")
|
||||||
self.infoText = 'start copyspelling -- '
|
self.controller.resetInfo()
|
||||||
self.controller.setInfos(self.infoText)
|
self.controller.addInfoText('start copyspelling -- ')
|
||||||
self.controller.setTitle("Copy Spelling")
|
self.controller.setTitle("Copy Spelling")
|
||||||
path = self.PATH_FILES + 'p300-visual-1-acquisition.xml'
|
path = self.PATH_FILES + 'p300-visual-1-acquisition.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
stdout=PIPE,
|
stdout=PIPE,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
self.openVibeAktiv = True
|
self.openVibeAktiv = True
|
||||||
while True:
|
while True:
|
||||||
output = process.stdout.readline()
|
output = process.stdout.readline()
|
||||||
print(output.strip())
|
print(output.strip())
|
||||||
@ -51,17 +50,17 @@ class Modell(Thread):
|
|||||||
if(x != -1):
|
if(x != -1):
|
||||||
print("Training finished")
|
print("Training finished")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.infoText = self.infoText + 'finished Copyspelling\n'
|
self.controller.addInfoText('finished Copyspelling\n')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
self.controller.stop("filterXdawn")
|
self.controller.stop("filterXdawn")
|
||||||
break
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim Copyspelling aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim Copyspelling aufgetaucht\n")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
#self.killProzess()
|
#self.killProzess()
|
||||||
@ -69,9 +68,9 @@ class Modell(Thread):
|
|||||||
|
|
||||||
def trainXDawn(self):
|
def trainXDawn(self):
|
||||||
print("start training Xdawn")
|
print("start training Xdawn")
|
||||||
self.infoText = self.infoText + 'start training XDawn -- '
|
self.controller.addInfoText('start training XDawn -- ')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
path = self.PATH_FILES + 'p300-visual-2-train-xDAWN.xml'
|
path = self.PATH_FILES + 'p300-visual-2-train-xDAWN.xml'
|
||||||
|
#path = 'Projekte/test.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
stdout=PIPE,
|
stdout=PIPE,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
@ -84,14 +83,13 @@ class Modell(Thread):
|
|||||||
if(x != -1):
|
if(x != -1):
|
||||||
print("Training finished")
|
print("Training finished")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.infoText = self.infoText + 'finished Training\n'
|
self.controller.addInfoText('finished Training\n')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
self.controller.stop("filterClassic")
|
self.controller.stop("filterClassic")
|
||||||
break
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim XDawn Training aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim XDawn Training aufgetaucht\n")
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
process.terminate()
|
process.terminate()
|
||||||
break
|
break
|
||||||
@ -103,31 +101,37 @@ class Modell(Thread):
|
|||||||
|
|
||||||
def trainClassifier(self):
|
def trainClassifier(self):
|
||||||
print("start training Classifier")
|
print("start training Classifier")
|
||||||
self.infoText = self.infoText + "start training with Classifier -- "
|
self.controller.addInfoText("start training with Classifier -- ")
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
|
|
||||||
path = self.PATH_FILES + 'p300-visual-3-train-classifier.xml'
|
path = self.PATH_FILES + 'p300-visual-3-train-classifier.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
stdout=PIPE,
|
stdout=PIPE,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
self.openVibeAktiv = True
|
self.openVibeAktiv = True
|
||||||
|
counter = 0
|
||||||
while True:
|
while True:
|
||||||
output = process.stdout.readline()
|
output = process.stdout.readline()
|
||||||
print(output.strip())
|
print(output.strip())
|
||||||
x = output.find("schlagwort?")
|
x = output.find("aka Classifier trainer")
|
||||||
|
accuracy = output.find("Training set accuracy is")
|
||||||
y = output.find("Error")
|
y = output.find("Error")
|
||||||
if(x != -1):
|
if(x != -1):
|
||||||
print("Training finished")
|
counter = counter +1
|
||||||
self.infoText = self.infoText + 'finished Training\n'
|
#counter = 18
|
||||||
self.controller.setInfos(self.infoText)
|
if(counter >= 17):
|
||||||
process.terminate()
|
print("Training finished")
|
||||||
break
|
self.controller.addInfoText('finished Training\n')
|
||||||
|
process.terminate()
|
||||||
|
self.controller.stop("save")
|
||||||
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim Classifier Training aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim Classifier Training aufgetaucht\n")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
break
|
break
|
||||||
|
elif(accuracy != -1):
|
||||||
|
print("ACCURACY" + output)
|
||||||
|
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
@ -135,8 +139,8 @@ class Modell(Thread):
|
|||||||
def freeSpelling(self):
|
def freeSpelling(self):
|
||||||
#bei error auch abrechen?
|
#bei error auch abrechen?
|
||||||
print("start freeSpelling")
|
print("start freeSpelling")
|
||||||
self.infoText = 'start free spelling -- '
|
self.controller.resetInfo()
|
||||||
self.controller.setInfos(self.infoText)
|
self.controller.addInfoText('start free spelling -- ')
|
||||||
path = self.PATH_FILES + 'p300-visual-4-online.xml'
|
path = self.PATH_FILES + 'p300-visual-4-online.xml'
|
||||||
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
process = Popen(['bash', self.PATH_OV, '--play', path, '--no-gui'],
|
||||||
stdout=PIPE,
|
stdout=PIPE,
|
||||||
@ -150,15 +154,14 @@ class Modell(Thread):
|
|||||||
if(x != -1):
|
if(x != -1):
|
||||||
print("End Spelling")
|
print("End Spelling")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.infoText = self.infoText + 'finished freespelling\n'
|
self.controller.addInfoText('finished freespelling\n')
|
||||||
self.controller.setInfos(self.infoText)
|
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
break
|
break
|
||||||
elif(y != -1 ):
|
elif(y != -1 ):
|
||||||
print("Error occured")
|
print("Error occured")
|
||||||
self.controller.changeScreen("StartPage")
|
self.controller.changeScreen("StartPage")
|
||||||
self.controller.setInfos(self.infoText + "Fehler beim Freespelling aufgetaucht\n")
|
self.controller.addInfoText("Fehler beim Freespelling aufgetaucht\n")
|
||||||
process.terminate()
|
process.terminate()
|
||||||
self.controller.stop()
|
self.controller.stop()
|
||||||
break
|
break
|
||||||
@ -185,7 +188,4 @@ class Modell(Thread):
|
|||||||
Popen(["kill", "-TERM", str(pidOV)], stdout=PIPE).communicate()
|
Popen(["kill", "-TERM", str(pidOV)], stdout=PIPE).communicate()
|
||||||
|
|
||||||
|
|
||||||
print("killed openvibe-designer")
|
print("killed openvibe-designer")
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
@ -1,7 +1,9 @@
|
|||||||
try:
|
try:
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
|
import tkFileDialog as fd
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
|
from tkinter import filedialog as fd
|
||||||
|
|
||||||
#from tkinter import font
|
#from tkinter import font
|
||||||
from UIController import *
|
from UIController import *
|
||||||
@ -63,8 +65,9 @@ class View(Tk):
|
|||||||
def createTopFrame(self):
|
def createTopFrame(self):
|
||||||
self.topFrame = Frame(self, bg=self.layout["backgroundBar"], height=50, width=500)
|
self.topFrame = Frame(self, bg=self.layout["backgroundBar"], height=50, width=500)
|
||||||
self.changeBtn = Button(self.topFrame, text="Wechsel zu taktilen BCI", command=lambda: self.controller.actionPerformed("wechsel"), height=2, width = 25, font=self.layout["fontSmall"], bg=self.layout["backgroundBtn"], fg=self.layout["fontColor"])
|
self.changeBtn = Button(self.topFrame, text="Wechsel zu taktilen BCI", command=lambda: self.controller.actionPerformed("wechsel"), height=2, width = 25, font=self.layout["fontSmall"], bg=self.layout["backgroundBtn"], fg=self.layout["fontColor"])
|
||||||
self.saveBtn = Button(self.topFrame, text="Aenderung des Speicherorts", command=lambda: self.controller.actionPerformed("speicherort"), height=2, width = 25, font=self.layout["fontSmall"], bg=self.layout["backgroundBtn"], fg=self.layout["fontColor"])
|
self.saveBtn = Button(self.topFrame, text="Auswaehlen der Datei", command=lambda: self.controller.actionPerformed("speicherort"), height=2, width = 25, font=self.layout["fontSmall"], bg=self.layout["backgroundBtn"], fg=self.layout["fontColor"])
|
||||||
self.toplabel = Label(self.topFrame, text="visuelles Buchstabieren", font=self.layout["font"], bg=self.layout["backgroundBar"], fg=self.layout["fontColor"], )
|
#self.setBtn = Button(self.topFrame, text="Auswaehlen der Datei", command=lambda: self.controller.actionPerformed("setFile"), height=2, width = 25, font=self.layout["fontSmall"], bg=self.layout["backgroundBtn"], fg=self.layout["fontColor"])
|
||||||
|
self.toplabel = Label(self.topFrame, text="visuelles BCI", font=self.layout["font"], bg=self.layout["backgroundBar"], fg=self.layout["fontColor"], )
|
||||||
|
|
||||||
self.topFrame.grid(column=0, row=0)
|
self.topFrame.grid(column=0, row=0)
|
||||||
self.topFrame.grid_propagate(0)
|
self.topFrame.grid_propagate(0)
|
||||||
@ -72,6 +75,7 @@ class View(Tk):
|
|||||||
|
|
||||||
self.changeBtn.grid(column=0, row=0, padx=10,pady=5)
|
self.changeBtn.grid(column=0, row=0, padx=10,pady=5)
|
||||||
self.saveBtn.grid(column=1, row=0, padx=10, pady=5)
|
self.saveBtn.grid(column=1, row=0, padx=10, pady=5)
|
||||||
|
#self.setBtn.grid(column=2, row=0, padx=10, pady=5)
|
||||||
self.toplabel.grid(column=2, row=0, padx=100, pady=2)
|
self.toplabel.grid(column=2, row=0, padx=100, pady=2)
|
||||||
|
|
||||||
def createMainFrame(self):
|
def createMainFrame(self):
|
||||||
@ -114,6 +118,16 @@ class View(Tk):
|
|||||||
def setChangeBtnText(self,text):
|
def setChangeBtnText(self,text):
|
||||||
self.changeBtn["text"] = text
|
self.changeBtn["text"] = text
|
||||||
|
|
||||||
|
def openfiledialog(self):
|
||||||
|
path = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets"
|
||||||
|
file = fd.askopenfilename(initialdir=path)
|
||||||
|
return file
|
||||||
|
|
||||||
|
def savefiledialog(self):
|
||||||
|
path = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets"
|
||||||
|
file = fd.asksaveasfilename(initialdir=path)
|
||||||
|
return file
|
||||||
|
|
||||||
|
|
||||||
class StartPage(Frame):
|
class StartPage(Frame):
|
||||||
def __init__(self, parent, controller, layout):
|
def __init__(self, parent, controller, layout):
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user