Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
XPulser Class Referenceabstract

Base class of NMR Pulsers. More...

#include <pulserdriver.h>

Inheritance diagram for XPulser:
Inheritance graph
[legend]

Classes

struct  Payload
 

Public Types

enum  { N_MODE_NMR_PULSER = 0, N_MODE_PULSE_ANALYZER = 1 }
 driver specific part below More...
 
enum  { N_COMB_MODE_OFF = 0, N_COMB_MODE_ON = 1, N_COMB_MODE_P1_ALT = 2, N_COMB_MODE_COMB_ALT = 3 }
 
enum  { N_RT_MODE_FIXREP = 0, N_RT_MODE_FIXREST = 1 }
 
enum  { MAX_NUM_PHASE_CYCLE = 16 }
 
enum  { NUM_DO_PORTS = 16 }
 

of digital-pulse ports.


 
enum  {
  PAT_DO_MASK = (1 << NUM_DO_PORTS) - 1, PAT_QAM_PHASE = (1 << NUM_DO_PORTS), PAT_QAM_PHASE_MASK = PAT_QAM_PHASE * 3, PAT_QAM_PULSE_IDX = PAT_QAM_PHASE * 4,
  PAT_QAM_PULSE_IDX_P1 = PAT_QAM_PULSE_IDX * 1, PAT_QAM_PULSE_IDX_P2 = PAT_QAM_PULSE_IDX * 2, PAT_QAM_PULSE_IDX_PCOMB = PAT_QAM_PULSE_IDX * 3, PAT_QAM_PULSE_IDX_INDUCE_EMISSION = PAT_QAM_PULSE_IDX * 4,
  PAT_QAM_PULSE_IDX_MASK = PAT_QAM_PULSE_IDX * 15, PAT_QAM_MASK = PAT_QAM_PHASE_MASK | PAT_QAM_PULSE_IDX_MASK
}
 for RelPatList patterns. More...
 

Public Member Functions

 XPulser (const char *name, bool runtime, Transaction &tr_meas, const shared_ptr< XMeasure > &meas)
 
virtual void showForms ()
 shows all forms belonging to driver
 
const shared_ptr< XBoolNode > & output () const
 
const shared_ptr< XComboNode > & combMode () const
 
const shared_ptr< XComboNode > & rtMode () const
 
const shared_ptr< XComboNode > & numPhaseCycle () const
 How many cycles in phase cycling.
 
const shared_ptr< XDoubleNode > & rtime () const
 Repetition/Rest Time [ms].
 
const shared_ptr< XDoubleNode > & tau () const
 [us]
 
const shared_ptr< XDoubleNode > & combPW () const
 PulseWidths [us].
 
const shared_ptr< XDoubleNode > & pw1 () const
 PulseWidths [us].
 
const shared_ptr< XDoubleNode > & pw2 () const
 PulseWidths [us].
 
const shared_ptr< XDoubleNode > & combPT () const
 Comb pulse periodic term [us].
 
const shared_ptr< XDoubleNode > & combP1 () const
 P1 and P1 alternative.
 
const shared_ptr< XDoubleNode > & combP1Alt () const
 P1 and P1 alternative.
 
const shared_ptr< XDoubleNode > & aswSetup () const
 Analog switch setting, setup(proceeding) time before the first spin echo.
 
const shared_ptr< XDoubleNode > & aswHold () const
 Analog switch setting, hold time after the last spin echo.
 
const shared_ptr< XDoubleNode > & altSep () const
 Separation time in DSO record, cause a shift of trigger of DSO in alternatively mode.
 
const shared_ptr< XDoubleNode > & g2Setup () const
 Setup time of pre-gating port and QPSK.
 
const shared_ptr< XUIntNode > & combNum () const
 

of comb pulses


 
const shared_ptr< XUIntNode > & echoNum () const
 

of Spin echoes (i.e. pi pulses)


 
const shared_ptr< XBoolNode > & drivenEquilibrium () const
 polarize spins after pulse sequence or not
 
const shared_ptr< XDoubleNode > & combOffRes () const
 off-resonance comb pulses
 
const shared_ptr< XComboNode > & combFunc () const
 Pulse Modulation.
 
const shared_ptr< XComboNode > & p1Func () const
 Pulse Modulation.
 
const shared_ptr< XComboNode > & p2Func () const
 Pulse Modulation.
 
