Difference between revisions of "EcgDevice Class"

From Neurotech Software Development Kit
Jump to: navigation, search
(Method Detail)
(Method Detail)
Line 207: Line 207:
  
 
<h3>getAddress</h3>
 
<h3>getAddress</h3>
<pre>public&nbsp;java.lang.String&nbsp;getAddress()</pre>
+
<code><span style="color:#0066FF;">'''public'''</span>&nbsp;java.lang.String&nbsp;getAddress()</code>
<div class="block">
 
  
<span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../ru/neurotech/common/VisualizableDevice.html#getAddress--">VisualizableDevice</a></code></span></div>
+
<span">Description copied from class:&nbsp;<code>[[VisualizableDevice Class|VisualizableDevice]]</code></span>
<div class="block">Returns Bluetooth LE MAC address</div>
+
 
 +
<div class="block">Returns Bluetooth LE MAC address
 
<dl>
 
<dl>
 
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
 
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../ru/neurotech/common/VisualizableDevice.html#getAddress--">getAddress</a></code>&nbsp;in class&nbsp;<code>[[VisualizableDevice Class|VisualizableDevice]</code></dd>
+
<dd><code>[[VisualizableDevice Class#getAddress|getAddress]]</code>&nbsp;in class&nbsp;VisualizableDevice</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
+
<dt><span>Returns:</span></dt>
 
<dd>device unique address</dd>
 
<dd>device unique address</dd>
 
</dl>
 
</dl>
Line 221: Line 221:
  
 
<h3>getBatteryLevel</h3>
 
<h3>getBatteryLevel</h3>
<pre>public&nbsp;int&nbsp;getBatteryLevel()</pre>
+
<code><span style="color:#0066FF;">'''public int'''</span> getBatteryLevel()</code>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../ru/neurotech/common/VisualizableDevice.html#getBatteryLevel--">VisualizableDevice</a></code></span></div>
+
 
 +
<span class="descfrmTypeLabel">Description copied from class:&nbsp;<code>[[VisualizableDevice Class|VisualizableDevice]]</code></span>
 
<div class="block">Returns battery state</div>
 
<div class="block">Returns battery state</div>
 
<dl>
 
<dl>
 
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
 
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../ru/neurotech/common/VisualizableDevice.html#getBatteryLevel--">getBatteryLevel</a></code>&nbsp;in class&nbsp;<code><a href="../../../../ru/neurotech/common/VisualizableDevice.html" title="class in ru.neurotech.common">VisualizableDevice</a></code></dd>
+
<dd><code>[[VisualizableDevice Class|VisualizableDevice.getBatteryLevel90]]</code>&nbsp;in class&nbsp;VisualizableDevice</dd>
 
<dt><span class="returnLabel">Returns:</span></dt>
 
<dt><span class="returnLabel">Returns:</span></dt>
 
<dd>battery charge level in percents</dd>
 
<dd>battery charge level in percents</dd>
Line 233: Line 234:
  
 
<h3>getNeuroDevice</h3>
 
<h3>getNeuroDevice</h3>
<pre>public&nbsp;<a href="../../../../ru/neurotech/neurodevices/NeuroDevice.html" title="class in ru.neurotech.neurodevices">NeuroDevice</a>&nbsp;getNeuroDevice()</pre>
+
<code><span style="color:#0066FF;">'''public'''</span> [[NeuroDevice Class|NeuroDevice]]&nbsp;getNeuroDevice()</code>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../ru/neurotech/common/VisualizableDevice.html#getNeuroDevice--">VisualizableDevice</a></code></span></div>
+
 
 +
<span>Description copied from class:&nbsp;VisualizableDevice</span>
 
<div class="block">Returns physical device object which this visual device represents</div>
 
<div class="block">Returns physical device object which this visual device represents</div>
 
<dl>
 
<dl>
 
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
 
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../ru/neurotech/common/VisualizableDevice.html#getNeuroDevice--">getNeuroDevice</a></code>&nbsp;in class&nbsp;<code>[[VisualizableDevice Class|VisualizableDevice]</code></dd>
+
<dd><code>[[VisualizableDevice Classl#getNeuroDevice|getNeuroDevice()]]</code>&nbsp;in class&nbsp;<code>[[VisualizableDevice Class|VisualizableDevice]</code></dd>
 
<dt><span class="returnLabel">Returns:</span></dt>
 
<dt><span class="returnLabel">Returns:</span></dt>
 
<dd>NeuroDevice of current visual device</dd>
 
<dd>NeuroDevice of current visual device</dd>
Line 245: Line 247:
  
 
<h3>startReceive</h3>
 
<h3>startReceive</h3>
<pre>public&nbsp;void&nbsp;startReceive()</pre>
+
<code><span style="color:#0066FF;">'''public void'''</span> startReceive()</code>
  
  
 
<h3>stopReceive</h3>
 
<h3>stopReceive</h3>
<pre>public&nbsp;void&nbsp;stopReceive()</pre>
+
<code><span style="color:#0066FF;">'''public void'''</span> stopReceive()</code>
  
  
 
<h3>reset</h3>
 
<h3>reset</h3>
<pre>public&nbsp;void&nbsp;reset()</pre>
+
<code><span style="color:#0066FF;">'''public void'''</span> reset()</code>
 
<div class="block">Clears signal buffer, sets duration to zero
 
<div class="block">Clears signal buffer, sets duration to zero
 
  and resets all parameters to default values</div>
 
  and resets all parameters to default values</div>
Line 259: Line 261:
  
 
<h3>getTotalSignalDuration</h3>
 
<h3>getTotalSignalDuration</h3>
<pre>public&nbsp;double&nbsp;getTotalSignalDuration()</pre>
+
<code><span style="color:#0066FF;">'''public double'''</span> getTotalSignalDuration()</code>
 
<div class="block">Returns total signal duration in current test</div>
 
<div class="block">Returns total signal duration in current test</div>
 
<dl>
 
<dl>
Line 268: Line 270:
  
 
<h3>getEcgSignal</h3>
 
<h3>getEcgSignal</h3>
<pre>public&nbsp;double[]&nbsp;getEcgSignal(double&nbsp;time,
+
<code><span style="color:#0066FF;">'''public double'''</span>[] getEcgSignal(<span style="color:#0066FF;">'''double'''</span> time, <span style="color:#0066FF;">'''double'''</span> duration)</code>
                            double&nbsp;duration)</pre>
 
 
<div class="block">Returns ECG signal stored in buffer for selected time interval
 
<div class="block">Returns ECG signal stored in buffer for selected time interval
 
  If interval exceeds maximum or minimum buffer time, signal samples
 
  If interval exceeds maximum or minimum buffer time, signal samples
Line 283: Line 284:
  
 
<h3>getRWavesOnInterval</h3>
 
<h3>getRWavesOnInterval</h3>
<pre>public&nbsp;[[RPeak Class|RPeak]][]&nbsp;getRWavesOnInterval(double&nbsp;startTime,
+
<code><span style="color:#0066FF;">'''public'''</span> [[RPeak Class|RPeak]][]&nbsp;getRWavesOnInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code>
                                  double&nbsp;endTime)</pre>
 
 
<div class="block">Detects R-waves in signal for specified time interval</div>
 
<div class="block">Detects R-waves in signal for specified time interval</div>
 
<dl>
 
<dl>
Line 296: Line 296:
  
 
<h3>getCurrentHeartRate</h3>
 
<h3>getCurrentHeartRate</h3>
<pre>public&nbsp;int&nbsp;getCurrentHeartRate()</pre>
+
<code><span style="color:#0066FF;">'''public int'''</span> getCurrentHeartRate()</code>
 
<div class="block">Calculates heart rate for recently received ECG samples
 
<div class="block">Calculates heart rate for recently received ECG samples
 
  Use this method to monitor heart rate during signal receiving is active
 
  Use this method to monitor heart rate during signal receiving is active
Line 308: Line 308:
  
 
<h3>getAverageHeartRateOnInterval</h3>
 
<h3>getAverageHeartRateOnInterval</h3>
<pre>public&nbsp;int&nbsp;getAverageHeartRateOnInterval(double&nbsp;startTime,
+
<code><span style="color:#0066FF;">'''public int'''</span> getAverageHeartRateOnInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code>
                                        double&nbsp;endTime)</pre>
 
 
<div class="block">Returns average heart rate based on NN-interval values
 
<div class="block">Returns average heart rate based on NN-interval values
 
  from specified time interval</div>
 
  from specified time interval</div>
Line 322: Line 321:
  
 
<h3>getCurrentHeartRateVariability</h3>
 
<h3>getCurrentHeartRateVariability</h3>
<pre>public&nbsp;double&nbsp;getCurrentHeartRateVariability()</pre>
+
<code><span style="color:#0066FF;">'''public double'''</span> getCurrentHeartRateVariability()</code>
 
<div class="block">Returns currently detected value of heart rate variability
 
<div class="block">Returns currently detected value of heart rate variability
 
  Use this method to monitor HRV during signal receiving
 
  Use this method to monitor HRV during signal receiving
Line 334: Line 333:
  
 
<h3>getHeartRateVariabilityForInterval</h3>
 
<h3>getHeartRateVariabilityForInterval</h3>
<pre>public&nbsp;double&nbsp;getHeartRateVariabilityForInterval(double&nbsp;startTime,
+
<code><span style="color:#0066FF;">'''public double'''</span> getHeartRateVariabilityForInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code>
                                                double&nbsp;endTime)</pre>
 
 
<div class="block">Returns average value of heart rate variability on interval</div>
 
<div class="block">Returns average value of heart rate variability on interval</div>
 
<dl>
 
<dl>
Line 347: Line 345:
  
 
<h3>getCurrentStressIndex</h3>
 
<h3>getCurrentStressIndex</h3>
<pre>public&nbsp;double&nbsp;getCurrentStressIndex()</pre>
+
<code><span style="color:#0066FF;">'''public double'''</span> getCurrentStressIndex()</code>
 
<div class="block">Returns value of stress index for real-time monitoring
 
<div class="block">Returns value of stress index for real-time monitoring
 
  Use this method to monitor stress index while signal receiving is active
 
  Use this method to monitor stress index while signal receiving is active
Line 359: Line 357:
  
 
<h3>getStressIndexForInterval</h3>
 
<h3>getStressIndexForInterval</h3>
<pre>public&nbsp;double&nbsp;getStressIndexForInterval(double&nbsp;startTime,
+
<code><span style="color:#0066FF;">'''public double'''</span> getStressIndexForInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code>
                                        double&nbsp;endTime)</pre>
 
 
<div class="block">Returns average value of stress index on interval</div>
 
<div class="block">Returns average value of stress index on interval</div>
 
<dl>
 
<dl>
Line 372: Line 369:
  
 
<h3>getElectrodesState</h3>
 
<h3>getElectrodesState</h3>
<pre>public&nbsp;boolean&nbsp;getElectrodesState()</pre>
+
<code><span style="color:#0066FF;">'''public boolean'''</span> getElectrodesState()</code>
 
<div class="block">Returns flag indicating whether electrodes properly attached or not</div>
 
<div class="block">Returns flag indicating whether electrodes properly attached or not</div>
 
<dl>
 
<dl>
 
<dt><span class="returnLabel">Returns:</span></dt>
 
<dt><span class="returnLabel">Returns:</span></dt>
 
<dd>Is electrodes attached</dd>
 
<dd>Is electrodes attached</dd>

Revision as of 09:39, 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<java.lang.Boolean> electrodesAttachedStateChanged

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

SubscribersNotifier<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

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

Modifier and Type Method and Description
void close()
void finalize()
java.lang.String getAddress()

Returns Bluetooth LE MAC address

int getAverageHeartRateOnInterval

Returns average heart rate based on NN-interval values from specified time interval

int getBatteryLevel()

Returns battery charge level in percents

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

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

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

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

boolean getElectrodesState()

Returns flag indicating whether electrodes properly attached or not

double getHeartRateVariabilityForInterval(double startTime, double endTime)

Returns average value of heart rate variability on interval

java.lang.String getName()

Returns name of BLE device

NeuroDevice getNeuroDevice()

Returns physical device object which this visual device represents

RPeak[] getRWavesOnInterval(double startTime, double endTime)

Detects R-waves in signal for specified time interval

double getStressIndexForInterval(double startTime, double endTime)
Returns average value of stress index on interval
double getTotalSignalDuration()

Returns total signal duration in current test

void reset()

Clears signal buffer, sets duration to zero and resets all parameters to default values

void startReceive()
void stopReceive()

Field Detail

totalSignalDurationChanged

public final SubscribersNotifier<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

electrodesAttachedStateChanged

public final SubscribersNotifier<java.lang.Boolean> electrodesAttachedStateChanged

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

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


close

public void close()


getName

public java.lang.String getName()

Description copied from class: VisualizableDevice

Returns name of BLE device

Specified by:
VisualizableDevice.getName() in class VisualizableDevice
Returns:
BLE device name


getAddress

public java.lang.String getAddress()

<span">Description copied from class: VisualizableDevice</span>

Returns Bluetooth LE MAC address
Specified by:
getAddress in class VisualizableDevice</code>
Returns:
device unique address
</dl>

getBatteryLevel

public int getBatteryLevel()

Description copied from class: VisualizableDevice

Returns battery state
Specified by:
VisualizableDevice.getBatteryLevel90 in class VisualizableDevice
Returns:
battery charge level in percents


getNeuroDevice

public NeuroDevice getNeuroDevice()

Description copied from class: VisualizableDevice

Returns physical device object which this visual device represents
Specified by:
getNeuroDevice() in class [[VisualizableDevice Class|VisualizableDevice]
Returns:
NeuroDevice of current visual device


startReceive

public void startReceive()


stopReceive

public void stopReceive()


reset

public void reset()

Clears signal buffer, sets duration to zero and resets all parameters to default values


getTotalSignalDuration

public double getTotalSignalDuration()

Returns total signal duration in current test
Returns:
signal duration in seconds


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


getRWavesOnInterval

public RPeak[] 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


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


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


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


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


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


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


getElectrodesState

public boolean getElectrodesState()

Returns flag indicating whether electrodes properly attached or not
Returns:
Is electrodes attached