I am a Master degree student working on a project of BCI and I am trying to understand how the feedback demo of the ball reacting to a cortex activity work. I don't know how the position in Y-axis evolves since i don't know how to access to the code which deals with the control signal : I found the part of the code for its incrementation :
Code: Select all
void FeedbackDemoTask::DoFeedback( const GenericSignal& ControlSignal, bool& doProgress )
{
mCursorPosX += mCursorSpeedX;
mCursorPosY -= mCursorSpeedY * ControlSignal( 0, 0 );
mpCursor->Left = mCursorPosX;
mpCursor->Top = mCursorPosY - mpCursor->Height / 2;
if( mpCursor->Top < 0 )
mpCursor->Top = 0;
else if( mpCursor->Top > mpForm->Height - mpCursor->Height )
mpCursor->Top = mpForm->Height - mpCursor->Height;
if( mCursorPosX + mpCursor->Width / 2 >= mpForm->Width - mpTarget->Width )
{ // Right margin hit:
doProgress = true;
int result = ::floor( mCursorPosY * Parameter( "NumberTargets" ) / mpForm->Height ) + 1;
if( result < 1 )
result = 1;
else if( result > Parameter( "NumberTargets" ) )
result = Parameter( "NumberTargets" );
State( "ResultCode" ) = result;
}
}
Thank you very much in advance,
Regards,
Tristan Venot