![]() |
Python API
|
Base class for PLUX signal-acquiring devices with internal memory. More...
Public Member Functions | |
__init__ (self, path) | |
Connects to a PLUX device. | |
__init__ (self, baseDev) | |
Promotes a BaseDev instance to MemoryDev. | |
setTime (self, time=None) | |
Sets the device real-time clock. | |
getTime (self) | |
Returns the device current real-time clock as a datetime.datetime object. | |
getSchedules (self) | |
Returns all session schedules stored on the device. | |
addSchedule (self, sch) | |
Adds a session schedule to the device. | |
deleteSchedule (self, startTime) | |
Deletes a session schedule from the device. | |
deleteAllSchedules (self) | |
Deletes all session schedules from the device. | |
stopSessionAcq (self) | |
Stops an internal acquisition session. | |
getSessions (self) | |
Returns the headers of all sessions stored on the device. | |
replaySession (self, startTime, iniFrame=0) | |
Replays a session stored on the device. | |
deleteAllSessions (self) | |
Deletes all sessions stored on the device. | |
getMemoryUsed (self) | |
Returns the amount of memory used by all sessions stored on the device in kBytes. | |
onSessionRawFrame (self, nSeq, data) | |
Raw frames callback for stored sessions replay. | |
onSessionEvent (self, event) | |
Event callback for stored sessions replay. | |
![]() | |
getSensors (self) | |
Returns information about attached sensors and internal sensors. | |
start (self, baseFreq, sources) | |
Starts a real-time acquisition session. | |
start (self, freq, portMask, nBits) | |
Starts a real-time acquisition session. | |
start (self, freq, ports, nBits) | |
Starts a real-time acquisition session. | |
stop (self) | |
Stops a real-time acquisition session. | |
getNumChannels (self) | |
Returns the total number of acquisition channels. | |
setDOut (self, state) | |
Sets the digital output state. | |
onRawFrame (self, nSeq, data) | |
Raw frames callback. | |
![]() | |
getProperties (self) | |
Returns the device properties. | |
setParameter (self, port, index, data) | |
Sets a system or sensor parameter value. | |
getBattery (self) | |
Returns a float number with the remaining battery charge as a percentage of full capacity. | |
setTimeout (self, timeout=-1) | |
Sets the receiving timeout value for loop(). | |
loop (self) | |
Runs the device message loop. | |
interrupt (self, param=None) | |
Sends an interrupt signal to loop(). | |
onEvent (self, event) | |
Event callback. | |
onTimeout (self) | |
Timeout callback. | |
onInterrupt (self, param) | |
Interrupt signal callback. | |
close () | |
Disconnects from the device. | |
Additional Inherited Members | |
![]() | |
findDevices (domain='') | |
Finds PLUX devices within the given domain. | |
Base class for PLUX signal-acquiring devices with internal memory.
plux.MemoryDev.__init__ | ( | self, | |
path | |||
) |
Connects to a PLUX device.
path | A string with the path to the PLUX device. It has the same meaning as in BaseDev.__init__(). |
Reimplemented from plux.SignalsDev.
plux.MemoryDev.__init__ | ( | self, | |
baseDev | |||
) |
Promotes a BaseDev instance to MemoryDev.
baseDev | The BaseDev instance to be promoted. If promotion is successful, baseDev is no longer valid. |
Reimplemented from plux.SignalsDev.
plux.MemoryDev.setTime | ( | self, | |
time = None |
|||
) |
Sets the device real-time clock.
time | An optional datetime.datetime object with the time to set on device. If this parameter is not given, current host time is used. |
plux.MemoryDev.getTime | ( | self | ) |
Returns the device current real-time clock as a datetime.datetime
object.
plux.MemoryDev.getSchedules | ( | self | ) |
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().
plux.MemoryDev.addSchedule | ( | self, | |
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 | The schedule do add as a Schedule object. |
plux.MemoryDev.deleteSchedule | ( | self, | |
startTime | |||
) |
Deletes a session schedule from the device.
startTime | The Schedule.startTime attribute value of the schedule to delete. |
plux.MemoryDev.deleteAllSchedules | ( | self | ) |
Deletes all session schedules from the device.
plux.MemoryDev.stopSessionAcq | ( | self | ) |
Stops an internal acquisition session.
plux.MemoryDev.getSessions | ( | self | ) |
Returns the headers of all sessions stored on the device.
plux.MemoryDev.replaySession | ( | self, | |
startTime, | |||
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 | The Session.startTime attribute value (as returned by getSessions()) of the session to replay. |
iniFrame | An optional integer with the frame sequence number from which the session starts to be replayed. |
plux.MemoryDev.deleteAllSessions | ( | self | ) |
Deletes all sessions stored on the device.
plux.MemoryDev.getMemoryUsed | ( | self | ) |
Returns the amount of memory used by all sessions stored on the device in kBytes.
memorySize
property in getProperties(). plux.MemoryDev.onSessionRawFrame | ( | self, | |
nSeq, | |||
data | |||
) |
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.
plux.MemoryDev.onSessionEvent | ( | self, | |
event | |||
) |
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.
event | The replayed event. It can be a Event.DigInUpdate or Event.Sync object. |