Thank you for helping me out on this one.
I wasn't able to find any relevant leads on using/exploting DummyApplication component, please can you point me to it since this seams like the best way to integrate an already existing game into the BCI2000. I HAVE found your quote on the BB (other thread) saying:
"It is not possible to start BCI2000 without an application module. However, you may easily create a dummy application module that only contains the two AppConnector filters. "
- mellinger
Does that mean I have to program my own DummyApplication using the one given as a template or what? I am kind of lost here o_O
On the other hand, since BCI2000AutomationLib has a .NET component, it was easy to reproduce the Visual Basic code in C# on using the BCI2000Remote class posted in
http://www.bci2000.org/wiki/index.php/C ... Automation
Here's the code
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BCI2000AutomationLib;
namespace bci2000
{
class bci2000_controller
{
// Instantiate a BCI2000Remote object
BCI2000Remote bci = new BCI2000Remote();
public void TestConnect() {
bool ok_conn = false;
// Start the Operator module, and connect to it
ok_conn = bci.Connect();
//If Not ok Then MsgBox bci.Result
if(!ok_conn) Console.WriteLine(bci.Result);
// Startup modules
string[] modules = new string[3];
modules[0] = "SignalGenerator --local";
modules[1] = "DummySignalProcessing --local";
modules[2] = "FeedbackDemo --local";
ok_conn = bci.StartupModules(modules);
//If Not ok Then MsgBox bci.Result
if (!ok_conn) Console.WriteLine(bci.Result);
// Load a parameter file, and set subject information
ok_conn = bci.LoadParametersRemote("../parms/examples/CursorTask_SignalGenerator.prm");
//If Not ok Then MsgBox bci.Result
if (!ok_conn) Console.WriteLine(bci.Result);
bci.SubjectID = "SUB";
// Start a run
ok_conn = bci.Start();
// Display the feedback signal while BCI2000 is running
string state = "Running";
double value = 0;
while (ok_conn && state=="Running") {
ok_conn = bci.GetControlSignal(1, 1, value);
Console.WriteLine(value);
System.Threading.Thread.Sleep(500);
ok_conn = bci.GetSystemState(state);
}
bci.Stop();
// Shut down BCI2000
bci.Disconnect();
// Release and delete the BCI2000Remote object
bci = null;
}
}
}
But I have a problem when trying to run the first simple demo from the tutorial.
The actual problem is that i get only one value from the system before
Code: Select all
ok_conn = bci.GetSystemState(state);
returns
"Running" as a state of the system, but the returned bool value is false. My guess is that some module shut down???
Am I missing something here. I double checked against the remote class C++ code posted in
Code: Select all
http://www.bci2000.org/wiki/index.php/Programming_Reference:BCI2000Remote_Class
but I made all of the necessary steps.
//Petar