BioRadio SDK - Java Android  1.1
com.glneurotech.devices.common.Signal Class Reference
Inheritance diagram for com.glneurotech.devices.common.Signal:
com.glneurotech.devices.bioradio.BioRadioSignal com.glneurotech.devices.bioradio.BioPotentialSignal com.glneurotech.devices.bioradio.signals.AccelerometerSignal com.glneurotech.devices.bioradio.signals.AuxiliarySignal com.glneurotech.devices.bioradio.signals.GyroscopeSignal com.glneurotech.devices.bioradio.signals.HeartRateSignal com.glneurotech.devices.bioradio.signals.PpgSignal com.glneurotech.devices.bioradio.signals.SpO2Signal com.glneurotech.devices.bioradio.signals.GsrSignal

Classes

interface  ScaleFunction
 

Public Member Functions

final SignalGroup getOwner ()
 
 Signal (SignalGroup owner, String name, Optional< Integer > bufferSize, ScaleFunction scaleDelegate, double scaledMaxValue, double scaledMinValue, double rawMinValue, double rawMaxValue, int sampleRate) throws IOException
 
final int getSamplesPerSecond ()
 
final void setSamplesPerSecond (int value)
 
final Long getSampleInterval ()
 
final void setSampleInterval (Long value)
 
final double getMaxValue ()
 
final void setMaxValue (double value)
 
final double getMinValue ()
 
final void setMinValue (double value)
 
final double getRawMinValue ()
 
final void setRawMinValue (double value)
 
final double getRawMaxValue ()
 
final void setRawMaxValue (double value)
 
final String getName ()
 
final void setName (String value)
 
final String getUnits ()
 
final void setUnits (String value)
 
final GlntStream getRawDataStream ()
 
final void setRawDataStream (GlntStream value)
 
final int getReadingsAvailable ()
 
final void setReadingsAvailable (int value)
 
final boolean getEnabled ()
 
final void setEnabled (boolean value)
 
ScaleFunction getScalingDelegate ()
 
void setScalingDelegate (ScaleFunction value)
 
final void reset ()
 
final void addSample (long timeStamp, long rawValue) throws InternalBufferOverflowException
 
final long getNextRawValue ()
 
final double [] getScaledValueArray ()
 
final double [] getScaledValueArray (int count)
 
final java.lang.Iterable< Double > getScaledValues ()
 
final long [] getRawValueArray (int count)
 
final java.lang.Iterable< Long > getRawValues (int count)
 
final java.lang.Iterable< Long > getRawValues ()
 
final Sample getNextSample ()
 
final Iterable< SamplegetSamples ()
 
final void close () throws IOException
 

Static Public Member Functions

static double defaultScaleFunction (long unscaledValue)
 

Detailed Description

Represents a single stream of samples from a device sensor. The sample class contains methods to read data from a device in various ways. It also contains metadata that describes the range of the signal values, the sample rate, and other pertinent details.

Constructor & Destructor Documentation

◆ Signal()

com.glneurotech.devices.common.Signal.Signal ( SignalGroup  owner,
String  name,
Optional< Integer >  bufferSize,
ScaleFunction  scaleDelegate,
double  scaledMaxValue,
double  scaledMinValue,
double  rawMinValue,
double  rawMaxValue,
int  sampleRate 
) throws IOException

Sets the signal parameters.

Parameters
ownerTake a SignalGroup.
nameTake a string.
bufferSizeTake an optional integer.
scaleDelegateTake a ScaleFunction
scaledMaxValueTake a double value.
scaledMinValueTake a double value.
rawMinValueTake a double value.
rawMaxValueTake a double value.
sampleRateTake aan integer.
Exceptions
IOException

Member Function Documentation

◆ addSample()

final void com.glneurotech.devices.common.Signal.addSample ( long  timeStamp,
long  rawValue 
) throws InternalBufferOverflowException

Add row data sample.

Parameters
timeStampTake a long value.
rawValueTake a long value.
Exceptions
InternalBufferOverflowException

◆ close()

final void com.glneurotech.devices.common.Signal.close ( ) throws IOException

Close the stream.

Exceptions
IOException

◆ defaultScaleFunction()

static double com.glneurotech.devices.common.Signal.defaultScaleFunction ( long  unscaledValue)
static

Default scale function.

Parameters
unscaledValueTake a long value.
Returns

◆ getEnabled()

final boolean com.glneurotech.devices.common.Signal.getEnabled ( )

Indicates whether the signal is enabled. Enabled is set to true by default. When set to false, no data will be saved to the signal. This is useful when there are unused signals being sent from the device. Disabling them will save system resources and processing time.

◆ getMaxValue()

final double com.glneurotech.devices.common.Signal.getMaxValue ( )

The maximum scaled value that this signal supports.

◆ getMinValue()

final double com.glneurotech.devices.common.Signal.getMinValue ( )

The minimum scaled value that this signal supports.

◆ getName()

final String com.glneurotech.devices.common.Signal.getName ( )

The name associated with this signal.

◆ getNextRawValue()

final long com.glneurotech.devices.common.Signal.getNextRawValue ( )

Returns the next raw sensor value in the buffer.

Returns
The next raw sensor value in the buffer.

◆ getNextSample()

final Sample com.glneurotech.devices.common.Signal.getNextSample ( )

Used to retrieve the next Sample object in the signal buffer.

Returns
A Sample object representing the next reading from the signal buffer.

◆ getOwner()

final SignalGroup com.glneurotech.devices.common.Signal.getOwner ( )

The SignalGroup to which this signal belongs. All Signals belong to a SignalGroup which clusters similar signals together for convenient access.

◆ getRawDataStream()

final GlntStream com.glneurotech.devices.common.Signal.getRawDataStream ( )

Gets raw data stream.

Returns

◆ getRawMaxValue()

final double com.glneurotech.devices.common.Signal.getRawMaxValue ( )

The maximum unscaled value that this signal supports.

◆ getRawMinValue()

final double com.glneurotech.devices.common.Signal.getRawMinValue ( )

The minimum unscaled value that this signal supports.

◆ getRawValueArray()

final long [] com.glneurotech.devices.common.Signal.getRawValueArray ( int  count)

Gets an array of raw (unscaled) values from the signal.

Parameters
countThe number of samples to read
Returns
An array of long values representing sequential readings from the device.

◆ getRawValues() [1/2]

final java.lang.Iterable<Long> com.glneurotech.devices.common.Signal.getRawValues ( int  count)

Enumerates over raw values in the signal buffer.

Parameters
countThe number of values to read. Must be less than the total ReadingsAvailable
Returns
An enumerator object of long values

◆ getRawValues() [2/2]

final java.lang.Iterable<Long> com.glneurotech.devices.common.Signal.getRawValues ( )

Enumerates over raw values in the signal buffer.

Returns

◆ getReadingsAvailable()

final int com.glneurotech.devices.common.Signal.getReadingsAvailable ( )

The number of samples available to be read

◆ getSampleInterval()

final Long com.glneurotech.devices.common.Signal.getSampleInterval ( )

The time interval between sample readings.

◆ getSamples()

final Iterable<Sample> com.glneurotech.devices.common.Signal.getSamples ( )

Iterates over all samples currently in the signal buffer.

Returns
An enumerator object of Samples

◆ getSamplesPerSecond()

final int com.glneurotech.devices.common.Signal.getSamplesPerSecond ( )

The number of samples transmitted by the device in one second.

◆ getScaledValueArray() [1/2]

final double [] com.glneurotech.devices.common.Signal.getScaledValueArray ( )

Used to retrieve an array of scaled sample values from the signal

Returns

◆ getScaledValueArray() [2/2]

final double [] com.glneurotech.devices.common.Signal.getScaledValueArray ( int  count)

Creates an array of values representing the samples from the signal.

Parameters
countThe number of readings to read from the device. Must be less than or equal to the number of ReadingsAvailable
Returns
An array of double precision values that represent sequential scaled readings from the device

◆ getScaledValues()

final java.lang.Iterable<Double> com.glneurotech.devices.common.Signal.getScaledValues ( )

Enumerates over all scaled values currently in the signal buffer.

Returns
An enumerator object of double values.

◆ getScalingDelegate()

ScaleFunction com.glneurotech.devices.common.Signal.getScalingDelegate ( )

Gets scaling delegate.

Returns

◆ getUnits()

final String com.glneurotech.devices.common.Signal.getUnits ( )

The units of measurement in which scaled values are reported.

◆ reset()

final void com.glneurotech.devices.common.Signal.reset ( )

Clears any data in the input buffer for this signal.

◆ setEnabled()

final void com.glneurotech.devices.common.Signal.setEnabled ( boolean  value)

Sets enabled to the value passed.

Parameters
valueTake a boolean.

◆ setMaxValue()

final void com.glneurotech.devices.common.Signal.setMaxValue ( double  value)

Set maximum scaled value that this signal supports.

Parameters
valueTake a double value.

◆ setMinValue()

final void com.glneurotech.devices.common.Signal.setMinValue ( double  value)

Sets minimum scaled value that this signal supports.

Parameters
valueTake a double value.

◆ setName()

final void com.glneurotech.devices.common.Signal.setName ( String  value)

Sets name associated with this signal.

Parameters
valueTake an string.

◆ setRawDataStream()

final void com.glneurotech.devices.common.Signal.setRawDataStream ( GlntStream  value)

Sets the taw data stream.

Parameters
valueTake a GlntStream.

◆ setRawMaxValue()

final void com.glneurotech.devices.common.Signal.setRawMaxValue ( double  value)

Sets the maximum unscaled that this signal supports.

Parameters
valueTake a double value.

◆ setRawMinValue()

final void com.glneurotech.devices.common.Signal.setRawMinValue ( double  value)

Sets minimum unscaled value that this signal supports.

Parameters
valueTake a double value.

◆ setReadingsAvailable()

final void com.glneurotech.devices.common.Signal.setReadingsAvailable ( int  value)

Sets reading available.

Parameters
valueTake an integer.

◆ setScalingDelegate()

void com.glneurotech.devices.common.Signal.setScalingDelegate ( ScaleFunction  value)

Sets scaling delegate

Parameters
valueTake a ScaleFunction as parameter.

◆ setUnits()

final void com.glneurotech.devices.common.Signal.setUnits ( String  value)

Sets units of measuremnet in which scaled values are reported.

Parameters
valueTake a string.

The documentation for this class was generated from the following file: