![]() |
C++ API
|
Base class for PLUX signal-acquiring devices with internal memory. More...
#include <plux.h>
Public Member Functions | |
MemoryDev (const String &path) | |
Connects to a PLUX device. | |
MemoryDev (BaseDev &baseDev) | |
Promotes a BaseDev instance to MemoryDev. | |
void | setTime (time_t t=0) |
Sets the device real-time clock. | |
time_t | getTime (void) |
Returns the device current real-time clock. | |
int | getSchedules (Schedules &schs) |
Returns all session schedules stored on the device. | |
void | addSchedule (const Schedule &sch) |
Adds a session schedule to the device. | |
void | deleteSchedule (time_t startTime) |
Deletes a session schedule from the device. | |
void | deleteAllSchedules (void) |
Deletes all session schedules from the device. | |
void | stopSessionAcq (void) |
Stops an internal acquisition session. | |
void | getSessions (Sessions &sessions) |
Returns the headers of all sessions stored on the device. | |
void | replaySession (time_t startTime, int iniFrame=0) |
Replays a session stored on the device. | |
void | deleteAllSessions (void) |
Deletes all sessions stored on the device. | |
int | getMemoryUsed (void) |
Returns the amount of memory used by all sessions stored on the device in kBytes. | |
virtual bool | onSessionRawFrame (int nSeq, const int data[]) |
Raw frames callback for stored sessions replay. | |
virtual bool | onSessionEvent (const Event &evt) |
Event callback for stored sessions replay. | |
![]() | |
SignalsDev (const String &path) | |
Connects to a PLUX device. | |
SignalsDev (BaseDev &baseDev) | |
Promotes a BaseDev instance to SignalsDev. | |
void | getSensors (Sensors &sensors) |
Returns information about attached sensors and internal sensors. | |
void | start (float freq, int portMask, int nBits) |
Starts a real-time acquisition session. | |
void | start (float freq, const Ints &ports, int nBits) |
Starts a real-time acquisition session. | |
void | start (float baseFreq, const Sources &sources) |
Starts a real-time acquisition session. | |
void | stop (void) |
Stops a real-time acquisition session. | |
int | getNumChannels (void) |
Returns the total number of acquisition channels. | |
void | setDOut (bool state) |
Sets the digital output state. | |
virtual bool | onRawFrame (int nSeq, const int data[]) |
Raw frames callback. | |
![]() | |
virtual void | onFoundDevice (const char *path, const char *description) |
DevInfos | findDevicesWithCallback (void) |
BaseDev (const String &path) | |
Connects to a PLUX device. | |
virtual | ~BaseDev (void) |
Disconnects from the device. | |
Properties | getProperties (void) |
Returns the device properties. | |
void | setParameter (int port, int index, const void *data, int dataLen) |
Sets a system or sensor parameter value. | |
float | getBattery (void) |
Returns the remaining battery charge as a percentage of full capacity. | |
void | setTimeout (int timeout=-1) |
Sets the receiving timeout value for loop(). | |
void | loop (void) |
Runs the device message loop. | |
void | interrupt (void *param=NULL) |
Sends an interrupt signal to loop(). | |
virtual bool | onEvent (const Event &evt) |
Event callback. | |
virtual bool | onTimeout (void) |
Timeout callback. | |
virtual bool | onInterrupt (void *param) |
Interrupt signal callback. | |
Additional Inherited Members | |
![]() | |
enum | ProductId { PID_BioPlux = 0x0101 , PID_BiosignalsPlux = 0x0201 , PID_BiosignalsPluxPRO = 0x0205 , PID_MotionPlux = 0x020A , PID_OpenBan = 0x0214 , PID_OpenBanV2_DDME = 0x0215 , PID_OpenBanV2 = 0x0216 , PID_fNIRS = 0x021E , PID_StimPlux = 0x0301 , PID_MuscleBan = 0x0502 , PID_BITalino = 0x0601 , PID_BITalinoRev = 0x0602 , PID_scoliosis = 0x0701 , PID_MuscleBanWearable = 0x0801 , PID_CardioBanWearable = 0x0802 , PID_RespiBanWearable = 0x0803 } |
Product ID enumeration. More... | |
![]() | |
static DevInfos | findDevices (const String &domain="") |
Finds PLUX devices within the given domain. | |
Base class for PLUX signal-acquiring devices with internal memory.
Plux::MemoryDev::MemoryDev | ( | const String & | path | ) |
Connects to a PLUX device.
path | Path to the PLUX device. It has the same meaning as in BaseDev::BaseDev(). |
Plux::MemoryDev::MemoryDev | ( | BaseDev & | baseDev | ) |
void Plux::MemoryDev::setTime | ( | time_t | t = 0 | ) |
Sets the device real-time clock.
t | Time to set on the device (optional). If this parameter is not given, current host time is used. |
int Plux::MemoryDev::getSchedules | ( | Schedules & | schs | ) |
Returns all session schedules stored on the device.
The returned schedules can refer to a running session (a running schedule, at most one such schedule) or to a session to run in the future. The schedules were previously added by calling addSchedule() or start().
schs | Reference to a Schedules object to be filled by this method. |
void Plux::MemoryDev::addSchedule | ( | const Schedule & | sch | ) |
Adds a session schedule to the device.
An internal acquisition session (i.e., an acquisition to internal memory) will start when the schedule start time or condition is met.
sch | Schedule to add. |
void Plux::MemoryDev::deleteSchedule | ( | time_t | startTime | ) |
Deletes a session schedule from the device.
startTime | Schedule::startTime attribute value of the schedule to delete. |
void Plux::MemoryDev::deleteAllSchedules | ( | void | ) |
Deletes all session schedules from the device.
void Plux::MemoryDev::stopSessionAcq | ( | void | ) |
Stops an internal acquisition session.
void Plux::MemoryDev::getSessions | ( | Sessions & | sessions | ) |
Returns the headers of all sessions stored on the device.
sessions | Reference to a Sessions object to be filled by this method. |
void Plux::MemoryDev::replaySession | ( | time_t | startTime, |
int | iniFrame = 0 |
||
) |
Replays a session stored on the device.
While a session is being replayed, this method runs a message loop which replaces loop(). The message loop receives and dispatches real-time messages and stored session data to the callbacks. When a callback returns true, the session replay ends and this method returns. The method returns if the end of stored session was reached.
startTime | Session::startTime attribute value (as returned by getSessions()) of the session to replay. |
iniFrame | Frame sequence number from which the session starts to be replayed (if ommited, start from frame 0). |
void Plux::MemoryDev::deleteAllSessions | ( | void | ) |
Deletes all sessions stored on the device.
int Plux::MemoryDev::getMemoryUsed | ( | void | ) |
Returns the amount of memory used by all sessions stored on the device in kBytes.
memorySize
property in getProperties().
|
inlinevirtual |
Raw frames callback for stored sessions replay.
This callback is called by replaySession() for every frame to be replayed from the stored session. In order to receive data frames, an application must derive MemoryDev class (or any of its derived classes) to a new class and override this method in the new class.
This callback parameters are equivalent to onRawFrame() callback parameters.
|
inlinevirtual |
Event callback for stored sessions replay.
This callback is called by replaySession() for every event to be replayed from the stored session. In order to receive device events, an application must derive MemoryDev class (or any of its derived classes) to a new class and override this method in the new class.
evt | Replayed event, which can be a EvtDigInUpdate or EvtSync object. |