Class NeuroManager
NeuroManager is the main component of your scene, managing all the aspects of the NextMind system from the Device Bluetooth connection to NeuroTag interaction.
Namespace: NextMind
Assembly: NextMind.dll
Syntax
[AddComponentMenu("NextMind/NeuroManager")]
[DisallowMultipleComponent]
public class NeuroManager : MonoBehaviour
Fields
additionalTrackingCameras
Declaration
public Camera[] additionalTrackingCameras
Field Value
Type | Description |
---|---|
UnityEngine.Camera[] |
onDeviceAvailable
Event triggered when an device becomes available.
Declaration
public DeviceConnectionEvent onDeviceAvailable
Field Value
Type | Description |
---|---|
DeviceConnectionEvent |
onDeviceConnected
Event triggered when an device becomes connected.
Declaration
public DeviceConnectionEvent onDeviceConnected
Field Value
Type | Description |
---|---|
DeviceConnectionEvent |
onDeviceDisconnected
Event triggered when an device becomes disconnected.
Declaration
public DeviceConnectionEvent onDeviceDisconnected
Field Value
Type | Description |
---|---|
DeviceConnectionEvent |
onDeviceEvent
Event triggered when there is an error.
Declaration
public DeviceEvent onDeviceEvent
Field Value
Type | Description |
---|---|
DeviceEvent |
onDeviceUnavailable
Event triggered when an device becomes unavailable.
Declaration
public DeviceConnectionEvent onDeviceUnavailable
Field Value
Type | Description |
---|---|
DeviceConnectionEvent |
onGlobalStatusEvent
Event triggered when there is an error.
Declaration
public GlobalStatusEvent onGlobalStatusEvent
Field Value
Type | Description |
---|---|
GlobalStatusEvent |
onScanningStarted
Event triggered when a scan is started by the NeuroManager.
Declaration
public ScanningEvent onScanningStarted
Field Value
Type | Description |
---|---|
ScanningEvent |
onScanningStopped
Event triggered when a scan is stopped by the NeuroManager.
Declaration
public ScanningEvent onScanningStopped
Field Value
Type | Description |
---|---|
ScanningEvent |
trackingCamera
Declaration
public Camera trackingCamera
Field Value
Type | Description |
---|---|
UnityEngine.Camera |
Properties
AdditionalTrackingCameras
Declaration
public Camera[] AdditionalTrackingCameras { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.Camera[] |
AttemptReconnect
Should the NeuroManager automatically start a new connection if the connected Device is lost?
Declaration
public bool AttemptReconnect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoConnect
Should the NeuroManager attempt to connect to the first found Device?
Declaration
public bool AutoConnect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AvailableDevices
All available, not connected Devices.
Declaration
public List<Device> AvailableDevices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Device> |
ConnectedDevices
All currently connected Devices.
Declaration
public List<Device> ConnectedDevices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Device> |
Devices
The list of all the Devices known by the system.
Declaration
public List<Device> Devices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Device> |
Instance
Declaration
public static NeuroManager Instance { get; }
Property Value
Type | Description |
---|---|
NeuroManager |
IsConnectingToDevice
Is the NeuroManager currently trying to connect to a Device?
Declaration
public bool IsConnectingToDevice { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsScanning
Is the system currently looking for available Devices?
Declaration
public bool IsScanning { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxNumberOfNeuroTags
Maximum number of targets simultaneously active on the screen.
Declaration
public uint MaxNumberOfNeuroTags { get; }
Property Value
Type | Description |
---|---|
System.UInt32 | A value between 0 and 10. |
RegisteredNeuroTags
All currently registered (i.e. active and know by the system) NeuroTags.
Declaration
public static List<NeuroTag> RegisteredNeuroTags { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<NeuroTag> |
ScanningBehaviour
Set how this NeuroManager should handle looking for a Device.
Declaration
public NeuroManager.ScanBehaviour ScanningBehaviour { get; set; }
Property Value
Type | Description |
---|---|
NeuroManager.ScanBehaviour |
SimulateDevice
Should we use a fake NextMind device implementation?
Declaration
public bool SimulateDevice { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
StimulationEnabled
Does the NeuroManager applies stimulation values to NeuroTags?
If this is set to false
, the NeuroTags will be considered as inactive (see IsActive).
Declaration
public bool StimulationEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This is used internally to disable stimulation during critical phases of the calibration process. You can use it safely outside the calibration process though.
TrackingCamera
Property accessing the current tracking camera.
This is the camera used to determine if a NeuroTag has to be taken into account by the system regarding its position.
Declaration
public Camera TrackingCamera { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.Camera |
Remarks
If the user did not referenced it in the editor, Camera.main
will be used.
Methods
ConnectDevice(Device, Boolean, Boolean, String)
Request that the device
be connected.
Declaration
public bool ConnectDevice(Device device, bool attemptReconnect = true, bool filterPaired = true, string userName = "")
Parameters
Type | Name | Description |
---|---|---|
Device | device | The device to which the system should connect. |
System.Boolean | attemptReconnect | Attempt reconnect device if connection error |
System.Boolean | filterPaired | Filter paired devices |
System.String | userName | The username linked to this device |
Returns
Type | Description |
---|---|
System.Boolean |
|
DisconnectDevice(Device)
Request that the device
be disconnected.
Declaration
public bool DisconnectDevice(Device device)
Parameters
Type | Name | Description |
---|---|---|
Device | device | The device the system should disconnect. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetConfigurationFromFile()
Declaration
public void GetConfigurationFromFile()
IsReady()
Is the system up and running? Ready means that at least one device is connected, and all connected devices are in a ready/decoding state.
Declaration
public bool IsReady()
Returns
Type | Description |
---|---|
System.Boolean |
|
StartScanning()
Request that the system start discovering new Devices.
Declaration
public bool StartScanning()
Returns
Type | Description |
---|---|
System.Boolean |
|
StopScanning()
Request that the system stop discovering new Devices.
Declaration
public bool StopScanning()
Returns
Type | Description |
---|---|
System.Boolean |
|