const shared_ptr< XDoubleNode > & combLevel () const
 [dB], Pulse Modulation
 
const shared_ptr< XDoubleNode > & p1Level () const
 [dB], Pulse Modulation
 
const shared_ptr< XDoubleNode > & p2Level () const
 [dB], Pulse Modulation
 
const shared_ptr< XDoubleNode > & masterLevel () const
 [dB]
 
const shared_ptr< XBoolNode > & induceEmission () const
 
const shared_ptr< XDoubleNode > & induceEmissionPhase () const
 
const shared_ptr< XDoubleNode > & qamOffset1 () const
 
const shared_ptr< XDoubleNode > & qamOffset2 () const
 [F.S.]
 
const shared_ptr< XDoubleNode > & qamLevel1 () const
 
const shared_ptr< XDoubleNode > & qamLevel2 () const
 < Quadrature Amplitude Modulation. Amplitude compensation factor.
 
const shared_ptr< XDoubleNode > & qamDelay1 () const
 
const shared_ptr< XDoubleNode > & qamDelay2 () const
 < Delaying compensation [us].
 
const shared_ptr< XDoubleNode > & difFreq () const
 [MHz]
 
const shared_ptr< XDoubleNode > & qswDelay () const
 Q-switch setting, period after the end-edge of pulses [us].
 
const shared_ptr< XDoubleNode > & qswWidth () const
 Q-switch setting, width of suppression [us].
 
const shared_ptr< XDoubleNode > & qswSoftSWOff () const
 Q-switch setting, second pulse [us].
 
const shared_ptr< XBoolNode > & qswPiPulseOnly () const
 Q-switch setting, use QSW only for pi pulses.
 
const shared_ptr< XBoolNode > & invertPhase () const
 
const shared_ptr< XBoolNode > & conserveStEPhase () const
 
const shared_ptr< XComboNode > & portSel (unsigned int port) const
 
const shared_ptr< XBoolNode > & pulseAnalyzerMode () const
 
const shared_ptr< XDoubleNode > & paPulseRept () const
 
const shared_ptr< XDoubleNode > & paPulseBW () const
 
const shared_ptr< XUIntNode > & firstPhase () const
 0-3, selects the first phase of QPSK.
 
virtual double resolution () const =0
 time resolution [ms]
 
- 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 Types

enum  {
  PORTSEL_UNSEL = -1, PORTSEL_GATE = 0, PORTSEL_PREGATE = 1, PORTSEL_GATE3 = 2,
  PORTSEL_TRIG1 = 3, PORTSEL_TRIG2 = 4, PORTSEL_ASW = 5, PORTSEL_QSW = 6,
  PORTSEL_PULSE1 = 7, PORTSEL_PULSE2 = 8, PORTSEL_COMB = 9, PORTSEL_COMB_FM = 10,
  PORTSEL_QPSK_A = 11, PORTSEL_QPSK_B = 12, PORTSEL_QPSK_OLD_NONINV = 13, PORTSEL_QPSK_OLD_INV = 14,
  PORTSEL_QPSK_OLD_PSGATE = 15, PORTSEL_PULSE_ANALYZER_GATE = 16
}
 indice for return values of portSel().
 
typedef FFT::twindowfunc tpulsefunc
 

Protected Member Functions

unsigned int selectedPorts (const Snapshot &shot, int func) const
 
virtual void start ()
 Starts up your threads, connects GUI, and activates signals.
 
virtual void stop ()
 
virtual void analyzeRaw (RawDataReader &reader, Transaction &tr) throw (XRecordError&)
 
virtual void visualize (const Snapshot &shot)
 
tpulsefunc pulseFunc (int func_no) const
 
int pulseFuncNo (const XString &str) const
 
virtual void changeOutput (const Snapshot &shot, bool output, unsigned int blankpattern)=0
 Sends patterns to pulser or turns off.
 
virtual void createNativePatterns (Transaction &tr)=0
 Converts RelPatList to native patterns.
 
virtual double resolutionQAM () const =0
 
virtual double minPulseWidth () const =0
 minimum period of pulses [ms]
 
virtual bool hasQAMPorts () const =0
 existence of AO ports.
 
- Protected Member Functions inherited from XPrimaryDriver
virtual void closeInterface ()=0
 
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 Member Functions

void onMoreConfigShow (const Snapshot &shot, XTouchableNode *)
 
void onPulseChanged (const Snapshot &shot, XValueNodeBase *node)
 
