ExperimentManager script class  1.1.0.1
The Experiment Manager script class reference.
Public Slots | Public Member Functions | List of all members
PrtFormatManager Class Reference

The PrtFormatManager class. More...

Inherits QObject, and QScriptable.

Public Slots

int appendCondition (const QString sConditionName=PRT_UNDEF_NAME_STRING, const QString sConditionColor=PRT_UNDEF_COLOR_STRING)
 Appends a new Condition to the in-memory stimulation protocol. More...
 
int appendInterval (const int nConditionIndex=0, const int nBegin=0, const int nEnd=1)
 Appends a Interval to an existing Condition to the in-memory stimulation protocol. More...
 
bool clearAll ()
 Clears all Parameters and Conditions of the stimulation protocol. More...
 
bool clearConditions ()
 Clears all Conditions of the stimulation protocol. More...
 
bool clearParameters ()
 Clears all Parameters of the stimulation protocol. More...
 
QString getParameterDescription (const QString sParamName)
 Returns a Parameter description of the stimulation protocol. More...
 
QString getParameterValue (const QString sParamName)
 Returns a Parameter value of the stimulation protocol. More...
 
QString getRGBPaletteColorString (const int nSteps, const int nIndex)
 Returns a specific color ("R G B" string). More...
 
bool loadFile (const QString sFileName)
 Loads an stimulation protocol (*.prt) file into memory. More...
 
bool saveFile (const QString sFileName, const bool bOverWrite=false)
 Saves an stimulation protocol from memory to a stimulation protocol(*.prt) file. More...
 
bool setConditionColor (const int nConditionIndex, const QString sColor)
 sets a specific color for a condition ("R G B" string). More...
 
bool setParameterValue (const QString sParamName, const QString sParamValue=PRT_UNDEF_VALUE_STRING, const QString sParamDescription=PRT_UNDEF_DESC_STRING)
 Sets an Parameter value for the stimulation protocol. More...
 
bool SortandMergeAllConditionIntervals ()
 Sorts a Merges all the Condition Intervals of the current Stimulation Protocol. More...
 

Public Member Functions

 PrtFormatManager (QObject *parent=NULL)
 The PrtFormatManager constructor. More...
 
 ~PrtFormatManager ()
 The PrtFormatManager destructor. More...
 

Detailed Description

The PrtFormatManager class.

The PrtFormat Manager can be used to create and edit stimulation protocol (*.prt) files. See also http://www.brainvoyager.de/BV2000OnlineHelp/BrainVoyagerWebHelp/mergedProjects/FileFormats/The_format_of_PRT_files.htm

Constructor & Destructor Documentation

PrtFormatManager::PrtFormatManager ( QObject *  parent = NULL)

The PrtFormatManager constructor.

You do not need to specify the parent object. The BrainStim script engine automatically retrieves the parent role

PrtFormatManager::~PrtFormatManager ( )

The PrtFormatManager destructor.

You do not need call the destructor. The BrainStim script engine automatically performs the garbage collection after you set the object to NULL and the script ends

Member Function Documentation

int PrtFormatManager::appendCondition ( const QString  sConditionName = PRT_UNDEF_NAME_STRING,
const QString  sConditionColor = PRT_UNDEF_COLOR_STRING 
)
slot

Appends a new Condition to the in-memory stimulation protocol.

This function can append a new Condition to the current stimulation protocol in memory.

Parameters
sConditionNamea String containing the new Conditions Name. If no Condition Name is defined than the default PrtFormatManagerDefines::PRT_UNDEF_NAME_STRING is used.
sConditionColora String containing the new Conditions Color attribute. The format must be "R G B", Example: "255 0 0". See also PrtFormatManager::getRGBPaletteColorString(). If no Condition Color is defined than the default PrtFormatManagerDefines::PRT_UNDEF_COLOR_STRING is used.
Returns
an integer value holding the new internal index of the appended Condition. See also PrtFormatManager::appendInterval().
int PrtFormatManager::appendInterval ( const int  nConditionIndex = 0,
const int  nBegin = 0,
const int  nEnd = 1 
)
slot

Appends a Interval to an existing Condition to the in-memory stimulation protocol.

This function can append a Interval to an existing Condition to the current in-memory stimulation protocol.

Parameters
nConditionIndexan integer value containing the index of the Condition to which the Interval should be appended.
nBeginan integer value specifying the Start of the first piece of time belonging to the Interval that should be appended.
nEndan integer value specifying the End of the first piece of time belonging to the Interval that should be appended.
Returns
an integer value holding the new internal index of the appended Interval. See also PrtFormatManager::appendCondition().
bool PrtFormatManager::clearAll ( )
slot

