How to control CONFIG, SET CONFIG, START buttons via P3SpellerTask.cpp (BCI2000.sln)

Forum for software developers to discuss BCI2000 software development
Post Reply
GuglielmoElefante
Posts: 3
Joined: 29 Jan 2016, 12:29

How to control CONFIG, SET CONFIG, START buttons via P3SpellerTask.cpp (BCI2000.sln)

Post by GuglielmoElefante » 30 Jan 2016, 09:18

Hi, I'm developing additional functionalities about the BCI2000 SW for my master's degree in Computer Engineer. In few words I'm applying AI methods to the system to realize customized users optimization but doing this I need to obtain GUI button control (CONFIG, SET CONFIG, START, STOP, RESUME) internally, via SW, acting on the BCI2000.sln project.

WHAT HAVE I TO DO: when the user starts the GUI (using e.g. P3Speller_gUSBamp.bat) the system launches a training phase composed by 3 session of dictation. During each of them my code modify some parameters (like StimulusDuration, ISIminDuration, etc.), it set it again with the new values (through SET CONFIG, that is through the P3SpellerTask.cpp's OnPreflight() method ) and proceed with the subsequent training session.

THE QUESTION IS: How can I launch SET CONFIG and START callback fucntions from the P3SpellerTask.cpp (BCI2000.sln) code?

The SW has to work in this way:

1) The user starts P3Speller_gUSBamp.bat
2) Loads the default prm, click on SET CONFIG and then on START
3) The system starts in a fourth custom mode (additionally to the none, free e copy mode) which starts the first training session
4) During the first session my code analyzes the dictation. When it finishes it evaluates parameters modification and set the system
with these new values
5) After the first training session is over my code has to launch automatically the second training session, to verify the goodness of these new
values and proceeding on them modification
6) Same things about third training session
7) Concluded the training phase my code has to start the effective dictation phase.

I was helped by collegues and Ph.D.s and we tried several approaches, like using the method BCI_StartRun(),declared in BCI_OperatorLib.h, in P3SpellerTask.cpp but whithout any effects (in this case the system starts and works but calling BCI_StartRun does not make any effects).

Any suggestions? Thank you in advance.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How to control CONFIG, SET CONFIG, START buttons via P3SpellerTask.cpp (BCI2000.sln)

Post by pbrunner » 30 Jan 2016, 10:48

GuglielmoElefante

there are three functionalities in BCI2000 that with some overlap allow you to do exactly what you have described.

Use the operator scripting [1] from a batch file to start the BCI2000 modules, load the parameters, set config and start the run.
Use the BCI2000 Automation [2] from your code to control BCI2000.
Use the AppConnector [3] from your code to stream the data/results to your application.

Regards, Peter

PS: If you don't mind could you also register for the BCI2000 v.3.6 beta test [4] and download as well as test the most recent v3.6 beta [5]?

[1] http://www.bci2000.org/wiki/index.php/U ... _Scripting
[2] http://www.bci2000.org/wiki/index.php/C ... Automation
[3] http://www.bci2000.org/wiki/index.php/T ... _Connector
[4] https://events.r20.constantcontact.com/ ... eq=&c=&ch=
[5] http://www.bci2000.org/phpbb/viewtopic.php?f=1&t=2955

GuglielmoElefante
Posts: 3
Joined: 29 Jan 2016, 12:29

Re: How to control CONFIG, SET CONFIG, START buttons via P3SpellerTask.cpp (BCI2000.sln)

Post by GuglielmoElefante » 01 Feb 2016, 04:50

Thank you for rapid answer, I will study these opportunities.

Regards, Guglielmo.

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests