Difference between revisions of "EcgDevice Class"

From Neurotech Software Development Kit
Jump to: navigation, search
(Android)
Line 56: Line 56:
 
==Constructor Summary==
 
==Constructor Summary==
 
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
 
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
 
 
<tr>
 
<tr>
 
<th class="colOne" scope="col">Constructor and Description</th>
 
<th class="colOne" scope="col">Constructor and Description</th>
Line 64: Line 63:
 
</tr>
 
</tr>
 
</table>
 
</table>
</li>
+
 
</ul>
+
 
<!-- ========== METHOD SUMMARY =========== -->
+
==Methods Summary==
<ul class="blockList">
 
<li class="blockList"><a name="method.summary">
 
<!--  -->
 
</a>
 
<h3>Method Summary</h3>
 
 
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
 
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
 
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
 
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
Line 215: Line 209:
 
</ul>
 
</ul>
 
</div>
 
</div>
<div class="details">
+
 
<ul class="blockList">
+
==Field Detail==
<li class="blockList">
 
<!-- ============ FIELD DETAIL =========== -->
 
<ul class="blockList">
 
<li class="blockList"><a name="field.detail">
 
<!--  -->
 
</a>
 
<h3>Field Detail</h3>
 
 
<a name="totalSignalDurationChanged">
 
<a name="totalSignalDurationChanged">
 
<!--  -->
 
<!--  -->
Line 249: Line 236:
 
</li>
 
</li>
 
</ul>
 
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
+
 
<ul class="blockList">
+
 
<li class="blockList"><a name="constructor.detail">
+
==Constructor Detail==
<!--  -->
+
 
</a>
 
<h3>Constructor Detail</h3>
 
<a name="EcgDevice-long-">
 
<!--  -->
 
</a>
 
<ul class="blockListLast">
 
<li class="blockList">
 
 
<h4>EcgDevice</h4>
 
<h4>EcgDevice</h4>
 
<pre>public&nbsp;EcgDevice(long&nbsp;nativeObjPtr)</pre>
 
<pre>public&nbsp;EcgDevice(long&nbsp;nativeObjPtr)</pre>
</li>
+
 
</ul>
+
 
</li>
+
==Method Detail==
</ul>
+
 
<!-- ============ METHOD DETAIL ========== -->
 
<ul class="blockList">
 
<li class="blockList"><a name="method.detail">
 
<!--  -->
 
</a>
 
<h3>Method Detail</h3>
 
<a name="finalize--">
 
<!--  -->
 
</a>
 
<ul class="blockList">
 
<li class="blockList">
 
 
<h4>finalize</h4>
 
<h4>finalize</h4>
 
<pre>public&nbsp;void&nbsp;finalize()
 
<pre>public&nbsp;void&nbsp;finalize()

Revision as of 06:40, 15 March 2017

ECG Device class implemets methods for using universal sensors as cardiography system.

Android

ru.neurotech.neurodevices.ecg

Class EcgDevice

Related Classes

ru.neurotech.neurodevices.ecg.EcgDeviceConnector

ru.neurotech.neurodevices.ecg.RPeak

Classes hierarchy

  • java.lang.Object

Class definition

public class EcgDevice extends VisualizableDevice

Fields Summary

Modifier and Type Field and Description
SubscribersNotifier<Boolean> electrodesAttachedStateChanged

Notifies when electrodes are attached or detached To get electrodes state manually use getElectrodesState

SubscribersNotifier<Double> totalSignalDurationChanged

Notifies subscribers when signal duration is changed, when new samples received or data been loaded from external storage, or buffers been reset

Fields inherited from class ru.neurotech.common.VisualizableDevice
deviceStateChanged

Constructor Summary

Constructor and Description
<a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#EcgDevice-long-">EcgDevice</a>(long nativeObjPtr) 


Methods Summary

All Methods <a href="javascript:show(2);">Instance Methods</a> <a href="javascript:show(8);">Concrete Methods</a> 
Modifier and Type Method and Description
void <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#close--">close</a>() 
void <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#finalize--">finalize</a>() 
java.lang.String <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getAddress--">getAddress</a>()
Returns Bluetooth LE MAC address
int <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getAverageHeartRateOnInterval-double-double-">getAverageHeartRateOnInterval</a>(double startTime,
                            double endTime)
