📄 daseq32.h
字号:
#ifndef ___DASEQ32_H
#define ___DASEQ32_H
#include <lvdef.h>
#include <dsapp.h>
#include <daseq32.ah>
#include <lvintq.h>
#define _MaxSeqGrabber 8
/** Daisy Application Library - Image Sequencer.
* The DsyApp_Seq32 class represents the Image Sequencer DRAL.
* It derives from the LvDsyApplication class and uses the DaSeq32Cfg
* structure for configuration.
*/
LVDSYCLASS DsyApp_Seq32 : public LvDsyApplication {
protected:
BOOL EmptyEvent;
BOOL Compiled;
BOOL IsRXL;
BOOL IsPKX;
BOOL IsPPC;
BOOL IsH8;
BOOL IsStereo;
BOOL IsPMC;
BOOL IsLvCam;
U32BIT VideoType;
U32BIT ScanMode;
int NrGrabber;
U32BIT Switch;
U32BIT CfgIndex;
U32BIT Flags;
BOOL IsLineScan;
virtual char *GetModuleName(void) { return ""; }
virtual void InitRPSVars(void);
virtual U32BIT GetModuleType(void);
#ifdef __UNIX__
void AddToIrqRequest(BOOL Add=TRUE);
#endif
virtual BOOL IsInterlaced(void) { return ScanMode==Scn_Interlaced; }
virtual BOOL IsMonochrome(void) { return VideoType==VT_Mono; }
virtual LVSTATUS CheckExtEventMap(void *CfgBuffer);
// Base dral
RPSVariable ExtEvent;
RPSVariable FlowCtrlMode;
RPSVariable RestartSeq;
LVRAWPTR ImgInfoPagePtr;
LvAcquiredImageInfo ImgInfo;
public:
DsyApp_Seq32(void);
#ifdef __UNIX__
virtual ~DsyApp_Seq32(void);
#endif
/** Returns the number of images in the sequence.
* In the DaSeq32Cfg::NrImages field of the DaSeq32Cfg configuration structure, the
* user application set the desired number of images.\n
* Depending on the size of the target buffer specified in the Target field or
* the positioning limits imposed in the fields \a StartX, \a StartY, \a EndX and
* \a EndY fields and the relative flag settings, the number of actual images in
* the sequence can be less than the desired.\n
* The user application can use this function to get back the actual number of
* images in the sequence.
* @return The number of images in the sequence allowed by the parameter settings.
*/
U16BIT GetNrImages(void);
/** Gets the offset in the buffer of the requested image.
* This function retrieves the offset in bytes from the beginning of the
* acquisition buffer for the specified image.
* @param ImageNr Index of the image for which retrieve the offset
* @return Offset in bytes of the specified image
*/
U32BIT GetImageOffset(U16BIT ImageNr);
/** Gets the location of the individual color planes.
* Use this function to retrieve and store the offsets of the color components
* (planes) in respect to the base address of the acquired image.
* @param ROffset offset for red plane
* @param GOffset offset for green plane
* @param BOffset offset for blue plane
* @return one of the @ref ErrorDefinitions values
*/
LVSTATUS GetRGBImageOffsets(U32BIT *ROffset, U32BIT *GOffset, U32BIT *BOffset);
/** Determines which image is being acquired.
* Query function to get back the index of the image being acquired.
* @return Index of the image being acquired; the first image has index 0
*/
U16BIT GetCurrentImage(void);
/** Gets the index of the last acquired image in the sequence.
* Use it to obtain the index of the last acquired image in the sequence
* @return index of the last acquired image in the sequence
*/
U16BIT GetLastAcquiredImage(void);
/** Gets the coordinates of the requested image.
* Retrieves the image coordinates of the specified image in the target buffer.
* These coordinates can then be used to retrieve the images from the target
* buffer.
* @param ImageNr Index of the image for which retrieve the coordinates
* @param StartX X coordinate in pixels inside the target buffer.
* @param StartY Y coordinate in lines inside the target buffer
* @return \b TRUE if the coordinates could be successfully retrieved, otherwise \b FALSE.
*/
BOOL GetImageCoord(U16BIT ImageNr, U32BIT *StartX, U32BIT *StartY);
/** Retrieves the actual buffer base pointer.
* This method unifies the way to collect the buffer base address
* independent from the board type being used for acquisition. Application
* should use this method instead of directly accessing the
* LvROI::BaseAddress field. This ensures the consistency and validity of
* the retrieved pointer, even in case the buffer needs special driver
* handling, for example for PicProdigy boards.
* @return The current pointer to the buffer for image acquisition used by the
* Sequencer Dral object.
*/
U8BIT *GetBufferBaseAddress(void);
/** Gets the currently acquired image and line number.
* Returns the state of the frame acquisition. It could be used for monitoring
* how far the frame acquisition is in the frame.
* @note Valid for area and line scan cameras.
* @param Img pointer to DWORD where will be saved currently acquired image
* @param Line pointer to DWORD where will be saved currently acquired line
*/
LVSTATUS GetCurrentImageLine(U32BIT *Img, U32BIT *Line);
/*? Determines which line is being acquired.
* Query function to get back the current acquired line in the current frame.\n
* Note that the acquired line is being acquired by the framegrabber,
* therefore not yet available to the application in the target memory.
* @return The line number currently delivered by the camera. the first line has index zero
*/
U32BIT GetCurrentSrcLine(void);
/** Locking the image in the queue.
* Provides locking mechanism to prevent acquired image from overwritten until the
* user application handle it, uses it and unlock it.\n
* @sa SqFlg_AutoLockFrame
* @param ImgNr index of image in the queue
* @return \b DSY_I_NoError if the image is locked, otherwise one of the @ref ErrorDefinitions values.
*/
LVSTATUS LockImage(U16BIT ImgNr);
/** Unlocks the previously locked image in the queue.
* Provides unlocking mechanism to make possible of acquiring new image and write its data to this image
* @sa SqFlg_AutoLockFrame
* @param ImgNr index of image in the queue
* @return \b DSY_I_NoError if the image is locked, otherwise one of the @ref ErrorDefinitions values
*/
LVSTATUS UnlockImage(U16BIT ImgNr);
/** Checks if the image is locked.
* Allows to find out the lock status for each image.
* @param ImgNr index of the image in the queue
* @return \b TRUE if the image is locked, otherwise \b FALSE
*/
BOOL IsImageLocked(U16BIT ImgNr);
/* dont document */
virtual U32BIT GetModuleCfgIndex(void);
/* dont document */
virtual void SetModuleCfgIndex(U32BIT aCfgIndex);
/** Starts a sequence acquisition.
* Starts the acquisition of the sequence defined in the DaSeq32Cfg
* configuration structure previously activated.\n
* If the SeqType field is set to SqType_OneSeq, the acquisition is
* terminated after the acquisition of the last image, therefore there is no
* need to call the Stop() command.
* @return \b DSY_I_NoError if the acquisition is started successfully, otherwise one
* of the @ref ErrorDefinitions values.
*/
virtual LVSTATUS Start(void);
/** Stops a sequence acquisition.
* Stops a sequence started with the Start() function.\n
* This command has to be used to stop an acquisition when the
* SeqType field is set to SqType_Continuous.\n
* \n
* If the \a SeqType field is set to \a SqType_OneSeq, the acquisition is
* terminated after the acquisition of the last image, therefore there is no
* need to call the Stop() command.\n
* \n
* Issuing this command has no effect when no acquisition is in progress.
* @return \a DSY_I_NoError if the acquisition is stopped successfully, otherwise
* one of the @ref ErrorDefinitions values.
* @sa Start(), Pause(), Continue(), IsPaused(), IsRunning()
*/
virtual LVSTATUS Stop(void);
/** Pauses a sequence acquisition.
* Pauses the acquisition of the sequence currently activated at the next
* checkpoint. This command has effect only if the \a FlowCheck field is set to
* a value different from \a SqFlowChk_None.
* @returns \a DSY_I_NoError if the continue flag changed state otherwise
* \a DSY_W_RPS_PauseAlreadySet, meaning the continue flag was already
* reset.
* @sa Start(), Stop(), Continue(), IsPaused(), IsRunning()
*/
virtual LVSTATUS Pause(void);
/** Continues a sequence acquisition previously paused.
* Continues the acquisition of the sequence currently activated and
* previously paused. If the Pause() command was previously issued but the
* acquisition did not reach any checkpoint, the pause command is ignored.\n
* This command has effect only if the \a FlowCheck field is set to a value
* different from \a SqFlowChk_None.
* @return \a DSY_I_NoError if the continue flag changed state otherwise
* \a DSY_W_RPS_ContinueAlreadySet, meaning the Continue flag was
* already set.
* @sa Start(), Stop(), Pause(), IsPaused(), IsRunning()
*/
virtual LVSTATUS Continue(void);
/** Initialization procedure for the DRAL.
* Starts the Sequencer Dral initialization procedure. This function should
* always be called after DRAL activation, and in any case, before any
* Start() command.
* @return @ref ErrorDefinitions
*/
virtual LVSTATUS Init(void);
/** Determines if the sequencer is active.
* Use this function to determine whether the acquisition is still active. Note
* that this function returns \b TRUE even when the Sequencer Dral is not
* actually acquiring but waiting for an external event or a Continue() from
* the application. Use IsPaused() to determine this condition.\n
* When the \a SqType_Continuous flag is specified in the \a SeqType field of
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -