Differences between revisions 22 and 34 (spanning 12 versions)
Revision 22 as of 2014-03-28 08:14:49
Size: 2180
Comment:
Revision 34 as of 2017-05-19 08:53:00
Size: 3556
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
The automatically generated class reference can be read at [[https://134.2.114.126/nrec-doku/annotated.html|this location]]. It has been generated with the nice [[http://www.stack.nl/~dimitri/doxygen/|doxygen]] tool.

== Object Model ==

With the tool [[http://freemind.sourceforge.net/wiki/index.php/Main_Page|freemind]] we have created a [[attachment:objektmodell.mm|diagram]] showing [[https://134.2.114.126/nrec-doku/objektmodell.html|some of the nrec objects]] and their relationships:

[[https://134.2.114.126/nrec-doku/objektmodell.html|{{https://134.2.114.126/nrec-doku/objektmodell.html_files/image.png|height="300"|width="200"}}]]
The automatically generated class reference can be read at [[http://134.2.114.63:5000/nrec-doku/annotated.html|this location]]. It has been generated with the [[http://www.stack.nl/~dimitri/doxygen/|doxygen]] tool.
Line 48: Line 42:
== Understanding the plotting mechanism ==

The Plotting is used to handle the data plot windows containing qwt plots and streaming data into them.
[[UnderstandingThePlotting|Here is an illustration on how it works.]]
Line 50: Line 49:
[[UnderstandingTheLogger|Here is an illustration on how it works and an example of a LogReader implementation.]] {{attachment:FlowCondFixation.png}}

== PrimitiveControllerColorChangeOnStatus and it's timing ==

[[attachment:CPrimitiveControllerColorChangeOnStatus.jpeg|{{attachment:CPrimitiveControllerColorChangeOnStatus.jpeg|height="20"|width="300"}}]]

== To have a paradigm access the eye recording of the previous trial ==

In the header file:
{{{
class CCalibrator;
...
/**
 * Calibrator object is needed to read in the analog samples after the trial.
 */
CCalibrator* m_poCalibrator;
}}}

In the cpp file:

In the includes:
{{{
#include "CCalibrator.h"
}}}

In the constructor:
{{{
 : IParadigm( oParameters ),
    m_poCalibrator( NULL ),
...
// create simple calibrator object w/o initialization to post-trial read analog values
m_poCalibrator = new CCalibrator();
}}}

In the destructor:
{{{
// Delete calibrator object.
delete m_poCalibrator;
}}}

In !PreProcessTrial:
{{{
// Tell the calibration data object the trial's recording process
m_poCalibrator->PrepareTrial( poTrial->GetRecordingId() );
}}}

In !PostProcessTrial:
{{{
// get all analog input samples from calibrator (channel 1)
std::vector< double > vecAInSamples;
vecAInSamples.clear();
vecAInSamples = m_poCalibrator->GetSamples( -1., -1., 1 );
// get analog samples from a certain channel and time interval
std::vector< double > CCalibrator::GetSamples( double dStartTime, double dStopTime, int iChannel )
// get calibrated eye positions
std::vector< std::vector< double > > CCalibrator::GetSamplesCalibrated( double dStartTime, double dStopTime )
// get maximum tangential velocity (in deg/s)
double CCalibrator::GetMaximumVelocity( double dStartTime, double dStopTime )
}}}

Design Concepts

1. doxygen generated API reference

The automatically generated class reference can be read at this location. It has been generated with the doxygen tool.

2. Using Font Primitives

nrec uses a special bitmap file format (.bmf) for fonts. There is a command line tool called ttf2bmf that can be used to convert ttf font files into bmf files. The font size specified defines the file size and the resolution of the font bitmaps and defaults to 12. The program, its source code and some example files are located in the folder run/Fonts.

Usage:

./ttf2bmf fontfile outputfile [fontsize]

Examples:

$ ./ttf2bmf LucidaTypewriterRegular.ttf default.bmf 24
./ttf2bmf: Wrote default.bmf, 256 by 256 pixels.
$ ./ttf2bmf LucidaTypewriterRegular.ttf default.bmf 10
./ttf2bmf: Wrote default.bmf, 256 by 64 pixels.
$ ./ttf2bmf LucidaTypewriterRegular.ttf default.bmf 48
./ttf2bmf: Wrote default.bmf, 256 by 1024 pixels.
$ ./ttf2bmf LucidaTypewriterRegular.ttf default.bmf
./ttf2bmf: Wrote default.bmf, 256 by 128 pixels.

3. Understanding the logger mechanism

The Logger is used to transfer messages between different threads running at different priority. Here is an illustration on how it works and an example of a LogReader implementation.

4. Understanding the plotting mechanism

The Plotting is used to handle the data plot windows containing qwt plots and streaming data into them. Here is an illustration on how it works.

5. FlowCondFixation and all it's actions

FlowCondFixation.png

6. PrimitiveControllerColorChangeOnStatus and it's timing

height="20"

7. To have a paradigm access the eye recording of the previous trial

In the header file:

class CCalibrator;
...
/**
 * Calibrator object is needed to read in the analog samples after the trial.
 */
CCalibrator* m_poCalibrator;

In the cpp file:

In the includes:

#include "CCalibrator.h"

In the constructor:

 : IParadigm( oParameters ),
    m_poCalibrator( NULL ),
...
// create simple calibrator object w/o initialization to post-trial read analog values 
m_poCalibrator = new CCalibrator();

In the destructor:

// Delete calibrator object.
delete m_poCalibrator;

In PreProcessTrial:

// Tell the calibration data object the trial's recording process
m_poCalibrator->PrepareTrial( poTrial->GetRecordingId() );

In PostProcessTrial:

// get all analog input samples from calibrator (channel 1)
std::vector< double > vecAInSamples;
vecAInSamples.clear();
vecAInSamples = m_poCalibrator->GetSamples( -1., -1., 1 );
// get analog samples from a certain channel and time interval
std::vector< double > CCalibrator::GetSamples( double dStartTime, double dStopTime, int iChannel )
// get calibrated eye positions
std::vector< std::vector< double > > CCalibrator::GetSamplesCalibrated( double dStartTime, double dStopTime )
// get maximum tangential velocity (in deg/s)
double CCalibrator::GetMaximumVelocity( double dStartTime, double dStopTime )

nrec: DesignInformation (last edited 2017-05-19 08:53:00 by FriedemannBunjes)