Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
XNIDAQmxDSO Class Reference

Software DSO w/ NI DAQmx. More...

#include <nidaqdso.h>

Inheritance diagram for XNIDAQmxDSO:
Inheritance graph
[legend]

Classes

struct  DSORawRecord
 

Public Member Functions

 XNIDAQmxDSO (const char *name, bool runtime, Transaction &tr_meas, const shared_ptr< XMeasure > &meas)
 
virtual void convertRaw (RawDataReader &reader, Transaction &tr) throw (XRecordError&)
 Converts raw to record.
 
- Public Member Functions inherited from XNIDAQmxDriver< XDSO >
 XNIDAQmxDriver (const char *name, bool runtime, Transaction &tr_meas, const shared_ptr< XMeasure > &meas)
 
- Public Member Functions inherited from XDSO
 XDSO (const char *name, bool runtime, Transaction &tr_meas, const shared_ptr< XMeasure > &meas)
 
virtual ~XDSO ()
 usually nothing to do.
 
virtual void showForms ()
 Shows all forms belonging to driver.
 
const shared_ptr< XUIntNode > & average () const
 driver specific part below
 
const shared_ptr< XBoolNode > & singleSequence () const
 If true, an acquisition will be paused with a averaging count.
 
const shared_ptr< XComboNode > & trigSource () const
 
const shared_ptr< XDoubleNode > & trigPos () const
 
const shared_ptr< XDoubleNode > & trigLevel () const
 
const shared_ptr< XBoolNode > & trigFalling () const
 
const shared_ptr< XDoubleNode > & timeWidth () const
 
const shared_ptr< XComboNode > & vFullScale1 () const
 
const shared_ptr< XComboNode > & vFullScale2 () const
 
const shared_ptr< XComboNode > & vFullScale3 () const
 
const shared_ptr< XComboNode > & vFullScale4 () const
 
const shared_ptr< XDoubleNode > & vOffset1 () const
 
const shared_ptr< XDoubleNode > & vOffset2 () const
 
const shared_ptr< XDoubleNode > & vOffset3 () const
 
const shared_ptr< XDoubleNode > & vOffset4 () const
 
const shared_ptr< XUIntNode > & recordLength () const
 
const shared_ptr
< XTouchableNode > & 
forceTrigger () const
 
const shared_ptr
< XTouchableNode > & 
restart () const
 
const shared_ptr< XComboNode > & trace1 () const
 
const shared_ptr< XComboNode > & trace2 () const
 
const shared_ptr< XComboNode > & trace3 () const
 
const shared_ptr< XComboNode > & trace4 () const
 
const shared_ptr< XComboNode > & fetchMode () const
 
const shared_ptr< XBoolNode > & firEnabled () const
 
const shared_ptr< XDoubleNode > & firBandWidth () const
 [kHz]
 
const shared_ptr< XDoubleNode > & firCenterFreq () const
 [kHz]
 
const shared_ptr< XDoubleNode > & firSharpness () const
 
const shared_ptr< XComboNode > & dRFMode () const
 
const shared_ptr< XItemNode
< XDriverList, XSG > > & 
dRFSG () const
 
const shared_ptr< XDoubleNode > & dRFFreq () const
 
- Public Member Functions inherited from XPrimaryDriverWithThread
 XPrimaryDriverWithThread (const char *name, bool runtime, Transaction &tr_meas, const shared_ptr< XMeasure > &meas)
 
virtual void stop ()
 
- Public Member Functions inherited from XPrimaryDriver
 XPrimaryDriver (const char *name, bool runtime, Transaction &tr_meas, const shared_ptr< XMeasure > &meas)
 
- Public Member Functions inherited from XDriver
 XDriver (const char *name, bool runtime, Transaction &tr_meas, const shared_ptr< XMeasure > &meas)
 
- Public Member Functions inherited from XNode
 XNode (const char *name, bool runtime=false)
 
template<class T >
shared_ptr< T > create (const char *name)
 
template<class T , typename... Args>
shared_ptr< T > create (const char *name, bool runtime, Args &&...args)
 
template<class T >
shared_ptr< T > create (Transaction &tr, const char *name)
 
template<class T , typename... Args>
shared_ptr< T > create (Transaction &tr, const char *name, bool runtime, Args &&...args)
 
XString getName () const
 
virtual XString getLabel () const
 
XString getTypename () const
 
shared_ptr< XNodegetChild (const XString &var) const
 
shared_ptr< XNodegetParent () const
 
void setUIEnabled (bool v)
 Enables/disables controls over scripting/GUI.
 
void disable ()
 Disables all scripting/GUI operations on this node hereafter.
 
- Public Member Functions inherited from Transactional::Node< XNode >
bool insert (Transaction< XNode > &tr, const shared_ptr< XNode > &var, bool online_after_insertion=false)
 
void insert (const shared_ptr< XNode > &var)
 
bool release (Transaction< XNode > &tr, const shared_ptr< XNode > &var)
 
void release (const shared_ptr< XNode > &var)
 
void releaseAll ()
 
bool swap (Transaction< XNode > &tr, const shared_ptr< XNode > &x, const shared_ptr< XNode > &y)
 
void swap (const shared_ptr< XNode > &x, const shared_ptr< XNode > &y)
 
XNodeupperNode (Snapshot< XNode > &shot)
 Finds the parent node in shot.
 
Snapshot< XNodeiterate_commit (Closure)
 
Snapshot< XNodeiterate_commit_if (Closure)
 
void iterate_commit_while (Closure)
 
void print_ () const
 
 Node (const Node &)=delete
 
Nodeoperator= (const Node &)=delete
 

Protected Member Functions

