Page 1 of 1

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

Posted: 30 Jan 2016, 09:18
by GuglielmoElefante
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.

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

Posted: 30 Jan 2016, 10:48
by pbrunner

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] ... _Scripting
[2] ... Automation
[3] ... _Connector
[4] ... eq=&c=&ch=

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

Posted: 01 Feb 2016, 04:50
by GuglielmoElefante
Thank you for rapid answer, I will study these opportunities.

Regards, Guglielmo.