Returns average heart rate based on NN-interval values from specified time interval
int <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getBatteryLevel--">getBatteryLevel</a>()
Returns battery state
int <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getCurrentHeartRate--">getCurrentHeartRate</a>()
Calculates heart rate for recently received ECG samples
Use this method to monitor heart rate during signal receiving is active
It's not recommended to use this method to calculate heart rate
while signal receiving is stopped, use getAverageHeartRateOnInterval instead
double <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getCurrentHeartRateVariability--">getCurrentHeartRateVariability</a>()
Returns currently detected value of heart rate variability
Use this method to monitor HRV during signal receiving
To get HRV for various intervals while signal receiving is stopped
use getHeartRateVariabilityForInterval
double <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getCurrentStressIndex--">getCurrentStressIndex</a>()
Returns value of stress index for real-time monitoring
Use this method to monitor stress index while signal receiving is active
To get stress index for various intervals while signal receiving is stopped
use getStressIndexForInterval
double[] <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getEcgSignal-double-double-">getEcgSignal</a>(double time,
           double duration)
Returns ECG signal stored in buffer for selected time interval
If interval exceeds maximum or minimum buffer time, signal samples
for these intervals will be equal to zero
boolean <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getElectrodesState--">getElectrodesState</a>()
Returns flag indicating whether electrodes properly attached or not
double <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getHeartRateVariabilityForInterval-double-double-">getHeartRateVariabilityForInterval</a>(double startTime,
                                 double endTime)
Returns average value of heart rate variability on interval
java.lang.String <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getName--">getName</a>()
Returns name of BLE device
<a href="../../../../ru/neurotech/neurodevices/NeuroDevice.html" title="class in ru.neurotech.neurodevices">NeuroDevice</a> <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getNeuroDevice--">getNeuroDevice</a>()
Returns physical device object which this visual device represents
<a href="../../../../ru/neurotech/neurodevices/ecg/RPeak.html" title="class in ru.neurotech.neurodevices.ecg">RPeak</a>[] <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getRWavesOnInterval-double-double-">getRWavesOnInterval</a>(double startTime,
                  double endTime)
Detects R-waves in signal for specified time interval
double <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getStressIndexForInterval-double-double-">getStressIndexForInterval</a>(double startTime,
                        double endTime)
Returns average value of stress index on interval
double <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#getTotalSignalDuration--">getTotalSignalDuration</a>()
Returns total signal duration in current test
void <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#reset--">reset</a>()
Clears signal buffer, sets duration to zero and resets all parameters to default values
void <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#startReceive--">startReceive</a>() 
void <a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html#stopReceive--">stopReceive</a>() 
  • <a name="methods.inherited.from.class.java.lang.Object"> </a>

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

</li> </ul> </li> </ul> </div>

Field Detail

<a name="totalSignalDurationChanged"> </a>

  • totalSignalDurationChanged

    public final <a href="../../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a><java.lang.Double> totalSignalDurationChanged
    Notifies subscribers when signal duration is changed,
    when new samples received or data been loaded from external storage,
    
    or buffers been reset

<a name="electrodesAttachedStateChanged"> </a>

  • electrodesAttachedStateChanged

    public final <a href="../../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a><java.lang.Boolean> electrodesAttachedStateChanged
    Notifies when electrodes are attached or detached To get electrodes state manually use getElectrodesState

</li> </ul>


Constructor Detail

EcgDevice

public EcgDevice(long nativeObjPtr)


Method Detail

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

</li> </ul> <a name="close--"> </a>

  • close

    public void close()

<a name="getName--"> </a>

  • getName

    public java.lang.String getName()
    Description copied from class: <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getName--">VisualizableDevice</a>
    Returns name of BLE device
    Specified by:
    <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getName--">getName</a> in class [[VisualizableDevice Class|VisualizableDevice]
    Returns:
    BLE device name

<a name="getAddress--"> </a>

  • getAddress

    public java.lang.String getAddress()
    Description copied from class: <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getAddress--">VisualizableDevice</a>
    Returns Bluetooth LE MAC address
    Specified by:
    <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getAddress--">getAddress</a> in class [[VisualizableDevice Class|VisualizableDevice]
    Returns:
    device unique address

<a name="getBatteryLevel--"> </a>

  • getBatteryLevel

    public int getBatteryLevel()
    Description copied from class: <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getBatteryLevel--">VisualizableDevice</a>
    Returns battery state
    Specified by:
    <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getBatteryLevel--">getBatteryLevel</a> in class <a href="../../../../ru/neurotech/common/VisualizableDevice.html" title="class in ru.neurotech.common">VisualizableDevice</a>
    Returns:
    battery charge level in percents