virtual void open () throw (XKameError &)
 Be called just after opening interface. Call start() inside this routine appropriately.
 
virtual void close () throw (XKameError &)
 Be called during stopping driver. Call interface()->stop() inside this routine.
 
virtual void onTrace1Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTrace2Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTrace3Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTrace4Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onAverageChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onSingleChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTrigSourceChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTrigPosChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTrigLevelChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTrigFallingChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onTimeWidthChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVFullScale1Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVFullScale2Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVFullScale3Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVFullScale4Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVOffset1Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVOffset2Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVOffset3Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onVOffset4Changed (const Snapshot &shot, XValueNodeBase *)
 
virtual void onRecordLengthChanged (const Snapshot &shot, XValueNodeBase *)
 
virtual void onForceTriggerTouched (const Snapshot &shot, XTouchableNode *)
 
virtual double getTimeInterval ()
 
virtual void startSequence ()
 Clears count or start sequence measurement.
 
virtual int acqCount (bool *seq_busy)
 
virtual void getWave (shared_ptr< RawData > &writer, std::deque< XString > &channels)
 Loads waveform and settings from instrument.
 
virtual bool isDRFCoherentSGSupported () const
 
- Protected Member Functions inherited from XNIDAQmxDriver< XDSO >
const shared_ptr
< XNIDAQmxInterface > & 
interface () const
 
void onOpen (const Snapshot &shot, XInterface *)
 
void onClose (const Snapshot &shot, XInterface *)
 
virtual void closeInterface ()
 This should not cause an exception.
 
- Protected Member Functions inherited from XDSO
virtual void analyzeRaw (RawDataReader &reader, Transaction &tr) throw (XRecordError&)
 
virtual void visualize (const Snapshot &shot)
 
virtual void onRestartTouched (const Snapshot &shot, XTouchableNode *)
 
double phaseOfRF (const Snapshot &shot_of_this, uint64_t count, double interval)
 Calculates RF phase for coherent detection, at given count.
 
const shared_ptr
< XStatusPrinter > & 
statusPrinter () const
 
- Protected Member Functions inherited from XPrimaryDriverWithThread
virtual void start ()
 
- Protected Member Functions inherited from XPrimaryDriver
void finishWritingRaw (const shared_ptr< const RawData > &rawdata, const XTime &time_awared, const XTime &time_recorded)
 
- Protected Member Functions inherited from XDriver
void record (Transaction &tr, const XTime &time_awared, const XTime &time_recorded)
 

Private Types

enum  { CAL_POLY_ORDER = 4 }
 
typedef int16 tRawAI
 

Private Member Functions

void onSoftTrigStarted (const shared_ptr< XNIDAQmxInterface::SoftwareTrigger > &)
 
void onSoftTrigChanged (const shared_ptr< XNIDAQmxInterface::SoftwareTrigger > &)
 
void * executeReadAI (const atomic< bool > &)
 
float64 aiRawToVolt (const float64 *pcoeff, float64 raw)
 
void clearAcquision ()
 
void setupAcquision ()
 
void disableTrigger ()
 
void setupTrigger ()
 
void clearStoredSoftwareTrigger ()
 
void setupSoftwareTrigger ()
 
void setupTiming ()
 
void createChannels ()
 
void acquire (const atomic< bool > &terminated)
 
void onTaskDone (TaskHandle task, int32 status)
 
bool tryReadAISuspend (const atomic< bool > &terminated)
 

Static Private Member Functions

static int32 onTaskDone_ (TaskHandle task, int32 status, void *)
 

Private Attributes

shared_ptr
< XNIDAQmxInterface::SoftwareTrigger
m_softwareTrigger
 
shared_ptr< XListenerm_lsnOnSoftTrigStarted
 
shared_ptr< XListenerm_lsnOnSoftTrigChanged
 
shared_ptr< XThread
< XNIDAQmxDSO > > 
m_threadReadAI
 
atomic< bool > m_suspendRead
 
atomic< bool > m_running
 
std::vector< tRawAI > m_recordBuf
 
float64 m_coeffAI [4][CAL_POLY_ORDER]
 
DSORawRecord m_dsoRawRecordBanks [2]
 
int m_dsoRawRecordBankLatest
 
std::deque< std::vector< tRawAI > > m_record_av
 for moving av.
 
TaskHandle m_task
 
double m_interval
 
unsigned int m_preTriggerPos
 
XRecursiveMutex m_readMutex
 

Additional Inherited Members

- Public Types inherited from XDSO
enum  DRFMODE { DRFMODE_OFF = 0, DRFMODE_GIVEN_FREQ = 1, DRFMODE_FREQ_BY_SG = 2, DRFMODE_COHERENT_SG = 3 }
 
- Static Public Member Functions inherited from XNode
template<class T__ >
static shared_ptr< T__ > createOrphan (const char *name)
 
template<class T__ , typename... Args_>
static shared_ptr< T__ > createOrphan (const char *name, bool runtime, Args_ &&...args)
 
- Protected Attributes inherited from XDSO
shared_ptr< XListenerm_lsnOnTrigSourceChanged
 

Detailed Description

Software DSO w/ NI DAQmx.

Definition at line 22 of file nidaqdso.h.

Member Function Documentation

int XNIDAQmxDSO::acqCount ( bool *  seq_busy)
protectedvirtual
Parameters
seq_busytrue if the sequence is not finished.

Implements XDSO.

Definition at line 864 of file nidaqdso.cpp.

References XDSO::average().

void XNIDAQmxDSO::setupTiming ( )
private

debug!

Definition at line 318 of file nidaqdso.cpp.

References startSequence().


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

Generated for KAME4 by  doxygen 1.8.3