Ejemplo n.º 1
0
void ofxRGBDCaptureGui::loadDirectory(string path){
    if(path == ""){
        ofSystemAlertDialog("The Working directory empty. Resetting to bin/data/");
        loadDefaultDirectory();
        return;
    }
    
    ofDirectory workingDirPath(path);
    if(!workingDirPath.exists()){
        ofSystemAlertDialog("The Working directory empty. Resetting to bin/data/depthframes/");
        loadDefaultDirectory();     
        return;
    }
    
	workingDirectory = path;
	recorder.setRecordLocation(path+"/takes", "frame");
	ofDirectory dir(workingDirectory+"/calibration");
	if(!dir.exists()){
		dir.create(true);
	}
	alignment.loadState(workingDirectory+"/calibration/alignmentsave.xml");
	
	btnSetDirectory->setLabel(path);
	updateTakeButtons();
	ofxXmlSettings defaults;
	defaults.loadFile("defaults.xml");
	defaults.setValue("currentDir", path);
	defaults.saveFile("defaults.xml");
}
Ejemplo n.º 2
0
void FileTestContext::inputFile(const char* filename)
{
   UtlString inputPath;
   inputFilePath(filename, inputPath);

   UtlString workingPath;
   workingFilePath(filename, workingPath);

   OsPath input(inputPath);
   OsPath working(workingPath);

   OsPath workingDirPath(working.getDirName());
   workingDirPath.strip(UtlString::trailing, OsPath::separator(0));
   OsDir workingDir(workingDirPath);

   if (!workingDir.exists())
   {
      UtlString msg;
      msg.append("FileTestContext::inputFile failed to create working directory '");
      msg.append(working.getDirName().data());
      msg.append("'");
      CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.data(),
                                   OS_SUCCESS,OsFileSystem::createDir(workingDirPath,TRUE));
   }

   UtlString msg;
   msg.append("FileTestContext::inputFile copy failed from '");
   msg.append(inputPath);
   msg.append("' -> '");
   msg.append(workingPath);
   msg.append("'");
   CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.data(),
                                OS_SUCCESS,
                                OsFileSystem::copy(input, working)
                                );

   Os::Logger::instance().log(FAC_UNIT_TEST, PRI_NOTICE, "FileTestContext::inputFile '%s' -> '%s'",
                 inputPath.data(), workingPath.data());

}