void createRelPatListNMRPulser (Transaction &tr) throw (XRecordError&)
 creates RelPatList
 
void createRelPatListPulseAnalyzer (Transaction &tr) throw (XRecordError&)
 
unsigned int bitpatternsOfQPSK (const Snapshot &shot, unsigned int qpsk[4], unsigned int qpskinv[4], bool invert)
 
void makeWaveForm (Transaction &tr, unsigned int pnum_minus_1, double pw, unsigned int to_center, tpulsefunc func, double dB, double freq=0.0, double phase=0.0)
 prepares waveforms for QAM.
 
double rintTermMilliSec (double msec) const
 truncates time by resolution().
 
double rintTermMicroSec (double usec) const
 
uint64_t ceilSampsMicroSec (double us) const
 
uint64_t rintSampsMicroSec (double us) const
 
uint64_t rintSampsMilliSec (double ms) const
 
void changeUIStatus (bool nmrmode, bool state)
 

Private Attributes

const shared_ptr< XBoolNodem_output
 
const shared_ptr< XComboNodem_combMode
 
const shared_ptr< XComboNodem_rtMode
 
const shared_ptr< XDoubleNodem_rt
 Repetition/Rest Time [ms].
 
const shared_ptr< XDoubleNodem_tau
 [us]
 
const shared_ptr< XDoubleNodem_combPW
 
const shared_ptr< XDoubleNodem_pw1
 
const shared_ptr< XDoubleNodem_pw2
 PulseWidths [us].
 
const shared_ptr< XUIntNodem_combNum
 

of comb pulses


 
const shared_ptr< XDoubleNodem_combPT
 Comb pulse periodic term [us].
 
const shared_ptr< XDoubleNodem_combP1
 
const shared_ptr< XDoubleNodem_combP1Alt
 P1 and P1 alternative.
 
const shared_ptr< XDoubleNodem_aswSetup
 Analog switch setting, setup(proceeding) time before the first spin echo.
 
const shared_ptr< XDoubleNodem_aswHold
 Analog switch setting, hold time after the last spin echo.
 
const shared_ptr< XDoubleNodem_altSep
 Separation time in DSO record, cause a shift of trigger of DSO in alternatively mode.
 
const shared_ptr< XDoubleNodem_g2Setup
 Setup time of pre-gating port and QPSK.
 
const shared_ptr< XUIntNodem_echoNum
 

of Spin echoes (i.e. pi pulses)


 
const shared_ptr< XDoubleNodem_combOffRes
 off-resonance comb pulses
 
const shared_ptr< XBoolNodem_drivenEquilibrium
 polarize spins after pulse sequence or not
 
const shared_ptr< XComboNodem_numPhaseCycle
 How many cycles in phase cycling.
 
const shared_ptr< XComboNodem_p1Func
 
const shared_ptr< XComboNodem_p2Func
 
const shared_ptr< XComboNodem_combFunc
 Pulse Modulation.
 
const shared_ptr< XDoubleNodem_p1Level
 
const shared_ptr< XDoubleNodem_p2Level
 
const shared_ptr< XDoubleNodem_combLevel
 [dB], Pulse Modulation
 
const shared_ptr< XDoubleNodem_masterLevel
 [dB]
 
const shared_ptr< XDoubleNodem_qamOffset1
 
const shared_ptr< XDoubleNodem_qamOffset2
 [F.S.]
 
const shared_ptr< XDoubleNodem_qamLevel1
 
const shared_ptr< XDoubleNodem_qamLevel2
 
const shared_ptr< XDoubleNodem_qamDelay1
 
const shared_ptr< XDoubleNodem_qamDelay2
 [us]
 
const shared_ptr< XDoubleNodem_difFreq
 [MHz]
 
const shared_ptr< XBoolNodem_induceEmission
 
const shared_ptr< XDoubleNodem_induceEmissionPhase
 
const shared_ptr< XDoubleNodem_qswDelay
 
const shared_ptr< XDoubleNodem_qswWidth
 
const shared_ptr< XDoubleNodem_qswSoftSWOff
 
const shared_ptr< XBoolNodem_invertPhase
 
const shared_ptr< XBoolNodem_conserveStEPhase
 
const shared_ptr< XBoolNodem_qswPiPulseOnly
 
shared_ptr< XComboNodem_portSel [NUM_DO_PORTS]
 
const shared_ptr< XBoolNodem_pulseAnalyzerMode
 
