Robotcode
1.0
|
An experiment is the root-object of the program. More...
#include <linepush5.h>
Public Member Functions | |
MyExperiment (string name, string code) | |
virtual void | control () |
Main event loop. | |
bool | parseCommand (string arguments[], int numArgs) |
virtual void | onExit (void) |
Is called on Exit of the Program before destruction. |
An experiment is the root-object of the program.
An Experiment is the root-object of the program. Most of the behaviors can be inherited from the abstract Experiment class.
MyExperiment::MyExperiment | ( | string | name, |
string | code | ||
) |
Experiment Contructor. It makes a object of type MyBlock and of type MyTrial
name | Name of the Experiment displayed in Text Display window |
code | Short letter code, which will form the first part of all data files saved |
void MyExperiment::control | ( | void | ) | [virtual] |
Main event loop.
Experiment: control This is the main loop of the experiment. It just checks the events from the User and updates the graphic Screen and Text Display. Update Haptics run with UPDATERATE in parallel.
Implements Experiment.
bool MyExperiment::parseCommand | ( | string | arguments[], |
int | numArgs | ||
) | [virtual] |
In this function you can program additional commands that should be understood in the TextDisplay. If you did not identfy the command, just return false and a error message will be issued.
arguments[] | array of strings with all the arguments in it. arguments[0] is the command itself |
numArgs | Number of Arguments |
< Command not recognized
< Command recognized
Reimplemented from Experiment.
void MyExperiment::onExit | ( | void | ) | [virtual] |
Is called on Exit of the Program before destruction.
This function is called before the Program exits. Thus all the devices need to be closed and the interrupt loop must be stopped. Somehow there is still a bug here: Sometimes the interrupt does not seem to terminate and updateHaptics goes in Gaga-land. Not sure why.
Reimplemented from Experiment.