Class CalibrationManager
The CalibrationManager is the manager handling the whole calibration process.
Namespace: NextMind.Calibration
Assembly: NextMind.dll
Syntax
[AddComponentMenu("NextMind/CalibrationManager")]
public class CalibrationManager : MonoBehaviour
Remarks
Here is the process in a simplified way after calling StartCalibration():
- Prepare the NeuroTags by calling OnInitialize(NeuroTag)
- Run 12 times the following process, with each time a different NeuroTag
- Call OnStartCalibrating(NeuroTag)
- Wait 3 seconds
- Call OnEndCalibrating(NeuroTag)
- Stop the calibration, harvest and send the CalibrationResults
This process has a static part that you cannot change. This static part is mainly about the trials (i.e. the presentation of a NeuroTag) management:
- the trials number
- the trials duration
- the time between trials
The customizable part is the way the NeuroTags will be shown and hidden to the user. You have two ways to do it:
- By settings the UnityEvent on the CalibrationManager component in the Unity Editor
- Through script, by inheriting from the TagCalibrationBehaviour and implementing the mandatory functions: OnInitialize(NeuroTag), OnStartCalibrating(NeuroTag) and OnEndCalibrating(NeuroTag)
Fields
onCalibrationError
Event triggered when the calibration ended with errors.
Declaration
public CalibrationErrorEvent onCalibrationError
Field Value
Type | Description |
---|---|
CalibrationErrorEvent |
onCalibrationOver
Event triggered when the calibration is done.
Declaration
public CalibrationEvent onCalibrationOver
Field Value
Type | Description |
---|---|
CalibrationEvent |
onCalibrationResultsAvailable
Event triggered when the CalibrationResults are available after a calibration.
Declaration
public CalibrationResultsEvent onCalibrationResultsAvailable
Field Value
Type | Description |
---|---|
CalibrationResultsEvent |
onCalibrationResultsError
Event triggered when the manager did not managed to get the CalibrationResults successfuly.
Declaration
public CalibrationResultsErrorEvent onCalibrationResultsError
Field Value
Type | Description |
---|---|
CalibrationResultsErrorEvent |
onNeuroTagGetCalibrationFocus
Event triggered when the CalibrationManager starts using a NeuroTag.
Declaration
public CalibrationNeuroTagEvent onNeuroTagGetCalibrationFocus
Field Value
Type | Description |
---|---|
CalibrationNeuroTagEvent |
Remarks
This event is visible in the editor (and thus will be triggered) only if you choose Custom as TagCalibrationBehaviour value.
onNeuroTagInitForCalibration
Event triggered before the actual start of a calibration, on each NeuroTag used for the calibration.
Declaration
public CalibrationNeuroTagEvent onNeuroTagInitForCalibration
Field Value
Type | Description |
---|---|
CalibrationNeuroTagEvent |
Remarks
This event is visible in the editor (and thus will be triggered) only if you choose Custom as TagCalibrationBehaviour value.
onNeuroTagLoseCalibrationFocus
Event triggered when the CalibrationManager stops using a NeuroTag.
Declaration
public CalibrationNeuroTagEvent onNeuroTagLoseCalibrationFocus
Field Value
Type | Description |
---|---|
CalibrationNeuroTagEvent |
Remarks
This event is visible in the editor (and thus will be triggered) only if you choose Custom as TagCalibrationBehaviour value.
tagCalibrationBehaviourType
The type of behaviour that the user chose to use on NeuroTag during calibration.
Declaration
public TagCalibrationBehaviour.BehaviourType tagCalibrationBehaviourType
Field Value
Type | Description |
---|---|
TagCalibrationBehaviour.BehaviourType |
Properties
CalibrationResultsAvailable
Did the CalibrationManager already got the CalibrationResults since the last call of StartCalibration() ?
Declaration
public bool CalibrationResultsAvailable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsCalibrating
Is the system currently running a calibration?
Declaration
public bool IsCalibrating { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
It may be a few frames delay between the call to StartCalibration() and this property to return true
.
NonControlDurationBeginning
The time of the non control trial at the beginning of the calibration in seconds.
Declaration
public float NonControlDurationBeginning { get; }
Property Value
Type | Description |
---|---|
System.Single |
NonControlDurationEnd
The time of the non control trial at the end of the calibration in seconds.
Declaration
public float NonControlDurationEnd { get; }
Property Value
Type | Description |
---|---|
System.Single |
NumberOfTrials
The number of NeuroTags supervisions.
Declaration
public int NumberOfTrials { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
TrialDuration
The time of supervision of a NeuroTag in seconds.
Declaration
public float TrialDuration { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
SetNeuroTagBehaviour(TagCalibrationBehaviour)
Set a new behaviour to use on the NeuroTags during calibration.
Declaration
public void SetNeuroTagBehaviour(TagCalibrationBehaviour behaviour)
Parameters
Type | Name | Description |
---|---|---|
TagCalibrationBehaviour | behaviour | The new behaviour. |
StartCalibration()
Start the calibration if the system's status allows it.
Declaration
public void StartCalibration()