Difference between revisions of "EcgDevice Class"
NateColeman (talk | contribs) (→Method Detail) |
NateColeman (talk | contribs) (→Related Classes) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
ru.neurotech.neurodevices.ecg.[[RPeak Class|RPeak]] | ru.neurotech.neurodevices.ecg.[[RPeak Class|RPeak]] | ||
+ | |||
+ | ru.neurotech.neurodevices.[[NeuroDevice Class|NeuroDevice]] | ||
==Classes hierarchy== | ==Classes hierarchy== | ||
Line 36: | Line 38: | ||
|- valign="top" | |- valign="top" | ||
|[[SubscribersNotifier Class|SubscribersNotifier]]<java.lang.'''Boolean'''> | |[[SubscribersNotifier Class|SubscribersNotifier]]<java.lang.'''Boolean'''> | ||
− | |[[#electrodesAttachedStateChanged|electrodesAttachedStateChanged]] | + | |[[#electrodesAttachedStateChanged|'''electrodesAttachedStateChanged''']] |
Notifies when electrodes are attached or detached | Notifies when electrodes are attached or detached | ||
To get electrodes state manually use getElectrodesState | To get electrodes state manually use getElectrodesState | ||
Line 55: | Line 57: | ||
==Constructor Summary== | ==Constructor Summary== | ||
− | + | {| class="wikitable" | |
− | + | |- style="background-color: #dee3e9;" | |
− | + | |'''Constructor and Description''' | |
− | + | |- | |
− | + | |[[#EcgDevice|EcgDevice]](<span style="color:#0066FF;">'''long'''</span> nativeObjPtr) | |
− | + | |} | |
− | |||
− | |||
− | |||
==Methods Summary== | ==Methods Summary== | ||
Line 129: | Line 128: | ||
Returns name of BLE device | Returns name of BLE device | ||
|- valign="top" | |- valign="top" | ||
− | |style="color:#0066FF;" |[[NeuroDevice Class|NeuroDevice]] | + | |style="color:#0066FF;" |[[NeuroDevice Class#Android|NeuroDevice]] |
|[[#getNeuroDevice|getNeuroDevice]]() | |[[#getNeuroDevice|getNeuroDevice]]() | ||
Returns physical device object which this visual device represents | Returns physical device object which this visual device represents | ||
|- valign="top" | |- valign="top" | ||
− | + | |[[RPeak Class#Android|RPeak]][] | |
|[[#getRWavesOnInterval|getRWavesOnInterval]](<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime) | |[[#getRWavesOnInterval|getRWavesOnInterval]](<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime) | ||
Detects R-waves in signal for specified time interval | Detects R-waves in signal for specified time interval | ||
Line 209: | Line 208: | ||
<code><span style="color:#0066FF;">'''public'''</span> java.lang.String getAddress()</code> | <code><span style="color:#0066FF;">'''public'''</span> java.lang.String getAddress()</code> | ||
− | <span>'''Description copied from class:''' | + | <span>'''Description copied from class:''' [[VisualizableDevice Class|VisualizableDevice]]</span> |
<div class="block">Returns Bluetooth LE MAC address | <div class="block">Returns Bluetooth LE MAC address | ||
Line 223: | Line 222: | ||
<code><span style="color:#0066FF;">'''public int'''</span> getBatteryLevel()</code> | <code><span style="color:#0066FF;">'''public int'''</span> getBatteryLevel()</code> | ||
− | <span>'''Description copied from class:''' | + | <span>'''Description copied from class:''' [[VisualizableDevice Class|VisualizableDevice]]</span> |
− | + | ||
+ | Returns battery state | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt> | <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> | ||
Line 236: | Line 237: | ||
<code><span style="color:#0066FF;">'''public'''</span> [[NeuroDevice Class|NeuroDevice]] getNeuroDevice()</code> | <code><span style="color:#0066FF;">'''public'''</span> [[NeuroDevice Class|NeuroDevice]] getNeuroDevice()</code> | ||
− | <span''' | + | <span>'''Description copied from class:''' [[VisualizableDevice Class|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>[[VisualizableDevice | + | <dd><code>[[VisualizableDevice Class#getNeuroDevice|VisualizableDevice.getNeuroDevice()]]</code> in class VisualizableDevice</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 262: | Line 263: | ||
<h3>getTotalSignalDuration</h3> | <h3>getTotalSignalDuration</h3> | ||
<code><span style="color:#0066FF;">'''public double'''</span> getTotalSignalDuration()</code> | <code><span style="color:#0066FF;">'''public double'''</span> getTotalSignalDuration()</code> | ||
− | + | ||
+ | Returns total signal duration in current test. | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
Line 271: | Line 274: | ||
<h3>getEcgSignal</h3> | <h3>getEcgSignal</h3> | ||
<code><span style="color:#0066FF;">'''public double'''</span>[] getEcgSignal(<span style="color:#0066FF;">'''double'''</span> time, <span style="color:#0066FF;">'''double'''</span> duration)</code> | <code><span style="color:#0066FF;">'''public double'''</span>[] getEcgSignal(<span style="color:#0066FF;">'''double'''</span> time, <span style="color:#0066FF;">'''double'''</span> duration)</code> | ||
− | + | ||
− | + | 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. | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="paramLabel">Parameters:</span></dt> | <dt><span class="paramLabel">Parameters:</span></dt> | ||
− | <dd><code>time</code> - Start time of interval</dd> | + | <dd><code>time</code> - Start time of interval in seconds</dd> |
− | <dd><code>duration</code> - Duration of interval</dd> | + | <dd><code>duration</code> - Duration of interval in seconds</dd> |
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
<dd>Signal samples array</dd> | <dd>Signal samples array</dd> | ||
Line 285: | Line 290: | ||
<h3>getRWavesOnInterval</h3> | <h3>getRWavesOnInterval</h3> | ||
<code><span style="color:#0066FF;">'''public'''</span> [[RPeak Class|RPeak]][] getRWavesOnInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | <code><span style="color:#0066FF;">'''public'''</span> [[RPeak Class|RPeak]][] getRWavesOnInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | ||
− | + | ||
+ | Detects R-waves in signal for specified time interval. | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="paramLabel">Parameters:</span></dt> | <dt><span class="paramLabel">Parameters:</span></dt> | ||
− | <dd><code>startTime</code> - Start time of interval</dd> | + | <dd><code>startTime</code> - Start time of interval in seconds</dd> |
− | <dd><code>endTime</code> - End time of interval</dd> | + | <dd><code>endTime</code> - End time of interval in seconds</dd> |
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
<dd>Array of RPeaks</dd> | <dd>Array of RPeaks</dd> | ||
Line 297: | Line 304: | ||
<h3>getCurrentHeartRate</h3> | <h3>getCurrentHeartRate</h3> | ||
<code><span style="color:#0066FF;">'''public int'''</span> getCurrentHeartRate()</code> | <code><span style="color:#0066FF;">'''public int'''</span> getCurrentHeartRate()</code> | ||
− | + | ||
− | + | 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|getAverageHeartRateOnInterval]] instead. | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
Line 309: | Line 319: | ||
<h3>getAverageHeartRateOnInterval</h3> | <h3>getAverageHeartRateOnInterval</h3> | ||
<code><span style="color:#0066FF;">'''public int'''</span> getAverageHeartRateOnInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | <code><span style="color:#0066FF;">'''public int'''</span> getAverageHeartRateOnInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | ||
− | + | ||
− | + | Returns average heart rate based on NN-interval values | |
+ | from specified time interval. | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="paramLabel">Parameters:</span></dt> | <dt><span class="paramLabel">Parameters:</span></dt> | ||
− | <dd><code>startTime</code> - Start time for heart rate calculation</dd> | + | <dd><code>startTime</code> - Start time in seconds for heart rate calculation</dd> |
− | <dd><code>endTime</code> - End time for heart rate calculation</dd> | + | <dd><code>endTime</code> - End time in seconds for heart rate calculation</dd> |
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
<dd>Heart rate in beats per minute</dd> | <dd>Heart rate in beats per minute</dd> | ||
Line 322: | Line 334: | ||
<h3>getCurrentHeartRateVariability</h3> | <h3>getCurrentHeartRateVariability</h3> | ||
<code><span style="color:#0066FF;">'''public double'''</span> getCurrentHeartRateVariability()</code> | <code><span style="color:#0066FF;">'''public double'''</span> getCurrentHeartRateVariability()</code> | ||
− | + | 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|getHeartRateVariabilityForInterval]] | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
Line 334: | Line 348: | ||
<h3>getHeartRateVariabilityForInterval</h3> | <h3>getHeartRateVariabilityForInterval</h3> | ||
<code><span style="color:#0066FF;">'''public double'''</span> getHeartRateVariabilityForInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | <code><span style="color:#0066FF;">'''public double'''</span> getHeartRateVariabilityForInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | ||
− | + | ||
+ | Returns average value of heart rate variability on interval | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="paramLabel">Parameters:</span></dt> | <dt><span class="paramLabel">Parameters:</span></dt> | ||
− | <dd><code>startTime</code> - Start time of calculation interval</dd> | + | <dd><code>startTime</code> - Start time of calculation interval in seconds</dd> |
− | <dd><code>endTime</code> - End time of calculation interval</dd> | + | <dd><code>endTime</code> - End time of calculation interval in seconds</dd> |
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
<dd>HRV value</dd> | <dd>HRV value</dd> | ||
Line 346: | Line 362: | ||
<h3>getCurrentStressIndex</h3> | <h3>getCurrentStressIndex</h3> | ||
<code><span style="color:#0066FF;">'''public double'''</span> getCurrentStressIndex()</code> | <code><span style="color:#0066FF;">'''public double'''</span> getCurrentStressIndex()</code> | ||
− | + | ||
− | + | 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|getStressIndexForInterval]] | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
Line 358: | Line 377: | ||
<h3>getStressIndexForInterval</h3> | <h3>getStressIndexForInterval</h3> | ||
<code><span style="color:#0066FF;">'''public double'''</span> getStressIndexForInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | <code><span style="color:#0066FF;">'''public double'''</span> getStressIndexForInterval(<span style="color:#0066FF;">'''double'''</span> startTime, <span style="color:#0066FF;">'''double'''</span> endTime)</code> | ||
− | + | ||
+ | Returns average value of stress index on interval | ||
+ | |||
<dl> | <dl> | ||
<dt><span class="paramLabel">Parameters:</span></dt> | <dt><span class="paramLabel">Parameters:</span></dt> | ||
− | <dd><code>startTime</code> - Start time of calculation interval</dd> | + | <dd><code>startTime</code> - Start time of calculation interval in seconds</dd> |
− | <dd><code>endTime</code> - End time of calculation interval</dd> | + | <dd><code>endTime</code> - End time of calculation interval in seconds</dd> |
<dt><span class="returnLabel">Returns:</span></dt> | <dt><span class="returnLabel">Returns:</span></dt> | ||
<dd>Stress index value</dd> | <dd>Stress index value</dd> | ||
Line 370: | Line 391: | ||
<h3>getElectrodesState</h3> | <h3>getElectrodesState</h3> | ||
<code><span style="color:#0066FF;">'''public boolean'''</span> getElectrodesState()</code> | <code><span style="color:#0066FF;">'''public boolean'''</span> getElectrodesState()</code> | ||
− | + | ||
+ | Returns flag indicating whether electrodes properly attached or not | ||
+ | |||
<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> |
Latest revision as of 11:39, 8 August 2017
ECG Device class implemets methods for using universal sensors as cardiography system.
Contents
- 1 Android
- 1.1 Related Classes
- 1.2 Classes hierarchy
- 1.3 Class definition
- 1.4 Fields Summary
- 1.5 Constructor Summary
- 1.6 Methods Summary
- 1.7 Field Detail
- 1.8 Constructor Detail
- 1.9 Method Detail
- 1.9.1 finalize
- 1.9.2 close
- 1.9.3 getName
- 1.9.4 getAddress
- 1.9.5 getBatteryLevel
- 1.9.6 getNeuroDevice
- 1.9.7 startReceive
- 1.9.8 stopReceive
- 1.9.9 reset
- 1.9.10 getTotalSignalDuration
- 1.9.11 getEcgSignal
- 1.9.12 getRWavesOnInterval
- 1.9.13 getCurrentHeartRate
- 1.9.14 getAverageHeartRateOnInterval
- 1.9.15 getCurrentHeartRateVariability
- 1.9.16 getHeartRateVariabilityForInterval
- 1.9.17 getCurrentStressIndex
- 1.9.18 getStressIndexForInterval
- 1.9.19 getElectrodesState
Android
ru.neurotech.neurodevices.ecg
Class EcgDevice
Related Classes
ru.neurotech.neurodevices.ecg.EcgDeviceConnector
ru.neurotech.neurodevices.ecg.RPeak
ru.neurotech.neurodevices.NeuroDevice
Classes hierarchy
- java.lang.Object
- ru.neurotech.common.VisualizableDevice
- ru.neurotech.neurodevices.ecg.EcgDevice
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 |
EcgDevice(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 classjava.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()
Description copied from class: VisualizableDevice
- Specified by:
VisualizableDevice.getAddress()
in class VisualizableDevice- Returns:
- device unique address
getBatteryLevel
public int getBatteryLevel()
Description copied from class: VisualizableDevice
Returns battery state
- Specified by:
VisualizableDevice.getBatteryLevel()
in class VisualizableDevice- Returns:
- battery charge level in percents
getNeuroDevice
public NeuroDevice getNeuroDevice()
Description copied from class: VisualizableDevice
- Specified by:
VisualizableDevice.getNeuroDevice()
in class VisualizableDevice- Returns:
- NeuroDevice of current visual device
startReceive
public void startReceive()
stopReceive
public void stopReceive()
reset
public void reset()
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 in secondsduration
- Duration of interval in seconds- 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 in secondsendTime
- End time of interval in seconds- 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 in seconds for heart rate calculationendTime
- End time in seconds 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 in secondsendTime
- End time of calculation interval in seconds- 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 in secondsendTime
- End time of calculation interval in seconds- Returns:
- Stress index value
getElectrodesState
public boolean getElectrodesState()
Returns flag indicating whether electrodes properly attached or not
- Returns:
- Is electrodes attached