Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
XNIDAQmxInterface::SoftwareTrigger Class Reference

Stores and reads time stamps between synchronized devices. More...

#include <nidaqmxdriver.h>

Inheritance diagram for XNIDAQmxInterface::SoftwareTrigger:
Inheritance graph
[legend]

Public Types

using STRGTalker = Transactional::Talker< shared_ptr< SoftwareTrigger >>
 
typedef std::deque< shared_ptr
< XNIDAQmxInterface::SoftwareTrigger > > 
SoftwareTriggerList
 
typedef
SoftwareTriggerList::iterator 
SoftwareTriggerList_it
 

Public Member Functions

const char * label () const
 
void setArmTerm (const char *arm_term)
 
const char * armTerm () const
 
bool isPersistentCoherentMode () const
 
void setPersistentCoherentMode (bool x)
 
void start (float64 freq)
 
float64 freq () const
 [Hz].
 
unsigned int bits () const
 
void stop ()
 
void forceStamp (uint64_t now, float64 freq)
 
void stamp (uint64_t cnt)
 
template<typename T >
void changeValue (T oldval, T val, uint64_t time)
 
void connect (uint32_t rising_edge_mask, uint32_t falling_edge_mask) throw (XInterface::XInterfaceError &)
 
void disconnect ()
 
void setBlankTerm (float64 blankterm)
 
STRGTalkeronStart ()
 for restarting connected task.
 
void clear ()
 clears all time stamps.
 
void clear (uint64_t now, float64 freq)
 clears past time stamps.
 
uint64_t tryPopFront (uint64_t threshold, float64 freq)
 

Static Public Member Functions

static shared_ptr
< SoftwareTrigger
create (const char *label, unsigned int bits)
 
static void unregister (const shared_ptr< SoftwareTrigger > &)
 
static STRGTalkeronChange ()
 for changing list.
 
static const atomic_shared_ptr
< SoftwareTriggerList > & 
virtualTrigList ()
 

Protected Member Functions

 SoftwareTrigger (const char *label, unsigned int bits)
 

Private Types

enum  { QUEUE_SIZE = 8192 }
 
typedef atomic_queue_reserved
< uint64_t, QUEUE_SIZE > 
FastQueue
 
typedef std::deque< uint64_t > SlowQueue
 

Private Member Functions

void clear_ ()
 

Private Attributes

const XString m_label
 
XString m_armTerm
 
unsigned int m_bits
 
uint32_t m_risingEdgeMask
 
uint32_t m_fallingEdgeMask
 
uint64_t m_blankTerm
 
uint64_t m_endOfBlank
 next stamp must not be less than this.
 
float64 m_freq
 [Hz].
 
FastQueue m_fastQueue
 recorded stamps.
 
SlowQueue m_slowQueue
 recorded stamps, when m_fastQueue is full.
 
atomic< unsigned int > m_slowQueueSize
 
XMutex m_mutex
 for m_slowQueue.
 
STRGTalker m_onStart
 
bool m_isPersistentCoherent
 

Static Private Attributes

static STRGTalker s_onChange
 
static atomic_shared_ptr
< SoftwareTriggerList > 
s_virtualTrigList
 

Detailed Description

Stores and reads time stamps between synchronized devices.

Definition at line 100 of file nidaqmxdriver.h.

Member Function Documentation

template<typename T >
void XNIDAQmxInterface::SoftwareTrigger::changeValue ( oldval,
val,
uint64_t  time 
)
inline
Parameters
timeunit in 1/freq().

Definition at line 119 of file nidaqmxdriver.h.

References m_endOfBlank.

void XNIDAQmxInterface::SoftwareTrigger::setBlankTerm ( float64  blankterm)
inline
Parameters
blanktermin seconds, not to stamp so frequently.

Definition at line 131 of file nidaqmxdriver.h.

References freq().

uint64_t XNIDAQmxInterface::SoftwareTrigger::tryPopFront ( uint64_t  threshold,
float64  freq 
)
Returns
if not, zero will be returned.
Parameters
freqfrequency of reader.
thresholdupper bound to be pop, unit in 1/freq (2nd param.).

Definition at line 187 of file nidaqmxdriver.cpp.


The documentation for this class was generated from the following files:

Generated for KAME4 by  doxygen 1.8.3