microCOR Lab SDK  1.7
 All Classes Files Functions Enumerations Enumerator Modules
microCORLab C++ API

Modules

 States
 

Files

file  Logger.h
 
file  microCORLab.h
 

Classes

class  Logger
 Log class. More...
 
class  microCORLab
 microCORLab device management class More...
 

Macros

#define RESOLUTION_SHIFT_MIN   0
 
#define RESOLUTION_SHIFT_MAX   8
 

Enumerations

enum  microCORLab::ReferenceMode { microCORLab::DefaultReferenceMode = 0, microCORLab::EkgReferenceMode, ReferenceModeMin = DefaultReferenceMode, ReferenceModeMax = EkgReferenceMode }
 Hardware reference mode. More...
 

Functions

void Logger::setLogFile (QString file)
 Sets log file. More...
 
QString Logger::logFile () const
 log file.
 
void Logger::log (QString sender, QString message, bool will_write_to_file=false)
 enters a log message. More...
 
void Logger::logSentPacket (QString str)
 microCORLab internal
 
const UsbDevStatemicroCORLab::usbDevState () const
 USB Device State.
 
const GatewayStatemicroCORLab::gatewayState () const
 Gateway Connection State.
 
const TerminalStatemicroCORLab::terminalState () const
 Terminal Connection State.
 
const TerminalRunningStatemicroCORLab::terminalRunningState () const
 Terminal Running State.
 
const BatteryStatemicroCORLab::batteryState () const
 Battery State.
 
const SamplingStatemicroCORLab::samplingState () const
 Sampling State.
 
bool microCORLab::setSerialNo (const QString &serialNo)
 gives serial number to gateway to connect a different terminal than default. More...
 
const QString & microCORLab::serialNo () const
 current terminal serial number to connect More...
 
void microCORLab::setTriggerEnabled (bool enabled)
 Enables trigger. Works only supported hardware. More...
 
bool microCORLab::isTriggerEnabled () const
 Cheks if trigger enabled. More...
 
void microCORLab::setReferenceMode (ReferenceMode rm)
 Sets reference mode. See microCORLab::ReferenceMode. More...
 
double microCORLab::getBatteryValue () const
 
bool microCORLab::setResolution (uchar res)
 sets ADC resolution. More...
 
uchar microCORLab::resolution () const
 gets resolution. More...
 
void microCORLab::setAutoShutdown (int minutes)
 sets auto shutdown while data acquiring. More...
 
int microCORLab::autoShutdown () const
 gets auto shutdown time as minutes.
 
void microCORLab::shutdownDevices (bool closeTerm)
 Shutdown gateway and terminal. More...
 
bool microCORLab::setFirmware (const QString &fileName)
 Sets firmware file to update. Give empty to cancel. More...
 
const QString & microCORLab::firmware () const
 firmware file. See microCORLab::setFirmware(). More...
 
double microCORLab::firmwareUpdateProgress () const
 firmwareUpdateProgress More...
 
QString microCORLab::firmwareVersion () const
 Terminal firmware version. More...
 
QString microCORLab::bootloaderVersion () const
 Terminal bootloader version. More...
 
quint8 microCORLab::terminalType () const
 Terminal type number. More...
 
LoggermicroCORLab::logger ()
 returns internal logger. More...
 
static bool microCORLab::isNaN (double value)
 Not-A-Number helper function. More...
 

Signals

void Logger::logged (const QString &msg)
 a log event occurs
 
void microCORLab::batteryLevelChanged (double)
 Battery Level Change.
 
void microCORLab::terminalTypeChanged (qint8)
 terminalTypeChanged
 
void microCORLab::dataAcquired (double *d, size_t sz, bool trigger)
 Acquired sample data. More...
 
void microCORLab::dataInterrupted ()
 Data Interrupted for some reason.
 

Public Slots

void Logger::logStateChange (QString str)
 microCORLab internal
 
bool microCORLab::start ()
 starts ADC sampling and data acquiring. More...
 
void microCORLab::stop ()
 stops ADC sampling and data acquiring, if started. More...
 

Detailed Description

Macro Definition Documentation

#define RESOLUTION_SHIFT_MAX   8

Max resolution shift

#define RESOLUTION_SHIFT_MIN   0

Min resolution shift

Enumeration Type Documentation

Hardware reference mode.

Default reference mode is general use. Ekg reference mode is intent to use at EKG acquisitions.

