TSPD-ADQ EPICS device support
1.2.0
|
Go to the documentation of this file.
7 #ifndef ADQAICHANNELGROUP_H
8 #define ADQAICHANNELGROUP_H
98 ADQAIChannelGroup(
const std::string& name, nds::Node& parentNode, ADQInterface*& adqInterface,
void* adqCtrlUnit);
118 template <
typename T>
119 void createPv(
const std::string& name, nds::PVDelegateIn<T>& pvRb,
125 template <
typename T>
126 void createPvEnum(
const std::string& name, nds::PVDelegateIn<T>& pvRb, nds::enumerationStrings_t enumList,
133 template <
typename T>
139 void setDaqMode(
const timespec& pTimestamp,
const int32_t& pValue);
144 void getDaqMode(timespec* pTimestamp, int32_t* pValue);
149 void setTrigMode(
const timespec& pTimestamp,
const int32_t& pValue);
154 void getTrigMode(timespec* pTimestamp, int32_t* pValue);
159 void setDbsBypass(
const timespec& pTimestamp,
const int32_t& pValue);
164 void getDbsBypass(timespec* pTimestamp, int32_t* pValue);
169 void setDbsDc(
const timespec& pTimestamp,
const int32_t& pValue);
174 void getDbsDc(timespec* pTimestamp, int32_t* pValue);
179 void setDbsLowSat(
const timespec& pTimestamp,
const int32_t& pValue);
184 void getDbsLowSat(timespec* pTimestamp, int32_t* pValue);
189 void setDbsUpSat(
const timespec& pTimestamp,
const int32_t& pValue);
194 void getDbsUpSat(timespec* pTimestamp, int32_t* pValue);
199 void setPatternMode(
const timespec& pTimestamp,
const int32_t& pValue);
209 void setChanActive(
const timespec& pTimestamp,
const int32_t& pValue);
219 void getChanMask(timespec* pTimestamp, int32_t* pValue);
224 void setRecordCnt(
const timespec& pTimestamp,
const int32_t& pValue);
229 void getRecordCnt(timespec* pTimestamp, int32_t* pValue);
244 void setSampleCnt(
const timespec& pTimestamp,
const int32_t& pValue);
249 void getSampleCnt(timespec* pTimestamp, int32_t* pValue);
264 void setSampleSkip(
const timespec& pTimestamp,
const int32_t& pValue);
274 void setSampleDec(
const timespec& pTimestamp,
const int32_t& pValue);
279 void getSampleDec(timespec* pTimestamp, int32_t* pValue);
284 void setPreTrigSamp(
const timespec& pTimestamp,
const int32_t& pValue);
304 void setClockSrc(
const timespec& pTimestamp,
const int32_t& pValue);
309 void getClockSrc(timespec* pTimestamp, int32_t* pValue);
314 void setClockRefOut(
const timespec& pTimestamp,
const int32_t& pValue);
324 void setTimeout(
const timespec& pTimestamp,
const int32_t& pValue);
329 void getTimeout(timespec* pTimestamp, int32_t* pValue);
334 void setStreamTime(
const timespec& pTimestamp,
const double& pValue);
344 void setSWTrigEdge(
const timespec& pTimestamp,
const int32_t& pValue);
354 void setLevelTrigLvl(
const timespec& pTimestamp,
const int32_t& pValue);
459 void getLogMsg(timespec* pTimestamp, std::string* pValue);
489 bool allowChange(
const nds::state_t currentLocal,
const nds::state_t currentGlobal,
const nds::state_t nextLocal);
512 ADQInterface* m_adqInterface;
514 nds::Thread m_daqThread;
515 bool m_stopDaq =
true;
516 std::atomic_bool m_threadInterruptOnExit = {
false };
518 unsigned int m_chanCnt;
522 bool m_daqModeChanged;
524 int32_t m_patternMode;
525 bool m_patternModeChanged;
528 bool m_dbsBypassChanged;
532 bool m_dbsLowSatChanged;
534 bool m_dbsUpSatChanged;
537 bool m_recordCntChanged;
538 int32_t m_recordCntCollect;
539 bool m_recordCntCollectChanged;
542 bool m_sampleCntChanged;
543 int32_t m_sampleCntMax;
544 int32_t m_sampleCntTotal;
545 bool m_sampleSkipChanged;
546 int32_t m_sampleSkip;
547 bool m_sampleDecChanged;
549 bool m_preTrigSampChanged;
550 int32_t m_preTrigSamp;
551 bool m_trigHoldOffSampChanged;
552 int32_t m_trigHoldOffSamp;
554 bool m_clockSrcChanged;
556 bool m_clockRefOutChanged;
557 int32_t m_clockRefOut;
559 int32_t m_chanActive;
560 bool m_chanActiveChanged;
561 unsigned int m_chanInt;
565 bool m_trigModeChanged;
566 int32_t m_swTrigEdge;
567 bool m_swTrigEdgeChanged;
568 int32_t m_levelTrigLvl;
569 bool m_levelTrigLvlChanged;
570 int32_t m_levelTrigEdge;
571 bool m_levelTrigEdgeChanged;
572 int32_t m_levelTrigChan;
573 int32_t m_levelTrigChanMask;
574 bool m_levelTrigChanChanged;
575 int32_t m_externTrigDelay;
576 bool m_externTrigDelayChanged;
577 double m_externTrigThreshold;
578 bool m_externTrigThresholdChanged;
579 int32_t m_externTrigEdge;
580 bool m_externTrigEdgeChanged;
581 int32_t m_internTrigHighSamp;
582 bool m_internTrigHighSampChanged;
583 int32_t m_internTrigLowSamp;
584 bool m_internTrigLowSampChanged;
585 int32_t m_internTrigFreq;
586 bool m_internTrigFreqChanged;
587 int32_t m_internTrigPeriod;
588 int32_t m_internTrigEdge;
589 bool m_internTrigEdgeChanged;
591 int32_t m_overVoltProtect;
592 bool m_overVoltProtectChanged;
594 bool m_timeoutChanged;
597 bool m_streamTimeChanged;
604 void commitChanges(
bool calledFromDaqThread =
false);
606 nds::PVDelegateIn<std::string> m_logMsgPV;
607 nds::PVDelegateIn<int32_t> m_daqModePV;
608 nds::PVDelegateIn<int32_t> m_patternModePV;
609 nds::PVDelegateIn<int32_t> m_chanActivePV;
610 nds::PVDelegateIn<int32_t> m_chanMaskPV;
611 nds::PVDelegateIn<int32_t> m_dbsBypassPV;
612 nds::PVDelegateIn<int32_t> m_dbsDcPV;
613 nds::PVDelegateIn<int32_t> m_dbsLowSatPV;
614 nds::PVDelegateIn<int32_t> m_dbsUpSatPV;
615 nds::PVDelegateIn<int32_t> m_recordCntPV;
616 nds::PVDelegateIn<int32_t> m_recordCntCollectPV;
617 nds::PVDelegateIn<int32_t> m_sampleCntPV;
618 nds::PVDelegateIn<int32_t> m_sampleCntMaxPV;
619 nds::PVDelegateIn<int32_t> m_sampleCntTotalPV;
620 nds::PVDelegateIn<int32_t> m_sampleDecPV;
621 nds::PVDelegateIn<int32_t> m_preTrigSampPV;
622 nds::PVDelegateIn<int32_t> m_trigHoldOffSampPV;
623 nds::PVDelegateIn<int32_t> m_clockSrcPV;
624 nds::PVDelegateIn<int32_t> m_clockRefOutPV;
625 nds::PVDelegateIn<int32_t> m_trigModePV;
626 nds::PVDelegateIn<int32_t> m_swTrigEdgePV;
627 nds::PVDelegateIn<int32_t> m_levelTrigLvlPV;
628 nds::PVDelegateIn<int32_t> m_levelTrigEdgePV;
629 nds::PVDelegateIn<int32_t> m_levelTrigChanPV;
630 nds::PVDelegateIn<int32_t> m_levelTrigChanMaskPV;
631 nds::PVDelegateIn<int32_t> m_externTrigDelayPV;
632 nds::PVDelegateIn<double> m_externTrigThresholdPV;
633 nds::PVDelegateIn<int32_t> m_externTrigEdgePV;
634 nds::PVDelegateIn<int32_t> m_internTrigHighSampPV;
635 nds::PVDelegateIn<int32_t> m_internTrigLowSampPV;
636 nds::PVDelegateIn<int32_t> m_internTrigFreqPV;
637 nds::PVDelegateIn<int32_t> m_internTrigEdgePV;
638 nds::PVDelegateIn<int32_t> m_timeoutPV;
639 nds::PVDelegateIn<double> m_streamTimePV;
646 short* m_daqRawDataBuffer;
void setInternTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger edge.
Definition: ADQAIChannelGroup.cpp:637
void setLevelTrigChan(const timespec &pTimestamp, const int32_t &pValue)
Sets the Level trigger channel.
Definition: ADQAIChannelGroup.cpp:539
void getTimeout(timespec *pTimestamp, int32_t *pValue)
Gets the flush timeout (Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:665
void createPvEnum(const std::string &name, nds::PVDelegateIn< T > &pvRb, nds::enumerationStrings_t enumList, std::function< void(ADQAIChannelGroup *, const timespec &, const T &)> setter, std::function< void(ADQAIChannelGroup *, timespec *, T *)> getter)
This function creates the Enumeration type of PV and sets it readback PV to interrupt mode.
Definition: ADQAIChannelGroup.cpp:224
#define CHANNEL_COUNT_MAX
Maximum allowed amount of channels.
Definition: ADQDefinition.h:73
void setRecordCntCollect(const timespec &pTimestamp, const int32_t &pValue)
Sets the number of records to pass to the device (Multi-Record mode).
Definition: ADQAIChannelGroup.cpp:373
This class monitors informative parameters of the connected digitizer.
Definition: ADQInfo.h:20
void getSampleDec(timespec *pTimestamp, int32_t *pValue)
Sets the sample decimation (-FWSDR digitizers only).
Definition: ADQAIChannelGroup.cpp:421
void getLevelTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the Level trigger edge.
Definition: ADQAIChannelGroup.cpp:533
void getStreamTime(timespec *pTimestamp, double *pValue)
Gets the streaming time (Continuous streaming mode).
Definition: ADQAIChannelGroup.cpp:679
void onStop()
Stops the data acquisition and sets the state machine to state ON.
Definition: ADQAIChannelGroup.cpp:1613
void getInternTrigHighSamp(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger high sample length.
Definition: ADQAIChannelGroup.cpp:609
void daqRawStream()
This method processes Raw streaming data acquisition.
Definition: ADQAIChannelGroup.cpp:2339
void recover()
State machine function. Not supported.
Definition: ADQAIChannelGroup.cpp:1628
void daqMultiRecord()
This method processes Multi-Record data acquisition.
Definition: ADQAIChannelGroup.cpp:2000
void setSWTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the SW trigger edge.
Definition: ADQAIChannelGroup.cpp:497
void setSampleCnt(const timespec &pTimestamp, const int32_t &pValue)
Sets the number of samples per record.
Definition: ADQAIChannelGroup.cpp:387
void getDbsBypass(timespec *pTimestamp, int32_t *pValue)
Gets if the DBS settings is bypassed (1) or not (0).
Definition: ADQAIChannelGroup.cpp:311
void onStart()
Sets the state machine to state RUNNING and starts data acquisition.
Definition: ADQAIChannelGroup.cpp:1587
void setDbsLowSat(const timespec &pTimestamp, const int32_t &pValue)
Sets the lower saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:331
void getSamplesTotal(timespec *pTimestamp, int32_t *pValue)
Gets a total number of samples to acquire (Number of records * Number of samples).
Definition: ADQAIChannelGroup.cpp:407
void setDbsUpSat(const timespec &pTimestamp, const int32_t &pValue)
Sets the upper saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:345
void getPreTrigSamp(timespec *pTimestamp, int32_t *pValue)
Gets the number of pre-trigger samples (Multi-Record and Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:435
void daqContinStream()
This method processes Continuous streaming data acquisition.
Definition: ADQAIChannelGroup.cpp:2152
void setPatternMode(const timespec &pTimestamp, const int32_t &pValue)
Sets the pattern mode.
Definition: ADQAIChannelGroup.cpp:269
void setDaqMode(const timespec &pTimestamp, const int32_t &pValue)
Sets the data acquisition mode.
Definition: ADQAIChannelGroup.cpp:255
void getClockSrc(timespec *pTimestamp, int32_t *pValue)
Gets the clock source.
Definition: ADQAIChannelGroup.cpp:463
void getLevelTrigLvl(timespec *pTimestamp, int32_t *pValue)
Gets the trigger level of Level trigger.
Definition: ADQAIChannelGroup.cpp:519
void setSampleDec(const timespec &pTimestamp, const int32_t &pValue)
Gets the data acquisition mode..
Definition: ADQAIChannelGroup.cpp:413
void getTrigHoldOffSamp(timespec *pTimestamp, int32_t *pValue)
Gets the number of hold-off samples (Multi-Record and Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:449
nds::PVDelegateIn< T > createPvRb(const std::string &name, std::function< void(ADQAIChannelGroup *, timespec *, T *)> getter)
This function creates and returns the readback PV.
Definition: ADQAIChannelGroup.cpp:242
void getDbsUpSat(timespec *pTimestamp, int32_t *pValue)
Gets the upper saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:353
void createPv(const std::string &name, nds::PVDelegateIn< T > &pvRb, std::function< void(ADQAIChannelGroup *, const timespec &, const T &)> setter, std::function< void(ADQAIChannelGroup *, timespec *, T *)> getter)
This function creates the most common type of PV and sets it readback PV to interrupt mode.
Definition: ADQAIChannelGroup.cpp:208
void setDbsDc(const timespec &pTimestamp, const int32_t &pValue)
Sets the DC target for the DBS.
Definition: ADQAIChannelGroup.cpp:317
void setPreTrigSamp(const timespec &pTimestamp, const int32_t &pValue)
Sets the number of pre-trigger samples (Multi-Record and Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:427
This file contains global objects (constants and macros). They are used in classes that include this ...
void getLogMsg(timespec *pTimestamp, std::string *pValue)
Gets the log messages.
Definition: ADQAIChannelGroup.cpp:248
void setTrigHoldOffSamp(const timespec &pTimestamp, const int32_t &pValue)
Sets the number of hold-off samples (Multi-Record and Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:441
void getSampleCnt(timespec *pTimestamp, int32_t *pValue)
Gets the number of samples per record.
Definition: ADQAIChannelGroup.cpp:395
This file defines ADQInfo class.
void getExternTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the External trigger edge.
Definition: ADQAIChannelGroup.cpp:595
nds::Port m_node
ADQAIChannelGroup class node that connects to the device.
Definition: ADQAIChannelGroup.h:104
nds::StateMachine m_stateMachine
State machine of this class. Attached to the node.
Definition: ADQAIChannelGroup.h:109
void setInternTrigFreq(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger frequency.
Definition: ADQAIChannelGroup.cpp:629
void setExternTrigDelay(const timespec &pTimestamp, const int32_t &pValue)
Sets the External trigger delay.
Definition: ADQAIChannelGroup.cpp:559
void getRecordCnt(timespec *pTimestamp, int32_t *pValue)
Gets the number of records to acquire.
Definition: ADQAIChannelGroup.cpp:367
void getInternTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger edge.
Definition: ADQAIChannelGroup.cpp:645
void onSwitchOn()
Sets the state machine to state ON.
Definition: ADQAIChannelGroup.cpp:1558
void getSWTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the SW trigger edge.
Definition: ADQAIChannelGroup.cpp:505
void getExternTrigDelay(timespec *pTimestamp, int32_t *pValue)
Gets the External trigger delay.
Definition: ADQAIChannelGroup.cpp:567
void getPatternMode(timespec *pTimestamp, int32_t *pValue)
Gets the pattern mode.
Definition: ADQAIChannelGroup.cpp:277
void setRecordCnt(const timespec &pTimestamp, const int32_t &pValue)
Sets the number of records to acquire.
Definition: ADQAIChannelGroup.cpp:359
void getSampleSkip(timespec *pTimestamp, int32_t *pValue)
Gets the sample skip.
void setClockSrc(const timespec &pTimestamp, const int32_t &pValue)
Sets the clock source.
Definition: ADQAIChannelGroup.cpp:455
void getDbsDc(timespec *pTimestamp, int32_t *pValue)
Gets the DC target for the DBS.
Definition: ADQAIChannelGroup.cpp:325
void getLevelTrigChanMask(timespec *pTimestamp, int32_t *pValue)
Gets the Level trigger channel mask.
Definition: ADQAIChannelGroup.cpp:553
void setSampleSkip(const timespec &pTimestamp, const int32_t &pValue)
Sets the sample skip.
This file defines ADQAIChannel class.
void getInternTrigLowSamp(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger low sample length.
Definition: ADQAIChannelGroup.cpp:623
void setInternTrigLowSamp(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger low sample length.
Definition: ADQAIChannelGroup.cpp:615
void onSwitchOff()
Sets the state machine to state OFF.
Definition: ADQAIChannelGroup.cpp:1573
void getTrigMode(timespec *pTimestamp, int32_t *pValue)
Gets the trigger mode.
Definition: ADQAIChannelGroup.cpp:491
void getDbsLowSat(timespec *pTimestamp, int32_t *pValue)
Gets the lower saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:339
void setStreamTime(const timespec &pTimestamp, const double &pValue)
Sets the streaming time (Continuous streaming mode).
Definition: ADQAIChannelGroup.cpp:671
void getDaqMode(timespec *pTimestamp, int32_t *pValue)
Gets the data acquisition mode.
Definition: ADQAIChannelGroup.cpp:263
void setInternTrigHighSamp(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger high sample length.
Definition: ADQAIChannelGroup.cpp:601
void getRecordCntCollect(timespec *pTimestamp, int32_t *pValue)
Gets the number of records to pass to the device (Multi-Record mode).
Definition: ADQAIChannelGroup.cpp:381
void setTrigMode(const timespec &pTimestamp, const int32_t &pValue)
Sets the trigger mode.
Definition: ADQAIChannelGroup.cpp:483
bool allowChange(const nds::state_t currentLocal, const nds::state_t currentGlobal, const nds::state_t nextLocal)
Allows the state machine to switch to a new state.
Definition: ADQAIChannelGroup.cpp:1635
void getChanActive(timespec *pTimestamp, int32_t *pValue)
Gets which channels should be active for data acquisition.
Definition: ADQAIChannelGroup.cpp:291
void setClockRefOut(const timespec &pTimestamp, const int32_t &pValue)
Enables (1) or disables (0) clock reference output.
Definition: ADQAIChannelGroup.cpp:469
void setLevelTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the Level trigger edge.
Definition: ADQAIChannelGroup.cpp:525
void daqTrigStream()
This method processes Triggered streaming data acquisition.
Definition: ADQAIChannelGroup.cpp:1670
This class handles majority of parameters for correct setup of each data acquisition mode....
Definition: ADQAIChannelGroup.h:88
void setExternTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the External trigger edge.
Definition: ADQAIChannelGroup.cpp:587
void getChanMask(timespec *pTimestamp, int32_t *pValue)
Gets the channel mask accordingly to chosen active channels.
Definition: ADQAIChannelGroup.cpp:297
void setTimeout(const timespec &pTimestamp, const int32_t &pValue)
Sets the flush timeout (Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:657
void setLevelTrigLvl(const timespec &pTimestamp, const int32_t &pValue)
Sets the trigger level of Level trigger.
Definition: ADQAIChannelGroup.cpp:511
void setChanActive(const timespec &pTimestamp, const int32_t &pValue)
Sets which channels should be active for data acquisition.
Definition: ADQAIChannelGroup.cpp:283
void setDbsBypass(const timespec &pTimestamp, const int32_t &pValue)
Sets if the DBS settings is bypassed (1) or not (0).
Definition: ADQAIChannelGroup.cpp:303
void getLevelTrigChan(timespec *pTimestamp, int32_t *pValue)
Gets the Level trigger channel.
Definition: ADQAIChannelGroup.cpp:547
void setExternTrigThreshold(const timespec &pTimestamp, const double &pValue)
Sets the External trigger treshold.
Definition: ADQAIChannelGroup.cpp:573
void getClockRefOut(timespec *pTimestamp, int32_t *pValue)
Gets the clock reference output.
Definition: ADQAIChannelGroup.cpp:477
ADQAIChannelGroup(const std::string &name, nds::Node &parentNode, ADQInterface *&adqInterface, void *adqCtrlUnit)
ADQAIChannelGroup class constructor.
Definition: ADQAIChannelGroup.cpp:28
std::vector< std::shared_ptr< ADQAIChannel > > m_AIChannelsPtr
Vector of pointers to ADQAIChannel class instances.
Definition: ADQAIChannelGroup.h:114
void getExternTrigThreshold(timespec *pTimestamp, double *pValue)
Gets the External trigger treshold.
Definition: ADQAIChannelGroup.cpp:581
void getSampleCntMax(timespec *pTimestamp, int32_t *pValue)
Gets the maximum number of samples per record accordingly to the number of records (Multi-Record mode...
Definition: ADQAIChannelGroup.cpp:401
void getInternTrigFreq(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger frequency.
Definition: ADQAIChannelGroup.cpp:651