<a name="getNeuroDevice--"> </a>

  • getNeuroDevice

    public <a href="../../../../ru/neurotech/neurodevices/NeuroDevice.html" title="class in ru.neurotech.neurodevices">NeuroDevice</a> getNeuroDevice()
    Description copied from class: <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getNeuroDevice--">VisualizableDevice</a>
    Returns physical device object which this visual device represents
    Specified by:
    <a href="../../../../ru/neurotech/common/VisualizableDevice.html#getNeuroDevice--">getNeuroDevice</a> in class [[VisualizableDevice Class|VisualizableDevice]
    Returns:
    NeuroDevice of current visual device

<a name="startReceive--"> </a>

  • startReceive

    public void startReceive()

<a name="stopReceive--"> </a>

  • stopReceive

    public void stopReceive()

<a name="reset--"> </a>

  • reset

    public void reset()
    Clears signal buffer, sets duration to zero and resets all parameters to default values

<a name="getTotalSignalDuration--"> </a>

  • getTotalSignalDuration

    public double getTotalSignalDuration()
    Returns total signal duration in current test
    Returns:
    signal duration in seconds

<a name="getEcgSignal-double-double-"> </a>

  • getEcgSignal

    public double[] getEcgSignal(double time,
                                 double duration)
    Returns ECG signal stored in buffer for selected time interval
    If interval exceeds maximum or minimum buffer time, signal samples
    
    for these intervals will be equal to zero
    Parameters:
    time - Start time of interval
    duration - Duration of interval
    Returns:
    Signal samples array

<a name="getRWavesOnInterval-double-double-"> </a>

  • getRWavesOnInterval

    public <a href="../../../../ru/neurotech/neurodevices/ecg/RPeak.html" title="class in ru.neurotech.neurodevices.ecg">RPeak</a>[] getRWavesOnInterval(double startTime,
                                       double endTime)
    Detects R-waves in signal for specified time interval
    Parameters:
    startTime - Start time of interval
    endTime - End time of interval
    Returns:
    Array of RPeaks

<a name="getCurrentHeartRate--"> </a>

  • getCurrentHeartRate

    public int getCurrentHeartRate()
    Calculates heart rate for recently received ECG samples
    Use this method to monitor heart rate during signal receiving is active
    It's not recommended to use this method to calculate heart rate
    
    while signal receiving is stopped, use getAverageHeartRateOnInterval instead
    Returns:
    Heart rate in beats per minute

<a name="getAverageHeartRateOnInterval-double-double-"> </a>

  • getAverageHeartRateOnInterval

    public int getAverageHeartRateOnInterval(double startTime,
                                             double endTime)
    Returns average heart rate based on NN-interval values from specified time interval
    Parameters:
    startTime - Start time for heart rate calculation
    endTime - End time for heart rate calculation
    Returns:
    Heart rate in beats per minute

<a name="getCurrentHeartRateVariability--"> </a>

  • getCurrentHeartRateVariability

    public double getCurrentHeartRateVariability()
    Returns currently detected value of heart rate variability
    Use this method to monitor HRV during signal receiving
    To get HRV for various intervals while signal receiving is stopped
    
    use getHeartRateVariabilityForInterval
    Returns:
    HRV value

<a name="getHeartRateVariabilityForInterval-double-double-"> </a>

  • getHeartRateVariabilityForInterval

    public double getHeartRateVariabilityForInterval(double startTime,
                                                     double endTime)
    Returns average value of heart rate variability on interval
    Parameters:
    startTime - Start time of calculation interval
    endTime - End time of calculation interval
    Returns:
    HRV value

<a name="getCurrentStressIndex--"> </a>

  • getCurrentStressIndex

    public double getCurrentStressIndex()
    Returns value of stress index for real-time monitoring
    Use this method to monitor stress index while signal receiving is active
    To get stress index for various intervals while signal receiving is stopped
    
    use getStressIndexForInterval
    Returns:
    Stress index of current signal

<a name="getStressIndexForInterval-double-double-"> </a>

  • getStressIndexForInterval

    public double getStressIndexForInterval(double startTime,
                                            double endTime)
    Returns average value of stress index on interval
    Parameters:
    startTime - Start time of calculation interval
    endTime - End time of calculation interval
    Returns:
    Stress index value

<a name="getElectrodesState--"> </a>

  • getElectrodesState

    public boolean getElectrodesState()
    Returns flag indicating whether electrodes properly attached or not
    Returns:
    Is electrodes attached