Note
If microCORLab::EkgReferenceMode selected, the result data matrix have EKG calculated columns. See microCORLab::dataAcquired().
Enumerator
DefaultReferenceMode 

Default reference mode.

EkgReferenceMode 

Ekg reference mode.

Function Documentation

QString microCORLab::bootloaderVersion ( ) const

Terminal bootloader version.

Returns
Terminal bootloader version.
const QString & microCORLab::firmware ( ) const

firmware file. See microCORLab::setFirmware().

Returns
firmware file
double microCORLab::firmwareUpdateProgress ( ) const

firmwareUpdateProgress

Returns
0 if no progress, else between 0 and 100
QString microCORLab::firmwareVersion ( ) const

Terminal firmware version.

Returns
Terminal firmware version.
static bool microCORLab::isNaN ( double  value)
static

Not-A-Number helper function.

Parameters
valueto check
Returns

Implemented like this : return x != x;

Examples:
mainwindow.cpp.
bool microCORLab::isTriggerEnabled ( ) const

Cheks if trigger enabled.

Returns
False if hardware does not support trigger, else trigger state.
void Logger::log ( QString  sender,
QString  message,
bool  will_write_to_file = false 
)

enters a log message.

Parameters
sendersender of the message.
messagelog message.
will_write_to_fileif true, writes message to file.
Logger & microCORLab::logger ( )

returns internal logger.

See Logger to details.

uchar microCORLab::resolution ( ) const

gets resolution.

Returns
resolution.
const QString & microCORLab::serialNo ( ) const

current terminal serial number to connect

Returns
serial number
void microCORLab::setAutoShutdown ( int  minutes)

sets auto shutdown while data acquiring.

Must use before microCORLab::start(). Only works while data acquiring.

bool microCORLab::setFirmware ( const QString &  fileName)

Sets firmware file to update. Give empty to cancel.

Parameters
fileName*.hex file.
Returns
If file is not empty, exists and readable returns true, else false
Note
If firmware file set, the microCORLab::start() and microCORLab::stop() functions starts and stops firmware update.
void Logger::setLogFile ( QString  file)

Sets log file.

Default is empty and no log writes to any file.

void microCORLab::setReferenceMode ( ReferenceMode  rm)

Sets reference mode. See microCORLab::ReferenceMode.

Parameters
rm
bool microCORLab::setResolution ( uchar  res)

sets ADC resolution.

Parameters
resresolution value between RESOLUTION_SHIFT_MIN and RESOLUTION_SHIFT_MAX.

Must use before microCORLab::start(). See microCORLabGlobal.h file for details.

bool microCORLab::setSerialNo ( const QString &  serialNo)

gives serial number to gateway to connect a different terminal than default.

Parameters
serialNoserial number like "123456789123"
void microCORLab::setTriggerEnabled ( bool  enabled)

Enables trigger. Works only supported hardware.

Parameters
enabledSee microCORLab::dataAcquired().
void microCORLab::shutdownDevices ( bool  closeTerm)

Shutdown gateway and terminal.

Parameters
closeTermif true, sends shutdown signal to terminal.
Warning
Use this while exiting. This function will close read and write threads.
quint8 microCORLab::terminalType ( ) const

Terminal type number.

Returns
Terminal type number.
Examples:
mainwindow.cpp.

Signals

void microCORLab::dataAcquired ( double *  d,
size_t  sz,
bool  trigger 
)
signal

Acquired sample data.

Parameters
ddata array
szsize of array. Either 8 for default resolution or 12 for EKG.
triggerTrigger value if hardware have trigger, else allways false.

Called for each sample. One sample contains values for each channel. Invalid values at the sample are NAN values.

Labels as ordered for reference;

  • Default { Ch0, Ch1, Ch2, Ch3, Ch4, Ch5 }
  • Ekg { I, II, III, aVR, aVL, aVF, V1, V2, V3, V4, V5, V6 }

Public Slots

void microCORLab::start ( )
slot

starts ADC sampling and data acquiring.

Returns
If device supported returns true, else false.
Warning
Only works if terminal connected, running on fw, and battery level is sufficient.
Note
If firmware file set with microCORLab::setFirmware(), this will starts firmware update.
void microCORLab::stop ( )
slot

stops ADC sampling and data acquiring, if started.

Warning
Only works if terminal connected.
Note
If firmware file set with microCORLab::setFirmware(), this will stops firmware update.