Clears all Parameters and Conditions of the stimulation protocol.

This function clears all Parameters and Conditions of the current stimulation protocol in memory. See also PrtFormatManager::clearConditions() and PrtFormatManager::clearParameters().

Returns
a Boolean value representing whether the Parameters and the Conditions could be cleared.
bool PrtFormatManager::clearConditions ( )
slot

Clears all Conditions of the stimulation protocol.

This function clears all Conditions of the current stimulation protocol in memory.

Returns
a Boolean value representing whether the Conditions could be cleared.
bool PrtFormatManager::clearParameters ( )
slot

Clears all Parameters of the stimulation protocol.

This function clears all Parameters of the current stimulation protocol in memory.

Returns
a Boolean value representing whether the Parameters could be cleared.
QString PrtFormatManager::getParameterDescription ( const QString  sParamName)
slot

Returns a Parameter description of the stimulation protocol.

This function can return a Parameter description of the current stimulation protocol in memory.

Parameters
sParamNamea String containing the requested Parameter's Name.
Returns
a String value holding the requested Parameter description of the current in-memory stimulation protocol. If no parameter with the defined Name could be found then this function will return a PrtFormatManagerDefines::PRT_UNDEF_DESC_STRING.
QString PrtFormatManager::getParameterValue ( const QString  sParamName)
slot

Returns a Parameter value of the stimulation protocol.

This function can return a Parameter value of the current stimulation protocol in memory.

Parameters
sParamNamea String containing the requested Parameter's Name.
Returns
a String value holding the requested Parameter value of the current in-memory stimulation protocol. If no parameter with the defined Name could be found then this function will return a PrtFormatManagerDefines::PRT_UNDEF_VALUE_STRING.
QString PrtFormatManager::getRGBPaletteColorString ( const int  nSteps,
const int  nIndex 
)
slot

Returns a specific color ("R G B" string).

Returns a Color String from a location of a color palette divided in steps.

Parameters
nStepsan integer representing the number of steps the color palette should be divided to.
nIndexan integer representing the index location (0-based) of color at the divided color palette.
Returns
a String (a "R G B" String value) holding the Color value. See also PrtFormatManager::appendCondition();
bool PrtFormatManager::loadFile ( const QString  sFileName)
slot

Loads an stimulation protocol (*.prt) file into memory.

This function can loads an existing stimulation protocol (*.prt) file into memory for further editing.

Parameters
sFileNamea String containing the path to the stimulation protocol (*.prt) file.
Returns
a Boolean value representing whether the stimulation protocol (*.prt) file could be loaded.
bool PrtFormatManager::saveFile ( const QString  sFileName,
const bool  bOverWrite = false 
)
slot

Saves an stimulation protocol from memory to a stimulation protocol(*.prt) file.

This function can save the current an existing stimulation protocol file in memory to a file.

Parameters
sFileNamea String containing the path to the target stimulation protocol (*.prt) file.
bOverWritea Boolean value determing whether the target file should be automatically overwritten when it already exists.
Returns
a Boolean value representing whether the stimulation protocol could be saved to the file.
bool PrtFormatManager::setConditionColor ( const int  nConditionIndex,
const QString  sColor 
)
slot

sets a specific color for a condition ("R G B" string).

Sets a Color String for a specific condition.

Parameters
nConditionIndexan integer representing the index of the condition to set the color from.
sColora String (a "R G B" String value) holding the Color value for the condition.
Returns
a Boolean value determining whether the color value for that condition could be successfully changed. See also PrtFormatManager::appendCondition();
bool PrtFormatManager::setParameterValue ( const QString  sParamName,
const QString  sParamValue = PRT_UNDEF_VALUE_STRING,
const QString  sParamDescription = PRT_UNDEF_DESC_STRING 
)
slot

Sets an Parameter value for the stimulation protocol.

This function sets a Parameter value for the current stimulation protocol in memory.

Parameters
sParamNamea String containing the Parameter Name.
sParamValuea String containing the Parameter Value.
sParamDescriptiona String containing the Parameter Description.
Returns
a Boolean value representing whether the Parameter value for the current stimulation protocol could be set.
bool PrtFormatManager::SortandMergeAllConditionIntervals ( )
slot

Sorts a Merges all the Condition Intervals of the current Stimulation Protocol.

This function tries to Sort and Merge the Condition Intervals of the current in-memory Stimulation Protocol. After editing a Stimulation Protocol this function could be called prior to the PrtFormatManager::saveFile() to optimize the protocol structure.

Returns
a Boolean value representing whether the Condition Intervals could be parsed.