|
|
|
|
|
|
|
|
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()) |
|
|
|
|
|
|
|
|
process.terminate() |
|
|
process.terminate() |
|
|
self.controller.stop() |
|
|
self.controller.stop() |
|
|
break |
|
|
break |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.controller.stop() |
|
|
self.controller.stop() |
|
|
#self.killProzess() |
|
|
#self.killProzess() |
|
|
|
|
|
|
|
|
self.infoText = self.infoText + 'start training XDawn -- ' |
|
|
self.infoText = self.infoText + 'start training XDawn -- ' |
|
|
self.controller.setInfos(self.infoText) |
|
|
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) |
|
|
|
|
|
|
|
|
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") |
|
|
|
|
|
self.infoText = self.infoText + 'finished Training\n' |
|
|
|
|
|
self.controller.setInfos(self.infoText) |
|
|
|
|
|
process.terminate() |
|
|
|
|
|
break |
|
|
|
|
|
|
|
|
counter = counter +1 |
|
|
|
|
|
#counter = 18 |
|
|
|
|
|
if(counter >= 17): |
|
|
|
|
|
print("Training finished") |
|
|
|
|
|
self.infoText = self.infoText + 'finished Training\n' |
|
|
|
|
|
self.controller.setInfos(self.infoText) |
|
|
|
|
|
process.terminate() |
|
|
|
|
|
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.setInfos(self.infoText + "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() |