def getVskFiles(path): path = path[:-1] if path[-1:]=="\\" else path vskFile = files.getFiles(path+"\\",".vsk") if len(vskFile)>1: logging.warning("Folder with several vsk. %s selected"%(vskFile[0])) return vskFile[0]
def generateEmptyEnf(path): c3ds = files.getFiles(path, "c3d") for c3d in c3ds: enfName = c3d[:-4] + ".Trial.enf" if enfName not in os.listdir(path): logging.info(enfName + " : created ") open(path + enfName, 'a').close()
def getEnfFiles(path, type): path = path[:-1] if path[-1:] == "\\" else path enfFiles = files.getFiles(str(path + "\\"), type.value) if type == enums.EclipseType.Session: if len(enfFiles) > 1: raise Exception( "Vicon Eclipse badly configured. Two session enf found") else: return enfFiles[0] elif type == enums.EclipseType.Patient: if len(enfFiles) > 1: raise Exception( "Vicon Eclipse badly configured. Two Patient enf found") else: return enfFiles[0] elif type == enums.EclipseType.Trial: return enfFiles else: raise Exception( "eclipse file type not recognize. Shoud be an item of enums.eClipseType" )
def test_getFiles2(self): fs = files.getFiles( pyCGM2.TEST_DATA_PATH + "\\LowLevel\\IO\\Hannibal_c3d\\", "Trial.enf")
def test_getFiles(self): fs = files.getFiles( pyCGM2.TEST_DATA_PATH + "\\LowLevel\\IO\\Hanibal_files\\", "json")
def generateEmptyENF(path): c3ds = files.getFiles(path, "c3d") for c3d in c3ds: enfName = c3d[:-4] + ".Trial.enf" if enfName not in os.listdir(path): open((path + enfName), 'a').close()
def getEnfSession(path): path = path[:-1] if path[-1:]=="\\" else path enfFile = files.getFiles(path+"\\","Session.enf") if len(enfFile)>1: raise Exception ("Vicon Eclipse badly configured. Two session enf found") return enfFile[0]
def getEnfTrials(path): path = path[:-1] if path[-1:]=="\\" else path enfFiles = files.getFiles(path+"\\","Trial.enf") return enfFiles