Python API
 All Classes Namespaces Functions Variables
plux.MemoryDev Class Reference

Base class for PLUX signal-acquiring devices with internal memory. More...

Inheritance diagram for plux.MemoryDev:
plux.SignalsDev plux.BaseDev

Public Member Functions

def __init__
 Promotes a BaseDev instance to MemoryDev. More...
 
def setTime
 Sets the device real-time clock. More...
 
def getTime
 Returns the device current real-time clock as a datetime.datetime object. More...
 
def getSchedules
 Returns all session schedules stored on the device. More...
 
def addSchedule
 Adds a session schedule to the device. More...
 
def deleteSchedule
 Deletes a session schedule from the device. More...
 
def deleteAllSchedules
 Deletes all session schedules from the device. More...
 
def stopSessionAcq
 Stops an internal acquisition session. More...
 
def getSessions
 Returns the headers of all sessions stored on the device. More...
 
def replaySession
 Replays a session stored on the device. More...
 
def deleteAllSessions
 Deletes all sessions stored on the device. More...
 
def getMemoryUsed
 Returns the amount of memory used by all sessions stored on the device in kBytes. More...
 
def onSessionRawFrame
 Raw frames callback for stored sessions replay. More...
 
def onSessionEvent
 Event callback for stored sessions replay. More...
 
- Public Member Functions inherited from plux.SignalsDev
def __init__
 Promotes a BaseDev instance to SignalsDev. More...
 
def start
 Starts a real-time acquisition session. More...
 
def start
 Starts a real-time acquisition session. More...
 
def stop
 Stops a real-time acquisition session. More...
 
def setDOut
 Sets the digital output state. More...
 
def onRawFrame
 Raw frames callback. More...
 
- Public Member Functions inherited from plux.BaseDev
def __init__
 Connects to a PLUX device. More...
 
def getProperties
 Returns the device properties. More...
 
def getBattery
 Returns a float number with the remaining battery charge as a percentage of full capacity. More...
 
def setTimeout
 Sets the receiving timeout value for loop(). More...
 
def loop
 Runs the device message loop. More...
 
def interrupt
 Sends an interrupt signal to loop(). More...
 
def onEvent
 Event callback. More...
 
def onTimeout
 Timeout callback. More...
 
def onInterrupt
 Interrupt signal callback. More...
 
def close
 Disconnects from the device. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from plux.BaseDev
def findDevices
 Finds PLUX devices within the given domain. More...
 

Detailed Description

Base class for PLUX signal-acquiring devices with internal memory.

Constructor & Destructor Documentation

def plux.MemoryDev.__init__ (   self,
  baseDev 
)

Promotes a BaseDev instance to MemoryDev.

Parameters
baseDevThe BaseDev instance to be promoted. If promotion is successful, baseDev is no longer valid.

Member Function Documentation

def 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.

Parameters
schThe schedule do add as a Schedule object.
Remarks
On current devices firmware, the device cannot store more than one schedule.
def plux.MemoryDev.deleteAllSchedules (   self)

Deletes all session schedules from the device.

Remarks
A running schedule cannot be deleted, so this method cannot be called while the device is acquiring.
def plux.MemoryDev.deleteAllSessions (   self)

Deletes all sessions stored on the device.

Remarks
This method cannot be called while the device is acquiring.
def plux.MemoryDev.deleteSchedule (   self,
  startTime 
)

Deletes a session schedule from the device.

Parameters
startTimeThe Schedule.startTime attribute value of the schedule to delete.
Remarks
A running schedule cannot be deleted.
def plux.MemoryDev.getMemoryUsed (   self)

Returns the amount of memory used by all sessions stored on the device in kBytes.

Remarks
This method cannot be called while the device is acquiring.
See also
memorySize property in getProperties().
def 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().

Returns
A tuple of ScheduleEx objects.
Remarks
On current devices firmware, the device cannot store more than one schedule.
def plux.MemoryDev.getSessions (   self)

Returns the headers of all sessions stored on the device.

Returns
A tuple of Session objects.
Remarks
This method cannot be called while the device is acquiring.
def plux.MemoryDev.getTime (   self)

Returns the device current real-time clock as a datetime.datetime object.

def 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.

Parameters
eventThe replayed event. It can be a DigInUpdate or Sync object.
Returns
Return True to exit replaySession() or False otherwise. Default callback returns False.
def 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.

Returns
Return True to exit replaySession() or False otherwise. Default callback returns False.
def 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.

Parameters
startTimeThe Session.startTime attribute value (as returned by getSessions()) of the session to replay.
iniFrameAn optional integer with the frame sequence number from which the session starts to be replayed.
Remarks
This method cannot be called from a callback. This method cannot be called while the device is acquiring.
def plux.MemoryDev.setTime (   self,
  time = None 
)

Sets the device real-time clock.

Parameters
timeAn optional datetime.datetime object with the time to set on device. If this parameter is not given, current host time is used.
def plux.MemoryDev.stopSessionAcq (   self)

Stops an internal acquisition session.

Remarks
Call stop() to stop a real-time acquisition.