Pleora Technologies Inc. eBUS SDK v7.0.1.7536 API



PvStreamingChannelSourceTrigger.h
1 // *****************************************************************************
2 //
3 // Copyright (c) 2022, Pleora Technologies Inc., All rights reserved.
4 //
5 // *****************************************************************************
6 
7 #ifndef __PVSTREAMINGCHANNELSOURCETRIGGER_H__
8 #define __PVSTREAMINGCHANNELSOURCETRIGGER_H__
9 
10 #include <map>
11 #include <memory>
12 #include <vector>
13 
14 #include <PvTriggerSelector.h>
15 #include <IPvSemaphore.h>
16 #include <PvSoftDeviceGEVInterfaces.h>
17 #include <PvSoftDeviceGEVLib.h>
18 
19 #define TRIGGERSELECTOR_ADDRESS( base, channel ) ( base + 0x0 + ( 0x80 * ( channel ) ) )
20 #define TRIGGERMODE_ADDRESS( base, channel ) ( base + 0x4 + ( 0x80 * ( channel ) ) )
21 #define TRIGGERSOURCE_ADDRESS( base, channel ) ( base + 0x8 + ( 0x80 * ( channel ) ) )
22 #define TRIGGERSOFTWARE_ADDRESS( base, channel ) ( base + 0xc + ( 0x80 * ( channel ) ) )
23 
25 enum TriggerSelectorEnum
26 {
28  TRIGGER_SELECTOR_FRAMESTART = 0,
30  TRIGGER_SELECTOR_ACQUISITIONSTART,
32  TRIGGER_SELECTOR_ACQUISITIONEND,
34  TRIGGER_SELECTOR_ACQUISITIONACTIVE,
36  TRIGGER_SELECTOR_FRAMEBURSTSTART,
38  TRIGGER_SELECTOR_FRAMEBURSTEND,
40  TRIGGER_SELECTOR_FRAMEBURSTACTIVE,
42  TRIGGER_SELECTOR_FRAMEEND,
44  TRIGGER_SELECTOR_FRAMEACTIVE,
46  TRIGGER_SELECTOR_LINESTART,
48  TRIGGER_SELECTOR_EXPOSURESTART,
50  TRIGGER_SELECTOR_EXPOSUREEND,
52  TRIGGER_SELECTOR_EXPOSUREACTIVE,
54  TRIGGER_SELECTOR_LAST = TRIGGER_SELECTOR_EXPOSUREACTIVE
55 };
56 
58 enum TriggerModeEnum
59 {
61  TRIGGER_MODE_OFF = 0,
63  TRIGGER_MODE_ON = 1
64 };
65 
67 enum TriggerSourceEnum
68 {
70  TRIGGER_SOURCE_SOFTWARE = 0,
72  TRIGGER_SOURCE_USER = 1
73 };
74 
75 
76 class IPvTriggerSelector;
77 
86 
87 class PV_SOFT_DEVICE_GEV_API IPvTriggerCallback
88 {
89 public:
90 
98  virtual void TriggerCallbackMethod( const IPvTriggerSelector *aTriggerSelector ) = 0;
99 
103  virtual ~IPvTriggerCallback() {}
104 };
105 
113 class PV_SOFT_DEVICE_GEV_API PvStreamingChannelSourceTrigger
115  , public IPvRegisterEventSink
116 {
117 public:
119 
126  PvStreamingChannelSourceTrigger( uint32_t mChannel, uint32_t aRegisterBaseAddress );
128 
130 
138  virtual void OnStreamingStart();
146  virtual void OnStreamingStop();
147 
155  virtual bool PreQueueBufferProc() final;
156 
162  virtual void PostRetrieveBufferProc();
163 
170  virtual void CreateRegisters( IPvRegisterMap *aRegisterMap, IPvRegisterFactory *aFactory );
171 
178  virtual void CreateGenApiFeatures( IPvRegisterMap *aRegisterMap, IPvGenApiFactory *aFactory );
179 
186  PvResult GetTxNumBuffersToUse( uint32_t &aNumBuffer )
187  {
188  aNumBuffer = 0;
190  }
191 
192  // IPvRegisterEventSink interface.
201  virtual PvResult PreRead( IPvRegister *aRegister );
202 
211  virtual PvResult PreWrite( IPvRegister *aRegister );
212 
222  virtual PvResult Persist( IPvRegister *aRegister, IPvRegisterStore *aStore );
223 
224  // Local interface.
228  virtual void FireTrigger() const;
229 
236  void AddSelector( TriggerSelectorEnum aIndex, SelectorEntry aSelector );
237 
244  void AddSelectorTriggerCallback( TriggerSelectorEnum aIndex, IPvTriggerCallback *aCallback );
245 
252  void AddSource( uint32_t aIndex, const PvString &aName );
253 
259  bool GetMode() const;
260 
266  uint32_t GetSource() const;
267 
268 protected:
269 
276  virtual void CreateTriggerSelector( IPvRegisterMap *aRegisterMap, IPvGenApiFactory *aFactory );
277 
284  virtual void CreateTriggerMode( IPvRegisterMap *aRegisterMap, IPvGenApiFactory *aFactory );
285 
292  virtual void CreateTriggerSource( IPvRegisterMap *aRegisterMap, IPvGenApiFactory *aFactory );
293 
300  virtual void CreateTriggerSoftware( IPvRegisterMap *aRegisterMap, IPvGenApiFactory *aFactory );
301 
302 private:
303 
304  void SetSelector( uint32_t aIndex );
305  void SetMode( uint32_t aMode );
306  void SetSource( uint32_t aIndex );
307  void SyncAll();
308  bool IsSourceSoftware( uint32_t aIndex ) const;
309 
317  PvResult PersistByTriggerSelector( IPvRegister *aRegister, IPvRegisterStore *aStore );
318 
319  uint32_t mChannel;
320  uint32_t mRegisterBaseAddress;
321 
322  uint32_t mSourceIndex;
323  std::map<uint32_t, std::string> *mSources;
324  std::map<uint32_t, SelectorEntry> *mSelectors;
325  IPvTriggerCallback *mSelectorCallback;
326  IPvTriggerSelector *mDoNothing;
327 
328  uint32_t mCurrentSelector;
329  IPvTriggerSelector *mSelector;
330  IPvSemaphore *mTrigSem;
331 };
332 
333 
334 #endif // __PVSTREAMINGCHANNELSOURCETRIGGER_H__
PvResult
Result information.
Definition: PvResult.h:29
IPvSWStreamingChannelSource
Definition: PvSoftDeviceGEVInterfaces.h:64
IPvRegisterEventSink::PreWrite
virtual PvResult PreWrite(IPvRegister *aRegister)
Pre-write register notification.
Definition: PvVirtualDeviceGEVInterfaces.h:1772
IPvRegisterMap
Register map interface for a software-based GigE Vision Device.
Definition: PvVirtualDeviceGEVInterfaces.h:1909
IPvStreamingChannelSource::OnStreamingStop
virtual void OnStreamingStop()=0
Notification that the GigE Vision controller has requested that the device stop streaming on this cha...
IPvGenApiFactory
GenApi factory used to add custom GenApi parameters to a software-based GigE Vision Device GenICam XM...
Definition: PvVirtualDeviceGEVInterfaces.h:2024
IPvStreamingChannelSource::OnStreamingStart
virtual void OnStreamingStart()=0
Notification that the GigE Vision controller has requested that the device start streaming on this ch...
PvStreamingChannelSourceTrigger
Trigger-capable streaming source implementing IPvSWStreamingChannelSource.
Definition: PvStreamingChannelSourceTrigger.h:113
PvString
String class.
Definition: PvString.h:25
IPvTriggerSelector
Interface used by PvStreamingChannelSourceTrigger to support a trigger mechanism.
Definition: PvTriggerSelector.h:19
IPvRegisterFactory
Class used for register creation.
Definition: PvVirtualDeviceGEVInterfaces.h:1835
IPvRegister
Interface that is used to access the registers of the software-based GigE Vision Device.
Definition: PvVirtualDeviceGEVInterfaces.h:1470
IPvStreamingChannelSource::CreateRegisters
virtual void CreateRegisters(IPvRegisterMap *aRegisterMap, IPvRegisterFactory *aFactory)
When called, the streaming channel source should create its custom registers if they are needed.
Definition: PvVirtualDeviceGEVInterfaces.h:1193
IPvRegisterEventSink::PreRead
virtual PvResult PreRead(IPvRegister *aRegister)
Pre-read register notification.
Definition: PvVirtualDeviceGEVInterfaces.h:1731
IPvTriggerCallback::~IPvTriggerCallback
virtual ~IPvTriggerCallback()
Virtual destructor.
Definition: PvStreamingChannelSourceTrigger.h:103
IPvSemaphore
Interface for a semaphore object used for synchronization.
Definition: IPvSemaphore.h:18
PvResult::Code::NOT_IMPLEMENTED
@ NOT_IMPLEMENTED
The requested feature or functionality is not implemented.
Definition: PvResult.h:340
IPvStreamingChannelSource::CreateGenApiFeatures
virtual void CreateGenApiFeatures(IPvRegisterMap *aRegisterMap, IPvGenApiFactory *aFactory)
When called, the streaming channel source should create its custom GenApi parameters if they are need...
Definition: PvVirtualDeviceGEVInterfaces.h:1259
IPvRegisterStore
Class used with register persistence in the context of user-sets.
Definition: PvVirtualDeviceGEVInterfaces.h:1659
IPvTriggerCallback
An interface which provides a trigger callback function.
Definition: PvStreamingChannelSourceTrigger.h:87
IPvRegisterEventSink
Interface that is used to report the register activity of the software-based GigE Vision Device.
Definition: PvVirtualDeviceGEVInterfaces.h:1701
IPvRegisterEventSink::Persist
virtual PvResult Persist(IPvRegister *aRegister, IPvRegisterStore *aStore)
Peristence request for selected registers for user-sets.
Definition: PvVirtualDeviceGEVInterfaces.h:1817
PvStreamingChannelSourceTrigger::GetTxNumBuffersToUse
PvResult GetTxNumBuffersToUse(uint32_t &aNumBuffer)
Disabled transmitter buffer count query.
Definition: PvStreamingChannelSourceTrigger.h:186

Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com