TSPD-ADQ EPICS device support  1.2.0
ADQAIChannelGroup.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 Cosylab d.d.
3 // This software is distributed under the terms found
4 // in file LICENSE.txt that is included with this distribution.
5 //
6 
7 #ifndef ADQAICHANNELGROUP_H
8 #define ADQAICHANNELGROUP_H
9 
10 #include "ADQAIChannel.h"
11 #include "ADQDefinition.h"
12 #include "ADQInfo.h"
13 
14 #include <mutex>
15 #include <atomic>
16 #include <nds3/nds.h>
17 
25 typedef struct
26 {
30  unsigned char recordStatus;
31 
35  unsigned char userID;
36 
40  unsigned char chan;
41 
45  unsigned char dataFormat;
46 
50  unsigned int serialNumber;
51 
55  unsigned int recordNumber;
56 
60  unsigned int samplePeriod;
61 
65  unsigned long long timeStamp;
66 
70  unsigned long long recordStart;
71 
75  unsigned int recordLength;
76 
80  unsigned int reserved;
82 
88 class ADQAIChannelGroup : public ADQInfo
89 {
90 public:
98  ADQAIChannelGroup(const std::string& name, nds::Node& parentNode, ADQInterface*& adqInterface, void* adqCtrlUnit);
99  virtual ~ADQAIChannelGroup();
100 
104  nds::Port m_node;
105 
109  nds::StateMachine m_stateMachine;
110 
114  std::vector<std::shared_ptr<ADQAIChannel>> m_AIChannelsPtr;
115 
118  template <typename T>
119  void createPv(const std::string& name, nds::PVDelegateIn<T>& pvRb,
120  std::function<void(ADQAIChannelGroup*, const timespec&, const T&)> setter,
121  std::function<void(ADQAIChannelGroup*, timespec*, T*)> getter);
122 
125  template <typename T>
126  void createPvEnum(const std::string& name, nds::PVDelegateIn<T>& pvRb, nds::enumerationStrings_t enumList,
127  std::function<void(ADQAIChannelGroup*, const timespec&, const T&)> setter,
128  std::function<void(ADQAIChannelGroup*, timespec*, T*)> getter);
129 
133  template <typename T>
134  nds::PVDelegateIn<T> createPvRb(const std::string& name, std::function<void(ADQAIChannelGroup*, timespec*, T*)> getter);
135 
139  void setDaqMode(const timespec& pTimestamp, const int32_t& pValue);
140 
144  void getDaqMode(timespec* pTimestamp, int32_t* pValue);
145 
149  void setTrigMode(const timespec& pTimestamp, const int32_t& pValue);
150 
154  void getTrigMode(timespec* pTimestamp, int32_t* pValue);
155 
159  void setDbsBypass(const timespec& pTimestamp, const int32_t& pValue);
160 
164  void getDbsBypass(timespec* pTimestamp, int32_t* pValue);
165 
169  void setDbsDc(const timespec& pTimestamp, const int32_t& pValue);
170 
174  void getDbsDc(timespec* pTimestamp, int32_t* pValue);
175 
179  void setDbsLowSat(const timespec& pTimestamp, const int32_t& pValue);
180 
184  void getDbsLowSat(timespec* pTimestamp, int32_t* pValue);
185 
189  void setDbsUpSat(const timespec& pTimestamp, const int32_t& pValue);
190 
194  void getDbsUpSat(timespec* pTimestamp, int32_t* pValue);
195 
199  void setPatternMode(const timespec& pTimestamp, const int32_t& pValue);
200 
204  void getPatternMode(timespec* pTimestamp, int32_t* pValue);
205 
209  void setChanActive(const timespec& pTimestamp, const int32_t& pValue);
210 
214  void getChanActive(timespec* pTimestamp, int32_t* pValue);
215 
219  void getChanMask(timespec* pTimestamp, int32_t* pValue);
220 
224  void setRecordCnt(const timespec& pTimestamp, const int32_t& pValue);
225 
229  void getRecordCnt(timespec* pTimestamp, int32_t* pValue);
230 
234  void setRecordCntCollect(const timespec& pTimestamp, const int32_t& pValue);
235 
239  void getRecordCntCollect(timespec* pTimestamp, int32_t* pValue);
240 
244  void setSampleCnt(const timespec& pTimestamp, const int32_t& pValue);
245 
249  void getSampleCnt(timespec* pTimestamp, int32_t* pValue);
250 
254  void getSampleCntMax(timespec* pTimestamp, int32_t* pValue);
255 
259  void getSamplesTotal(timespec* pTimestamp, int32_t* pValue);
260 
264  void setSampleSkip(const timespec& pTimestamp, const int32_t& pValue);
265 
269  void getSampleSkip(timespec* pTimestamp, int32_t* pValue);
270 
274  void setSampleDec(const timespec& pTimestamp, const int32_t& pValue);
275 
279  void getSampleDec(timespec* pTimestamp, int32_t* pValue);
280 
284  void setPreTrigSamp(const timespec& pTimestamp, const int32_t& pValue);
285 
289  void getPreTrigSamp(timespec* pTimestamp, int32_t* pValue);
290 
294  void setTrigHoldOffSamp(const timespec& pTimestamp, const int32_t& pValue);
295 
299  void getTrigHoldOffSamp(timespec* pTimestamp, int32_t* pValue);
300 
304  void setClockSrc(const timespec& pTimestamp, const int32_t& pValue);
305 
309  void getClockSrc(timespec* pTimestamp, int32_t* pValue);
310 
314  void setClockRefOut(const timespec& pTimestamp, const int32_t& pValue);
315 
319  void getClockRefOut(timespec* pTimestamp, int32_t* pValue);
320 
324  void setTimeout(const timespec& pTimestamp, const int32_t& pValue);
325 
329  void getTimeout(timespec* pTimestamp, int32_t* pValue);
330 
334  void setStreamTime(const timespec& pTimestamp, const double& pValue);
335 
339  void getStreamTime(timespec* pTimestamp, double* pValue);
340 
344  void setSWTrigEdge(const timespec& pTimestamp, const int32_t& pValue);
345 
349  void getSWTrigEdge(timespec* pTimestamp, int32_t* pValue);
350 
354  void setLevelTrigLvl(const timespec& pTimestamp, const int32_t& pValue);
355 
359  void getLevelTrigLvl(timespec* pTimestamp, int32_t* pValue);
360 
364  void setLevelTrigEdge(const timespec& pTimestamp, const int32_t& pValue);
365 
369  void getLevelTrigEdge(timespec* pTimestamp, int32_t* pValue);
370 
374  void setLevelTrigChan(const timespec& pTimestamp, const int32_t& pValue);
375 
379  void getLevelTrigChan(timespec* pTimestamp, int32_t* pValue);
380 
384  void getLevelTrigChanMask(timespec* pTimestamp, int32_t* pValue);
385 
389  void setExternTrigDelay(const timespec& pTimestamp, const int32_t& pValue);
390 
394  void getExternTrigDelay(timespec* pTimestamp, int32_t* pValue);
395 
399  void setExternTrigThreshold(const timespec& pTimestamp, const double& pValue);
400 
404  void getExternTrigThreshold(timespec* pTimestamp, double* pValue);
405 
409  void setExternTrigEdge(const timespec& pTimestamp, const int32_t& pValue);
410 
414  void getExternTrigEdge(timespec* pTimestamp, int32_t* pValue);
415 
419  void setInternTrigHighSamp(const timespec& pTimestamp, const int32_t& pValue);
420 
424  void getInternTrigHighSamp(timespec* pTimestamp, int32_t* pValue);
425 
429  void setInternTrigLowSamp(const timespec& pTimestamp, const int32_t& pValue);
430 
434  void getInternTrigLowSamp(timespec* pTimestamp, int32_t* pValue);
435 
439  void setInternTrigFreq(const timespec& pTimestamp, const int32_t& pValue);
440 
444  void getInternTrigFreq(timespec* pTimestamp, int32_t* pValue);
445 
449  void setInternTrigEdge(const timespec& pTimestamp, const int32_t& pValue);
450 
454  void getInternTrigEdge(timespec* pTimestamp, int32_t* pValue);
455 
459  void getLogMsg(timespec* pTimestamp, std::string* pValue);
460 
464  void onSwitchOn();
465 
469  void onSwitchOff();
470 
474  void onStart();
475 
479  void onStop();
480 
484  void recover();
485 
489  bool allowChange(const nds::state_t currentLocal, const nds::state_t currentGlobal, const nds::state_t nextLocal);
490 
494  void daqTrigStream();
495 
499  void daqMultiRecord();
500 
504  void daqContinStream();
505 
509  void daqRawStream();
510 
511 private:
512  ADQInterface* m_adqInterface;
513 
514  nds::Thread m_daqThread;
515  bool m_stopDaq = true;
516  std::atomic_bool m_threadInterruptOnExit = { false };
517 
518  unsigned int m_chanCnt;
519  int m_adqType;
520 
521  int32_t m_daqMode;
522  bool m_daqModeChanged;
523 
524  int32_t m_patternMode;
525  bool m_patternModeChanged;
526 
527  int32_t m_dbsBypass;
528  bool m_dbsBypassChanged;
529  int32_t m_dbsDc;
530  bool m_dbsDcChanged;
531  int32_t m_dbsLowSat;
532  bool m_dbsLowSatChanged;
533  int32_t m_dbsUpSat;
534  bool m_dbsUpSatChanged;
535 
536  int32_t m_recordCnt;
537  bool m_recordCntChanged;
538  int32_t m_recordCntCollect;
539  bool m_recordCntCollectChanged;
540 
541  int32_t m_sampleCnt;
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;
548  int32_t m_sampleDec;
549  bool m_preTrigSampChanged;
550  int32_t m_preTrigSamp;
551  bool m_trigHoldOffSampChanged;
552  int32_t m_trigHoldOffSamp;
553 
554  bool m_clockSrcChanged;
555  int32_t m_clockSrc;
556  bool m_clockRefOutChanged;
557  int32_t m_clockRefOut;
558 
559  int32_t m_chanActive;
560  bool m_chanActiveChanged;
561  unsigned int m_chanInt;
562  int32_t m_chanMask; // Variations: 0x1 (A), 0x2 (B), 0x4 (C), 0x8 (D), 0x3 (AB), 0xC (CD), 0xF (ABCD)
563 
564  int32_t m_trigMode;
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;
590 
591  int32_t m_overVoltProtect;
592  bool m_overVoltProtectChanged;
593 
594  bool m_timeoutChanged;
595  int32_t m_timeout;
596 
597  bool m_streamTimeChanged;
598  double m_streamTime;
599 
604  void commitChanges(bool calledFromDaqThread = false);
605 
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;
640 
646  short* m_daqRawDataBuffer;
647 
653  short* m_daqDataBuffer[CHANNEL_COUNT_MAX];
654 
660  streamingHeader_t* m_daqStreamHeaders[CHANNEL_COUNT_MAX];
661 
667  short* m_daqLeftoverSamples[CHANNEL_COUNT_MAX];
668 };
669 
670 #endif /* ADQAICHANNELGROUP_H */
ADQAIChannelGroup::setInternTrigEdge
void setInternTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger edge.
Definition: ADQAIChannelGroup.cpp:637
ADQAIChannelGroup::setLevelTrigChan
void setLevelTrigChan(const timespec &pTimestamp, const int32_t &pValue)
Sets the Level trigger channel.
Definition: ADQAIChannelGroup.cpp:539
streamingHeader_t::recordLength
unsigned int recordLength
Number of samples in the record.
Definition: ADQAIChannelGroup.h:75
ADQAIChannelGroup::getTimeout
void getTimeout(timespec *pTimestamp, int32_t *pValue)
Gets the flush timeout (Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:665
ADQAIChannelGroup::createPvEnum
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
CHANNEL_COUNT_MAX
#define CHANNEL_COUNT_MAX
Maximum allowed amount of channels.
Definition: ADQDefinition.h:73
ADQAIChannelGroup::setRecordCntCollect
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
ADQInfo
This class monitors informative parameters of the connected digitizer.
Definition: ADQInfo.h:20
ADQAIChannelGroup::getSampleDec
void getSampleDec(timespec *pTimestamp, int32_t *pValue)
Sets the sample decimation (-FWSDR digitizers only).
Definition: ADQAIChannelGroup.cpp:421
ADQAIChannelGroup::getLevelTrigEdge
void getLevelTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the Level trigger edge.
Definition: ADQAIChannelGroup.cpp:533
ADQAIChannelGroup::getStreamTime
void getStreamTime(timespec *pTimestamp, double *pValue)
Gets the streaming time (Continuous streaming mode).
Definition: ADQAIChannelGroup.cpp:679
ADQAIChannelGroup::onStop
void onStop()
Stops the data acquisition and sets the state machine to state ON.
Definition: ADQAIChannelGroup.cpp:1613
ADQAIChannelGroup::getInternTrigHighSamp
void getInternTrigHighSamp(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger high sample length.
Definition: ADQAIChannelGroup.cpp:609
ADQAIChannelGroup::daqRawStream
void daqRawStream()
This method processes Raw streaming data acquisition.
Definition: ADQAIChannelGroup.cpp:2339
streamingHeader_t::chan
unsigned char chan
The name/number of the channel from which the record is acquired.
Definition: ADQAIChannelGroup.h:40
ADQAIChannelGroup::recover
void recover()
State machine function. Not supported.
Definition: ADQAIChannelGroup.cpp:1628
ADQAIChannelGroup::daqMultiRecord
void daqMultiRecord()
This method processes Multi-Record data acquisition.
Definition: ADQAIChannelGroup.cpp:2000
ADQAIChannelGroup::setSWTrigEdge
void setSWTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the SW trigger edge.
Definition: ADQAIChannelGroup.cpp:497
streamingHeader_t::timeStamp
unsigned long long timeStamp
Time when record was passed.
Definition: ADQAIChannelGroup.h:65
ADQAIChannelGroup::setSampleCnt
void setSampleCnt(const timespec &pTimestamp, const int32_t &pValue)
Sets the number of samples per record.
Definition: ADQAIChannelGroup.cpp:387
ADQAIChannelGroup::getDbsBypass
void getDbsBypass(timespec *pTimestamp, int32_t *pValue)
Gets if the DBS settings is bypassed (1) or not (0).
Definition: ADQAIChannelGroup.cpp:311
ADQAIChannelGroup::onStart
void onStart()
Sets the state machine to state RUNNING and starts data acquisition.
Definition: ADQAIChannelGroup.cpp:1587
streamingHeader_t::recordStart
unsigned long long recordStart
Record start.
Definition: ADQAIChannelGroup.h:70
ADQAIChannelGroup::setDbsLowSat
void setDbsLowSat(const timespec &pTimestamp, const int32_t &pValue)
Sets the lower saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:331
ADQAIChannelGroup::getSamplesTotal
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
ADQAIChannelGroup::setDbsUpSat
void setDbsUpSat(const timespec &pTimestamp, const int32_t &pValue)
Sets the upper saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:345
ADQAIChannelGroup::getPreTrigSamp
void getPreTrigSamp(timespec *pTimestamp, int32_t *pValue)
Gets the number of pre-trigger samples (Multi-Record and Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:435
ADQAIChannelGroup::daqContinStream
void daqContinStream()
This method processes Continuous streaming data acquisition.
Definition: ADQAIChannelGroup.cpp:2152
ADQAIChannelGroup::setPatternMode
void setPatternMode(const timespec &pTimestamp, const int32_t &pValue)
Sets the pattern mode.
Definition: ADQAIChannelGroup.cpp:269
ADQAIChannelGroup::setDaqMode
void setDaqMode(const timespec &pTimestamp, const int32_t &pValue)
Sets the data acquisition mode.
Definition: ADQAIChannelGroup.cpp:255
ADQAIChannelGroup::getClockSrc
void getClockSrc(timespec *pTimestamp, int32_t *pValue)
Gets the clock source.
Definition: ADQAIChannelGroup.cpp:463
ADQAIChannelGroup::getLevelTrigLvl
void getLevelTrigLvl(timespec *pTimestamp, int32_t *pValue)
Gets the trigger level of Level trigger.
Definition: ADQAIChannelGroup.cpp:519
streamingHeader_t::serialNumber
unsigned int serialNumber
Digitizer's serial number.
Definition: ADQAIChannelGroup.h:50
ADQAIChannelGroup::setSampleDec
void setSampleDec(const timespec &pTimestamp, const int32_t &pValue)
Gets the data acquisition mode..
Definition: ADQAIChannelGroup.cpp:413
ADQAIChannelGroup::getTrigHoldOffSamp
void getTrigHoldOffSamp(timespec *pTimestamp, int32_t *pValue)
Gets the number of hold-off samples (Multi-Record and Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:449
ADQAIChannelGroup::createPvRb
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
ADQAIChannelGroup::getDbsUpSat
void getDbsUpSat(timespec *pTimestamp, int32_t *pValue)
Gets the upper saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:353
streamingHeader_t::recordStatus
unsigned char recordStatus
Record status.
Definition: ADQAIChannelGroup.h:30
ADQAIChannelGroup::createPv
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
ADQAIChannelGroup::setDbsDc
void setDbsDc(const timespec &pTimestamp, const int32_t &pValue)
Sets the DC target for the DBS.
Definition: ADQAIChannelGroup.cpp:317
ADQAIChannelGroup::setPreTrigSamp
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
ADQDefinition.h
This file contains global objects (constants and macros). They are used in classes that include this ...
ADQAIChannelGroup::getLogMsg
void getLogMsg(timespec *pTimestamp, std::string *pValue)
Gets the log messages.
Definition: ADQAIChannelGroup.cpp:248
streamingHeader_t::reserved
unsigned int reserved
Reserved placement.
Definition: ADQAIChannelGroup.h:80
streamingHeader_t::userID
unsigned char userID
User ID.
Definition: ADQAIChannelGroup.h:35
ADQAIChannelGroup::setTrigHoldOffSamp
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
ADQAIChannelGroup::getSampleCnt
void getSampleCnt(timespec *pTimestamp, int32_t *pValue)
Gets the number of samples per record.
Definition: ADQAIChannelGroup.cpp:395
ADQInfo.h
This file defines ADQInfo class.
ADQAIChannelGroup::getExternTrigEdge
void getExternTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the External trigger edge.
Definition: ADQAIChannelGroup.cpp:595
ADQAIChannelGroup::m_node
nds::Port m_node
ADQAIChannelGroup class node that connects to the device.
Definition: ADQAIChannelGroup.h:104
ADQAIChannelGroup::m_stateMachine
nds::StateMachine m_stateMachine
State machine of this class. Attached to the node.
Definition: ADQAIChannelGroup.h:109
ADQAIChannelGroup::setInternTrigFreq
void setInternTrigFreq(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger frequency.
Definition: ADQAIChannelGroup.cpp:629
ADQAIChannelGroup::setExternTrigDelay
void setExternTrigDelay(const timespec &pTimestamp, const int32_t &pValue)
Sets the External trigger delay.
Definition: ADQAIChannelGroup.cpp:559
ADQAIChannelGroup::getRecordCnt
void getRecordCnt(timespec *pTimestamp, int32_t *pValue)
Gets the number of records to acquire.
Definition: ADQAIChannelGroup.cpp:367
ADQAIChannelGroup::getInternTrigEdge
void getInternTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger edge.
Definition: ADQAIChannelGroup.cpp:645
ADQAIChannelGroup::onSwitchOn
void onSwitchOn()
Sets the state machine to state ON.
Definition: ADQAIChannelGroup.cpp:1558
ADQAIChannelGroup::getSWTrigEdge
void getSWTrigEdge(timespec *pTimestamp, int32_t *pValue)
Gets the SW trigger edge.
Definition: ADQAIChannelGroup.cpp:505
ADQAIChannelGroup::getExternTrigDelay
void getExternTrigDelay(timespec *pTimestamp, int32_t *pValue)
Gets the External trigger delay.
Definition: ADQAIChannelGroup.cpp:567
ADQAIChannelGroup::getPatternMode
void getPatternMode(timespec *pTimestamp, int32_t *pValue)
Gets the pattern mode.
Definition: ADQAIChannelGroup.cpp:277
ADQAIChannelGroup::setRecordCnt
void setRecordCnt(const timespec &pTimestamp, const int32_t &pValue)
Sets the number of records to acquire.
Definition: ADQAIChannelGroup.cpp:359
ADQAIChannelGroup::getSampleSkip
void getSampleSkip(timespec *pTimestamp, int32_t *pValue)
Gets the sample skip.
streamingHeader_t::recordNumber
unsigned int recordNumber
The number of the passed record.
Definition: ADQAIChannelGroup.h:55
ADQAIChannelGroup::setClockSrc
void setClockSrc(const timespec &pTimestamp, const int32_t &pValue)
Sets the clock source.
Definition: ADQAIChannelGroup.cpp:455
ADQAIChannelGroup::getDbsDc
void getDbsDc(timespec *pTimestamp, int32_t *pValue)
Gets the DC target for the DBS.
Definition: ADQAIChannelGroup.cpp:325
ADQAIChannelGroup::getLevelTrigChanMask
void getLevelTrigChanMask(timespec *pTimestamp, int32_t *pValue)
Gets the Level trigger channel mask.
Definition: ADQAIChannelGroup.cpp:553
ADQAIChannelGroup::setSampleSkip
void setSampleSkip(const timespec &pTimestamp, const int32_t &pValue)
Sets the sample skip.
ADQAIChannel.h
This file defines ADQAIChannel class.
ADQAIChannelGroup::getInternTrigLowSamp
void getInternTrigLowSamp(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger low sample length.
Definition: ADQAIChannelGroup.cpp:623
ADQAIChannelGroup::setInternTrigLowSamp
void setInternTrigLowSamp(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger low sample length.
Definition: ADQAIChannelGroup.cpp:615
streamingHeader_t::dataFormat
unsigned char dataFormat
Data format of the digitizer.
Definition: ADQAIChannelGroup.h:45
streamingHeader_t::samplePeriod
unsigned int samplePeriod
Sample period (1/rate).
Definition: ADQAIChannelGroup.h:60
ADQAIChannelGroup::onSwitchOff
void onSwitchOff()
Sets the state machine to state OFF.
Definition: ADQAIChannelGroup.cpp:1573
ADQAIChannelGroup::getTrigMode
void getTrigMode(timespec *pTimestamp, int32_t *pValue)
Gets the trigger mode.
Definition: ADQAIChannelGroup.cpp:491
ADQAIChannelGroup::getDbsLowSat
void getDbsLowSat(timespec *pTimestamp, int32_t *pValue)
Gets the lower saturation level for the DBS.
Definition: ADQAIChannelGroup.cpp:339
ADQAIChannelGroup::setStreamTime
void setStreamTime(const timespec &pTimestamp, const double &pValue)
Sets the streaming time (Continuous streaming mode).
Definition: ADQAIChannelGroup.cpp:671
ADQAIChannelGroup::getDaqMode
void getDaqMode(timespec *pTimestamp, int32_t *pValue)
Gets the data acquisition mode.
Definition: ADQAIChannelGroup.cpp:263
ADQAIChannelGroup::setInternTrigHighSamp
void setInternTrigHighSamp(const timespec &pTimestamp, const int32_t &pValue)
Sets the Internal trigger high sample length.
Definition: ADQAIChannelGroup.cpp:601
ADQAIChannelGroup::getRecordCntCollect
void getRecordCntCollect(timespec *pTimestamp, int32_t *pValue)
Gets the number of records to pass to the device (Multi-Record mode).
Definition: ADQAIChannelGroup.cpp:381
ADQAIChannelGroup::setTrigMode
void setTrigMode(const timespec &pTimestamp, const int32_t &pValue)
Sets the trigger mode.
Definition: ADQAIChannelGroup.cpp:483
ADQAIChannelGroup::allowChange
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
ADQAIChannelGroup::getChanActive
void getChanActive(timespec *pTimestamp, int32_t *pValue)
Gets which channels should be active for data acquisition.
Definition: ADQAIChannelGroup.cpp:291
ADQAIChannelGroup::setClockRefOut
void setClockRefOut(const timespec &pTimestamp, const int32_t &pValue)
Enables (1) or disables (0) clock reference output.
Definition: ADQAIChannelGroup.cpp:469
ADQAIChannelGroup::setLevelTrigEdge
void setLevelTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the Level trigger edge.
Definition: ADQAIChannelGroup.cpp:525
ADQAIChannelGroup::daqTrigStream
void daqTrigStream()
This method processes Triggered streaming data acquisition.
Definition: ADQAIChannelGroup.cpp:1670
ADQAIChannelGroup
This class handles majority of parameters for correct setup of each data acquisition mode....
Definition: ADQAIChannelGroup.h:88
ADQAIChannelGroup::setExternTrigEdge
void setExternTrigEdge(const timespec &pTimestamp, const int32_t &pValue)
Sets the External trigger edge.
Definition: ADQAIChannelGroup.cpp:587
ADQAIChannelGroup::getChanMask
void getChanMask(timespec *pTimestamp, int32_t *pValue)
Gets the channel mask accordingly to chosen active channels.
Definition: ADQAIChannelGroup.cpp:297
ADQAIChannelGroup::setTimeout
void setTimeout(const timespec &pTimestamp, const int32_t &pValue)
Sets the flush timeout (Triggered streaming mode).
Definition: ADQAIChannelGroup.cpp:657
ADQAIChannelGroup::setLevelTrigLvl
void setLevelTrigLvl(const timespec &pTimestamp, const int32_t &pValue)
Sets the trigger level of Level trigger.
Definition: ADQAIChannelGroup.cpp:511
ADQAIChannelGroup::setChanActive
void setChanActive(const timespec &pTimestamp, const int32_t &pValue)
Sets which channels should be active for data acquisition.
Definition: ADQAIChannelGroup.cpp:283
ADQAIChannelGroup::setDbsBypass
void setDbsBypass(const timespec &pTimestamp, const int32_t &pValue)
Sets if the DBS settings is bypassed (1) or not (0).
Definition: ADQAIChannelGroup.cpp:303
ADQAIChannelGroup::getLevelTrigChan
void getLevelTrigChan(timespec *pTimestamp, int32_t *pValue)
Gets the Level trigger channel.
Definition: ADQAIChannelGroup.cpp:547
ADQAIChannelGroup::setExternTrigThreshold
void setExternTrigThreshold(const timespec &pTimestamp, const double &pValue)
Sets the External trigger treshold.
Definition: ADQAIChannelGroup.cpp:573
streamingHeader_t
This record header structure is used in Triggered streaming DAQ mode.
Definition: ADQAIChannelGroup.h:25
ADQAIChannelGroup::getClockRefOut
void getClockRefOut(timespec *pTimestamp, int32_t *pValue)
Gets the clock reference output.
Definition: ADQAIChannelGroup.cpp:477
ADQAIChannelGroup::ADQAIChannelGroup
ADQAIChannelGroup(const std::string &name, nds::Node &parentNode, ADQInterface *&adqInterface, void *adqCtrlUnit)
ADQAIChannelGroup class constructor.
Definition: ADQAIChannelGroup.cpp:28
ADQAIChannelGroup::m_AIChannelsPtr
std::vector< std::shared_ptr< ADQAIChannel > > m_AIChannelsPtr
Vector of pointers to ADQAIChannel class instances.
Definition: ADQAIChannelGroup.h:114
ADQAIChannelGroup::getExternTrigThreshold
void getExternTrigThreshold(timespec *pTimestamp, double *pValue)
Gets the External trigger treshold.
Definition: ADQAIChannelGroup.cpp:581
ADQAIChannelGroup::getSampleCntMax
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
ADQAIChannelGroup::getInternTrigFreq
void getInternTrigFreq(timespec *pTimestamp, int32_t *pValue)
Gets the Internal trigger frequency.
Definition: ADQAIChannelGroup.cpp:651