Esempio n. 1
0
def start_bv_recorder(self):
    # save to filename TODAY_DIR BASENAME VP_CODE
    # TODAY_DIR => D:\data\bbciRaw\bla\
    # BASENAME+VP_CODE = filebase
    # actual save target: TODAY_DIR\filebase
    print "Starting BV recorder..."
    todayDir = self.TODAY_DIR
    basename = self.BASENAME
    vbCode = self.VP_CODE
    if not (todayDir and basename and vbCode):
        print "todayDir, basename or vbCode variable does not exist in the Feedback Controller"
        return
    # test if todayDir acutally exists
    if not os.path.exists(todayDir):
        print "Directory does not exist, cannot record to: %s" % str(todayDir)
        return
    
    filename = os.sep.join([str(todayDir), str(basename) + str(vbCode)])
    
    suffix = ""
    num = 2
    while os.path.exists(filename+suffix+".eeg"):
        suffix = "%02i" % num
        num += 1
    filename = filename + suffix + ".eeg"
        
    print "Recoding to file: %s" % filename
    try:
        rcc.startImpRecording(filename)
    except Exception, e:
        print "Unable to start recording:"
        print str(e)
        print str(traceback.format_exc())
Esempio n. 2
0
def stop_bv_recorder(self):
    try:
        rcc.stopRecording()
    except:
        self.logger.error("Unable to stop recording:")
        self.logger.error(str(e))