Document version: 1.0
Author(s): Sven Gijsen
Date: July 2015
BrainStim supports the integration of plugins that can further extend BrainStim, this is done by the internal Plugin Framework. It has an automatic plugin detecting and loading functionality that can integrate a plugin in different sections of the program, these section are the:
Furthermore it's even possible for a plugin to register one or more specific file type(s) by extension so it can implement the loading, saving and execution of such document types, read this document for more information about this topic. A plugin can implement a custom dialog that is available by clicking a menu entry inside the menu Plugins > Extension Plugins or Plugins > Device Plugins depending on the type of the Plugin. This dialog together with it's underlying functionality is completely implemented by the plugin itself. A standard BrainStim installation contains some plugins that are automatically installed together with BrainStim, read this document for more information about this.
Let's try to make use of this Internal Network Interface by enabling it and control one instance of a BrainStim process by another.
Important! If we want to run two instances of BrainStim processes simultaneously we first have to make sure that this is possible by enabling the Allow multiple instances of BrainStim setting in the Settings Dialog.
Debug: "Network Server started @ <ip-address>:<port>"
The above message tells us that the Internal Network Interface Server was successfully started together with the auto assigned IP-Address (see <ip-address>) and assigned Port number (see <port>).
Debug: Configured Network Server disabled.
Important! The above message tells us that the Internal Network Interface Server was not started for this instance of BrainStim, because only one instance of BrainStim at a time can be used for handling network messages.
Furthermore the (first instance of) BrainStim now also shows the following message to appear inside the 'default' OutputLog tab:
-> SocketData Received [Log("New BrainStim Instance Initializing...");] New BrainStim Instance Initializing... -> SocketData Successfully executed by the Script Engine.
Important! Here we can see that the (first instance of) BrainStim also knows (detects) if another instance of BrainStim is starting, this feature is always enabled even if you disable the Network Server setting of the Settings Dialog because these messages (SocketData) are send over another interface.
Now we can use the second instance of BrainStim to send messages (script code) to the first Instance, but first you'll have to make sure to install and enable the TCPNetworkServer plugin which is not by default installed. You can find it here. Alternatively you could make your own custom implementation for a client that can connect to BrainStim.
Now we'll proceed with making use of the TCPNetworkServer plugin.
|
... Valid Script Syntax ... ... Script started Evaluating on 13:24:09... ServerDataRecieved() called: Welcome you're connected to BrainStim CleanupScript succeeded! ... Total Time(ms): 11 ... Script fully Evaluated on 13:24:09 ...
We see that when we connect through this network interface and established a connection a welcome message "Welcome you're connected to BrainStim" is then send from the server to the client.
Debug: "The Network Server accepted an incoming connection" This is send from the client Debug: NetworkServerThreadClient::clientDisconnected A client disconnected an active network connection.
The first line tells us that the Internal Network Interface accepted an Incoming connection. The second line is the result from the execution of the script code send:
|