com.NeuroSky.ThinkGear.Util
Class HeadsetData

java.lang.Object
  extended by com.NeuroSky.ThinkGear.Util.HeadsetData

public class HeadsetData
extends java.lang.Object

This class is a convenience class to store data coming from a ThinkGear EM headset.


Field Summary
 float alpha1
          The alpha wave component of an EEG.
 float alpha2
          The alpha wave component of an EEG.
 int attention
          The interpreted attention level (a value between 0 and 100, where 100 indicates high attention).
 int batteryLevel
          The battery level (a value between 0 and 128, where 128 indicates a full battery).
 float beta1
          The beta wave component of an EEG.
 float beta2
          The beta wave component of an EEG.
 float delta
          The delta wave component of an EEG (0 to 3 Hz).
 int errorRate
          The signal error rate of the headset (a value between 0 and 128, where 128 indicates that the signal is completely bad).
 float gamma1
          The gamma wave component of an EEG.
 float gamma2
          The gamma wave component of an EEG.
 int meditation
          The interpreted meditation level (a value between 0 and 100, where 100 indicates high meditation).
 float theta
          The theta wave component of an EEG (4 to 7 Hz).
 
Constructor Summary
HeadsetData()
          Class constructor taking no parameters and initializing all instance variables to invalid (negative) values.
HeadsetData(int meditation, int attention, int errorRate, int batteryLevel, float delta, float theta, float alpha1, float alpha2, float beta1, float beta2, float gamma1, float gamma2)
          Class constructor specifying values for each of the instance variables.
 
Method Summary
 boolean isOffHead()
          Check whether the headset is off the head.
 java.lang.String toString()
          Overridden toString() method to print out all of the instance variables in a comprehensible manner.
 java.lang.String[] toStringArray()
          Generate debug output where the different debug strings are tokenized into separate String[] elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

meditation

public int meditation
The interpreted meditation level (a value between 0 and 100, where 100 indicates high meditation).


attention

public int attention
The interpreted attention level (a value between 0 and 100, where 100 indicates high attention).


errorRate

public int errorRate
The signal error rate of the headset (a value between 0 and 128, where 128 indicates that the signal is completely bad).


batteryLevel

public int batteryLevel
The battery level (a value between 0 and 128, where 128 indicates a full battery).


delta

public float delta
The delta wave component of an EEG (0 to 3 Hz). The value is a floating point number greater than 0.


theta

public float theta
The theta wave component of an EEG (4 to 7 Hz). The value is a floating point number greater than 0.


alpha1

public float alpha1
The alpha wave component of an EEG. alpha1 represents waves from 8 to 10 Hz. The value is a floating point number greater than 0.


alpha2

public float alpha2
The alpha wave component of an EEG. alpha2 represents waves from 10 to 12 Hz. The value is a floating point number greater than 0.


beta1

public float beta1
The beta wave component of an EEG. beta1 represents waves from 12 to 20 Hz. The value is a floating point number greater than 0.


beta2

public float beta2
The beta wave component of an EEG. beta2 represents waves from 20 to 30 Hz. The value is a floating point number greater than 0.


gamma1

public float gamma1
The gamma wave component of an EEG. gamma1 represents waves from 30 to 40 Hz. The value is a floating point number greater than 0.


gamma2

public float gamma2
The gamma wave component of an EEG. gamma2 represents waves from 40 to 50 Hz. The value is a floating point number greater than 0.

Constructor Detail

HeadsetData

public HeadsetData()
Class constructor taking no parameters and initializing all instance variables to invalid (negative) values.


HeadsetData

public HeadsetData(int meditation,
                   int attention,
                   int errorRate,
                   int batteryLevel,
                   float delta,
                   float theta,
                   float alpha1,
                   float alpha2,
                   float beta1,
                   float beta2,
                   float gamma1,
                   float gamma2)
Class constructor specifying values for each of the instance variables.

Parameters:
meditation - the desired meditation level
attention - the desired attention level
errorRate - the rate at which errors are seen (lower is better)
batteryLevel - the battery level (higher is better)
Method Detail

toString

public java.lang.String toString()
Overridden toString() method to print out all of the instance variables in a comprehensible manner. This is just a concatenated version of the elements returned from toStringArray().

Overrides:
toString in class java.lang.Object
Returns:
a string describing the object

toStringArray

public java.lang.String[] toStringArray()
Generate debug output where the different debug strings are tokenized into separate String[] elements. This is useful for displaying debug output to a Graphics context using Graphics.drawString()

Returns:
an array storing different components of the debug string

isOffHead

public boolean isOffHead()
Check whether the headset is off the head. This simply interprets the headset data, and checks to see whether both attention and meditation are 0.

Returns:
true if the headset is detected to be off the head, false otherwise