本文整理汇总了C++中ParametersLoader::find方法的典型用法代码示例。如果您正苦于以下问题:C++ ParametersLoader::find方法的具体用法?C++ ParametersLoader::find怎么用?C++ ParametersLoader::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParametersLoader
的用法示例。
在下文中一共展示了ParametersLoader::find方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: drawStimulus
void drawStimulus()
{
if( fingerCalibrationDone==3 )
{
if( !endTrial )
{
if(timer.getElapsedTimeInMilliSec() < str2num<double>(parameters.find("PreMovementInterval")) ) // draw the stimulus
{
isStimulusDrawn=true;
drawThreeRods();
} else if (timer.getElapsedTimeInMilliSec() > str2num<double>(parameters.find("PreMovementInterval")) && timer.getElapsedTimeInMilliSec() < str2num<int>(parameters.find("TrialDuration"))) // stimulus disappears
{
if( factors["Condition"] == 0 )
drawTheVoid();
else if(factors["Condition"] == 1)
{
if(abs(index.z()-thumb.z()) > 15.0 )
drawTheVoid();
else
drawThreeRods();
} else
drawThreeRods();
} else { // trial ends
beepOk(1);
isStimulusDrawn=false;
drawTheVoid();
endTrial=true;
}
}
}
}
示例3: 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;
}
示例4: initVariables
void initVariables()
{
interoculardistance = str2num<double>(parameters.find("IOD"));
// Create the factors-staircase object TrialGenerator
trial.init(parameters);
maxTotalTrials = trial.getRemainingTrials();
cerr << "There are " << maxTotalTrials << " total trials to do..." << endl;
factors = trial.getNext();
redDotsPlane.setNpoints(300);
redDotsPlane.setDimensions(50,50,0.1);
redDotsPlane.compute();
//stimDrawer.drawSpecialPoints();
stimDrawer.setStimulus(&redDotsPlane);
stimDrawer.setSpheres(false);
stimDrawer.initList(&redDotsPlane,glRed,3);
// Set the maximum x displacement of head
maxXOscillation = util::str2num<double>(parameters.find("MaxXOscillation"));
nOscillationsFixation = util::str2num<int>(parameters.find("NOscillationsFixation"));
minOscTime = util::str2num<double>(parameters.find("MinOscillationTime"));
maxOscTime = util::str2num<double>(parameters.find("MaxOscillationTime"));
centerTolerance = util::str2num<double>(parameters.find("CenterTolerance"));
totalTimer.start();
}
示例5: 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;
}
}
示例6: initVariables
/*** TRIAL ***/
void initVariables()
{
trial.init(parameters);
interoculardistance = str2num<double>(parameters.find("IOD"));
trial_duration = str2num<double>(parameters.find("trial_duration"));
motion_step = str2num<double>(parameters.find("motion_step"));
motion_theta = str2num<double>(parameters.find("motion_theta"));
}
示例7: initVariables
void initVariables()
{
// initialize the trial matrix
trial.init(parameters);
// initialize the noise level
stimulus_noise = str2num<double>(parameters.find("NoiseLevel"));
// is it visual or haptic?
condition = str2num<double>(parameters.find("Condition"));
}
示例8: initTrial
void initTrial()
{
isStimulusDrawn=false;
responsekey=0;
jitter = unifRand(str2num<double>(parameters.find("VirtualObjRelDepthLowBound")),
str2num<double>(parameters.find("VirtualObjRelDepthUpBound")));
drawGLScene();
initProjectionScreen(trial.getCurrent().first["AbsDepth"] + jitter);
frame=0;
timer.start();
isStimulusDrawn=true;
}
示例9: initVariables
void initVariables()
{
// Riempie la lista dei fattori a partire da quanto descritto nei fattori dell'oggetto parameters
// Per dubbi prova i vari esempi di test del modulo experiments
for(int i=0;i<ROUNDS;i++)
{
srand(timer.getElapsedTimeInMicroSec());
timer.sleep(1000);
trial[i].init(parameters);
cerr << "round" << endl;
trial[i].print();
}
middlePos = (str2num<double>(parameters.find("TrainingDist"))+str2num<double>(parameters.find("CatchDist")))/2.0;
}
示例10: drawSquare
void drawSquare()
{
glLoadIdentity();
glTranslated(0.0,0,trial.getCurrent()["AbsDepth"]);
glRotated(trial.getCurrent()["Orientation"]*(str2num<double>(parameters.find("ThetaSign")))+theta,1,1,0);
edge = str2num<double>(parameters.find("SquareSize")) + jitterX;
glColor3fv(glRed);
glBegin(GL_LINE_LOOP);
glVertex3d(edge,edge,0.0);
glVertex3d(edge,-edge,0.0);
glVertex3d(-edge,-edge,0.0);
glVertex3d(-edge,edge,0.0);
glEnd();
}
示例11: 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;
}