const shared_ptr< XDoubleNodem_paPulseRept
 [ms]
 
const shared_ptr< XDoubleNodem_paPulseBW
 [kHz]
 
const shared_ptr< XUIntNodem_firstPhase
 0-3, selects QPSK for the first cycle.
 
const shared_ptr< XTouchableNodem_moreConfigShow
 
std::deque< xqcon_ptrm_conUIs
 
shared_ptr< XListenerm_lsnOnPulseChanged
 
shared_ptr< XListenerm_lsnOnMoreConfigShow
 
const qshared_ptr< FrmPulserm_form
 
const qshared_ptr< FrmPulserMorem_formMore
 
xqcon_ptr m_conPulserDriver
 

Additional Inherited Members

- 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)
 

Detailed Description

Base class of NMR Pulsers.

Definition at line 33 of file pulserdriver.h.

Member Enumeration Documentation

anonymous enum

driver specific part below

See Also
pulseAnalyzerMode()

Definition at line 45 of file pulserdriver.h.

anonymous enum
See Also
combMode(), Payload::combMode().

Definition at line 47 of file pulserdriver.h.

anonymous enum
See Also
rtMode(), Payload::rtMode().

Definition at line 49 of file pulserdriver.h.

anonymous enum
See Also
numPhaseCycle(), Payload::numPhaseCycle().

Definition at line 51 of file pulserdriver.h.

anonymous enum

for RelPatList patterns.

See Also
Payload::RelPatList.

Definition at line 55 of file pulserdriver.h.

Member Function Documentation

void XPulser::analyzeRaw ( RawDataReader reader,
Transaction tr 
) throw (XRecordError&)
protectedvirtual

This function will be called when raw data are written. Implement this function to convert the raw data to the record (Payload).

See Also
analyze()

Implements XPrimaryDriver.

Definition at line 422 of file pulserdriver.cpp.

unsigned int XPulser::bitpatternsOfQPSK ( const Snapshot shot,
unsigned int  qpsk[4],
unsigned int  qpskinv[4],
bool  invert 
)
private
Returns
maskbits for QPSK ports.

Definition at line 1032 of file pulserdriver.cpp.

References selectedPorts().

Referenced by createRelPatListNMRPulser().

const shared_ptr<XComboNode>& XPulser::combMode ( ) const
inline

see above definitions in header file

Definition at line 165 of file pulserdriver.h.

References m_combMode.

Referenced by start().

const shared_ptr<XDoubleNode>& XPulser::qamDelay2 ( ) const
inline

< Delaying compensation [us].

[us]

Definition at line 200 of file pulserdriver.h.

References m_qamDelay2.

Referenced by makeWaveForm(), and start().

const shared_ptr<XComboNode>& XPulser::rtMode ( ) const
inline

Control period to next pulse sequence Fix Repetition Time or Fix Rest Time which means time between pulse sequences

Definition at line 168 of file pulserdriver.h.

References m_rtMode.

unsigned int XPulser::selectedPorts ( const Snapshot shot,
int  func 
) const
protected
Parameters
funce.g. PORTSEL_GATE.
Returns
bit mask.

Definition at line 629 of file pulserdriver.cpp.

Referenced by bitpatternsOfQPSK(), createRelPatListNMRPulser(), and visualize().

void XPulser::stop ( )
protectedvirtual

Shuts down your threads, unconnects GUI, and deactivates signals This function may be called even if driver has already stopped.

Implements XPrimaryDriver.

Definition at line 359 of file pulserdriver.cpp.

References XPrimaryDriver::closeInterface().

void XPulser::visualize ( const Snapshot shot)
protectedvirtual

This function is called inside analyze() or analyzeRaw() This might be called even if the record is broken (time() == false).

Implements XDriver.

Definition at line 1153 of file pulserdriver.cpp.

References changeOutput(), XNode::getLabel(), and selectedPorts().

Member Data Documentation

const shared_ptr<XComboNode> XPulser::m_combMode
private

see above definitions in header file

Definition at line 264 of file pulserdriver.h.

Referenced by combMode().

const shared_ptr<XComboNode> XPulser::m_rtMode
private

Control period to next pulse sequence Fix Repetition Time or Fix Rest Time which means time between pulse sequences

Definition at line 267 of file pulserdriver.h.

Referenced by rtMode().


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

Generated for KAME4 by  doxygen 1.8.3