本文整理汇总了C++中ParametersLoader::loadParameterFile方法的典型用法代码示例。如果您正苦于以下问题:C++ ParametersLoader::loadParameterFile方法的具体用法?C++ ParametersLoader::loadParameterFile怎么用?C++ ParametersLoader::loadParameterFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParametersLoader
的用法示例。
在下文中一共展示了ParametersLoader::loadParameterFile方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initStreams
// Inizializza gli stream, apre il file per poi scriverci
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open("C:/cncsvisiondata/parametersFiles/Campagnoli/parametersstaircasePointing2.txt");
parameters.loadParameterFile(parametersFile);
/*
// Principal streams file
string markersFileName = "C:/Users/visionlab/Dropbox/Shape Lab Shared/Carlo/spring13-pointingEquilateralTriangle/Staircase/twoBlocks2/staircasePointing2_markersFile_" + subjectName + ".txt";
string responseFileName = "C:/Users/visionlab/Dropbox/Shape Lab Shared/Carlo/spring13-pointingEquilateralTriangle/Staircase/twoBlocks2/staircasePointing2_" + subjectName + ".txt";
*/
// Base directory, full path
string baseDir = parameters.find("BaseDir");
// Subject name
string subjectName = parameters.find("SubjectName");
// Principal streams file
string markersFileName = baseDir + "markersFile_" + subjectName + ".txt";
string responseFileName = baseDir + "responseFile_"+ subjectName + ".txt";
// Check for output file existence
/// Response file
if ( !fileExists((responseFileName)) )
responseFile.open((responseFileName).c_str());
if ( !fileExists(markersFileName) )
markersFile.open(markersFileName.c_str());
responseFile << fixed << "subjName\tIOD\ttrialN\tRelDepthObj\tStairID\tStairState\tReversals\tAscending\tresponsekey\tresp\tjitter\ttime\tstepsDone\tobjdepth\tCondition\tsequence\ttimeToFHP\tjitterObj\tstimulus" << endl;
globalTimer.start();
}
示例2: initStreams
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open("C:/workspace/cncsvisioncmake/experimentsbrown/parameters/parametersSizeWeightIllusion.txt");
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
// Markersfile directory
string dirName = "C:/Users/visionlab/Google Drive/DATA/SizeWeightIllusion/" + subjectName;
mkdir(dirName.c_str());
// Principal streams file
string responseFileName = "C:/Users/visionlab/Google Drive/DATA/SizeWeightIllusion/" + subjectName + "/SizeWeight_" + subjectName + ".txt";
// Check for output file existence
/// Response file
if ( !fileExists((responseFileName)) )
responseFile.open((responseFileName).c_str());
responseFile << fixed << "subjName" << "\t" <<
"IOD" << "\t" <<
"trialN" << "\t" <<
"AbsDepth" << "\t" <<
"Size" << "\t" <<
"Diameter" << "\t" <<
"trialDuration" << "\t" <<
"training" << "\t" <<
"round" <<
endl;
globalTimer.start();
}
示例3: initStreams
// Inizializza gli stream, apre il file per poi scriverci
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open("C:/cncsvisiondata/parametersFiles/Evan/platoGraspRovereto/parametersPlatoGraspRovereto.c"); //is this correct?
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
// Output files directory
string dirName = "C:/Documents and Settings/Fulvio/My Documents/Google Drive/platoGraspRovereto/" + subjectName;
mkdir(dirName.c_str());
// Response file
string controlResponseFileName = "C:/Documents and Settings/Fulvio/My Documents/Google Drive/platoGraspRovereto/" + subjectName + "/platoGraspRovereto_control_" + subjectName + ".txt";
string responseFileName = "C:/Documents and Settings/Fulvio/My Documents/Google Drive/platoGraspRovereto/" + subjectName + "/platoGraspRovereto_" + subjectName + ".txt";
// Check for output file existence
/// Response file
if ( !fileExists((responseFileName)) ) {
responseFile.open((responseFileName).c_str());
}
if ( !fileExists((controlResponseFileName)) ) {
controlResponseFile.open((controlResponseFileName).c_str());
}
responseFile << fixed << "subjName\ttrialN\ttrialDuration\ttargetObj\tsm_lg\tcon_inc" << endl;
controlResponseFile << fixed << "subjName\ttrialN\ttrialDuration\ttargetObj\tsm_lg\tcon_inc" << endl;
globalTimer.start();
}
示例4: initStreams
// Inizializza gli stream, apre il file per poi scriverci
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open("C:/workspace/cncsvisioncmake/experimentsbrown/parameters/parametersEvanHaptic.txt");
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
// Markersfile directory
string dirName = "C:/Users/visionlab/Google Drive/DATA/Evan-haptic/spatial/" + subjectName;
mkdir(dirName.c_str());
// Principal streams file
string responseFileName = "C:/Users/visionlab/Google Drive/DATA/Evan-haptic/spatial/" + parameters.find("SubjectName") + "/evan-haptic_" + subjectName + ".txt";
// Check for output file existence
/// Response file
if ( !fileExists((responseFileName)) )
responseFile.open((responseFileName).c_str());
responseFile << fixed << "subjName\ttrialN\tstimPosn\tAbsDepth\tObjHeight\ttrialDuration\tcondition\tpulsingColors" << endl; //\tHapticFB\trandCond\trandIncrement" << endl;
globalTimer.start();
}
示例5: initStreams
void initStreams()
{ /*ifstream inputParameters;
inputParameters.open(parametersFileNames[paramIndex]);
if ( !inputParameters.good() )
{ cerr << "File doesn't exist" << endl;
//exit(0);
}*/
parameters.loadParameterFile("C:/cncsvisioncmake/build/Debug/parametersExpFingerTrieste.txt");
// WARNING:
// Base directory and subject name, if are not
// present in the parameters file, the program will stop suddenly!!!
// Base directory where the files will be stored
cerr << "Folders creation..." ;
string baseDir = parameters.find("BaseDir");
if ( !boost::filesystem::exists(baseDir) )
boost::filesystem::create_directory(baseDir);
// Subject name
string subjectName = parameters.find("SubjectName");
// Principal streams file
string markersFileName = "markersFile_" + subjectName + ".txt";
// Check for output file existence
if ( !fileExists((baseDir+markersFileName)) )
markersFile.open((baseDir+markersFileName).c_str());
cerr << " OK!" << endl;
}
示例6: initStreams
// Inizializza gli stream, apre il file per poi scriverci
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open(parametersFile_directory.c_str());
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
// Principal streams files
// response file (if haptic)
string responseFileName = experiment_directory + responseFile_name + subjectName + ".txt";
// Check for output file existence
if (util::fileExists(responseFileName))
{
string error_on_file_io = responseFileName + string(" already exists");
cerr << error_on_file_io << endl;
#ifndef SIMULATION
MessageBox(NULL, (LPCSTR)"FILE ALREADY EXISTS\n Please check the parameters file.",NULL, NULL);
#endif
exit(0);
}
else
{
responseFile.open(responseFileName.c_str());
cerr << "File " << responseFileName << " loaded successfully" << endl;
}
responseFile << fixed << responseFile_headers << endl;
}
示例7: initStreams
/**
* @brief initStreams
**/
void initStreams()
{
ifstream inputParameters;
inputParameters.open(parametersFileNames[paramIndex]);
parameters.loadParameterFile(inputParameters);
interoculardistance = util::str2num<double>(parameters.find("IOD"));
// Base directory, full path
string baseDir = parameters.find("BaseDir");
// Subject name
string subjectName = parameters.find("SubjectName");
// Principal streams file
string markersFileName = baseDir + "markersFile_" + subjectName + ".txt";
// Check for output file existence
if (util::fileExists(markersFileName ))
{
string error_on_file_io = markersFileName + string(" already exists");
cerr << error_on_file_io << endl;
MessageBox(NULL, (LPCSTR)"MARKER FILE ALREADY EXIST\n",NULL, NULL);
exit(0);
}
else
{
markersFile.open(( markersFileName ).c_str());
cerr << "File " << markersFileName << " loaded successfully" << endl;
markersFile << fixed << setprecision(3) << "SubjectName\tFingerDist\tTrialNumber\tTrialFrame\tTotTime\tVisualStimX\tVisualStimY\tVisualStimZ\tfStimulusRadius\tfDistances\tfGain\tDisappearRadius\tEyeLeftXraw\tEyeLeftYraw\tEyeLeftZraw\tEyeRightXraw\tEyeRightYraw\tEyeRightZraw\tWristXraw\tWristYraw\tWristZraw\tThumbXraw\tThumbYraw\tThumbZraw\tIndexXraw\tIndexYraw\tIndexZraw\tVisualThumbXraw\tVisualThumbYraw\tVisualThumbZraw\tVisualIndexXraw\tVisualIndexYraw\tVisualIndexZraw\tIsDrawing\tIsThumbProjected\tIsIndexProjected\tFingersLeaning" << endl;
}
}
示例8: initStreams
// Inizializza gli stream, apre il file per poi scriverci
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open("C:/workspace/cncsvisioncmake/experimentsbrown/parameters/parametersstaircasePointing2.txt");
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
string dirName = "C:/Users/visionlab/Dropbox/Shape Lab Shared/Carlo/spring13-pointingEquilateralTriangle/Staircase/twoBlocks2/" + subjectName;
mkdir(dirName.c_str());
// Principal streams file
string responseFileName = "C:/Users/visionlab/Dropbox/Shape Lab Shared/Carlo/spring13-pointingEquilateralTriangle/Staircase/twoBlocks2/" + parameters.find("SubjectName") + "/staircaseGrasping2_" + subjectName + ".txt";
// Check for output file existence
/// Response file
if ( !fileExists((responseFileName)) )
responseFile.open((responseFileName).c_str());
responseFile << fixed << "subjName\tIOD\ttrialN\tAbsDepth\tRelDepthObj\tStairID\tStairState\tReversals\tAscending\tresponsekey\tresp\tjitter\ttime\tstepsDone\tobjdepth\tCondition\tsequence\ttimeToFHP" << endl;
globalTimer.start();
}
示例9: initStreams
// Inizializza gli stream, apre il file per poi scriverci
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open(parametersFile_directory.c_str());
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
initVariables();
// Principal streams files
// response file (if haptic)
if(condition == 1)
{
string responseFileName = experiment_directory + responseFile_name + subjectName + "_" + stringify<int>(condition) + "_" + stringify<int>(stimulus_noise) + ".txt";
if ( !util::fileExists(responseFileName) )
responseFile.open(responseFileName.c_str());
responseFile << fixed << responseFile_headers << endl;
}
// summary file
string summaryFileName = experiment_directory + responseFile_name + subjectName + "_" + stringify<int>(condition) + "_" + stringify<int>(stimulus_noise) + "_summary.txt";
/// Summary file
if ( !util::fileExists(summaryFileName) )
summaryFile.open(summaryFileName.c_str());
summaryFile << fixed << summaryFile_headers << endl;
}
示例10: initStreams
void initStreams()
{
ifstream inputParameters;
string parametersPassiveFileName("paramsPointsStrip.txt");
inputParameters.open(parametersPassiveFileName.c_str());
if ( !inputParameters.good() )
{
cerr << "File " << parametersPassiveFileName << " doesn't exist, enter a valid path" << endl;
exit(0);
}
parameters.loadParameterFile(inputParameters);
}
示例11: initStreams
void initStreams()
{
string parametersFileName = "../../data/parametersFiles/parametersExpDPrimeTMSoverMT.txt";
ifstream inputParameters;
inputParameters.open(parametersFileName.c_str());
if ( !inputParameters.good() )
{
cerr << "File " << parametersFileName << "doesn't exist" << endl;
exit(0);
}
parameters.loadParameterFile(inputParameters);
// WARNING:
// Base directory and subject name, if are not
// present in the parameters file, the program will stop suddenly!!!
// Base directory where the files will be stored
string baseDir = parameters.find("BaseDir");
if ( !boost::filesystem::exists(baseDir) )
boost::filesystem::create_directory(baseDir);
// Principal streams file
string markersFileName = "markersFile_" + parameters.find("SubjectName") + ".txt";
string responseFileName = "responseFile_" + parameters.find("SubjectName") + ".txt";
string matrixFileName = "matrixFile_" + parameters.find("SubjectName") + ".txt";
string flowsFileName = "flowsFile_" + parameters.find("SubjectName") + ".txt";
// Check for output file existence
if (!util::fileExists((baseDir+markersFileName)) )
markersFile.open((baseDir+markersFileName).c_str());
if (!util::fileExists( (baseDir+responseFileName) ) )
responseFile.open( (baseDir+responseFileName).c_str() );
if (!util::fileExists((baseDir+matrixFileName)) )
matrixFile.open((baseDir+matrixFileName).c_str());
if (!util::fileExists((baseDir+flowsFileName)) )
flowsFile.open((baseDir+flowsFileName).c_str());
}
示例12: initStreams
void initStreams()
{
// Load the parameters file
inputParameters.open("parametersActiveRotationYaw.txt");
if ( !inputParameters.good() )
{
cerr << "File doesn't exist" << endl;
exit(0);
}
parameters.loadParameterFile(inputParameters);
// WARNING:
// Base directory and subject name, if are not
// present in the parameters file, the program will stop suddenly!!!
// Base directory where the files will be stored
string baseDir = parameters.find("BaseDir");
if ( !exists(baseDir) )
create_directory(baseDir);
// Subject name
string subjectName = parameters.find("SubjectName");
string responseFileName = baseDir + "responseFilePassive_" + subjectName +".txt";
string markersFileName = baseDir + "markersFile_" + subjectName + "_filtered.txt";
// Open the full input stream
inputStream.open(markersFileName.c_str());
if ( inputStream.good() )
{
cerr << "Markers file " << markersFileName << " ok" << endl;
}
else
cerr << "Can't open " << markersFileName << endl;
// Open the response file in write mode
if ( !fileExists((responseFileName)) )
responseFile.open((responseFileName).c_str());
}
示例13: initStreams
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open(parametersFile_directory.c_str());
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
// Principal streams file
string responseFileName = experiment_directory + responseFile_name + subjectName + ".txt";
// Check for output file existence
/// Response file
if ( !util::fileExists(responseFileName) )
responseFile.open((responseFileName).c_str());
responseFile << fixed << responseFile_headers << endl;
}
示例14: initStreams
// Inizializza gli stream, apre il file per poi scriverci
void initStreams()
{
// Initializza il file parametri partendo dal file parameters.txt, se il file non esiste te lo dice
ifstream parametersFile;
parametersFile.open("C:/workspace/cncsvisioncmake/experimentsbrown/parameters/parametersstaircaseAdjustment.txt");
parameters.loadParameterFile(parametersFile);
// Subject name
string subjectName = parameters.find("SubjectName");
// Principal streams file
string responseFileName = "staircaseAdjustment_" + subjectName + ".txt";
// Check for output file existence
/// Response file
if ( !fileExists((responseFileName)) )
responseFile.open((responseFileName).c_str());
responseFile << fixed << "subjName\tIOD\ttrialN\tRelDepthObj\tStairID\tStairState\tReversals\tAscending\tresponsekey\tresp\tjitter\ttime\tstepsDone\tobjdepth" << endl;
globalTimer.start();
}