#pragma once #ifndef ACQUNITLOGIC_EXPORTS #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "AcqUnitLogicX64D.lib") #else #pragma comment(lib, "AcqUnitLogicX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "AcqUnitLogicD.lib") #else #pragma comment(lib, "AcqUnitLogic.lib") #endif #endif #endif #define PARAM_IN_TYPE #ifdef ACQUNITLOGIC_EXPORTS #define ACQUNITLOGIC_API __declspec(dllexport) #else #define ACQUNITLOGIC_API __declspec(dllimport) #endif #include"LogicDevice.h" #include"DIOSLogicDeviceStructure.h" #include"ShareMemClientInterface.h" typedef enum _GAIN_Mode { GAIN_ORIG, GAIN_2, GAIN_4, GAIN_8 }GAIN_MODE; typedef enum _ZOOM_Mode { ZOOM_ORIG, ZOOM_2, ZOOM_3, ZOOM_4 }ZOOM_MODE; typedef enum _BINNING_Mode { BINNING_ORIG, BINNING_2_2, BINNING_3_3, BINNING_4_4 }BINNING_MODE; class ACQUNITLOGIC_API AcqUnitLogic : public LogicDevice { private: BaseJsonDataObject* m_State; BaseJsonDataObject* m_AppMode; BaseJsonDataObject* m_ExamMode; BaseJsonDataObject* m_GainMode; BaseJsonDataObject* m_ZoomMode; BaseJsonDataObject* m_BinningMode; BaseJsonDataObject* m_ImgId; ImgInfoDef* m_FullImg; ImgInfoDef* m_PreviewImg; WORD*m_pDataPtr; WORD *m_pImgBuffer; unsigned int m_DE_Seq_ExpCount; bool m_bReqImage; unsigned long long m_nFrameId; ImgDataInfo* m_ImgDataInfo; CShareMemClient m_shareMemclient; C2DGrayImageData *m_pImgFull; C2DGrayImageData *m_pImgPrev; CBaseFunctionDataElement *m_pElement; unsigned long long m_dwShareMemIdFull; unsigned long long m_dwShareMemIdPreview; char m_chLog[512]; public: AcqUnitLogic(void); virtual ~AcqUnitLogic(void); //get device type virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType); //get device resource virtual RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource); //ResourceCommand Request In and Response Out virtual RET_STATUS SYSTEM_CALL Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse); //notify to lower layer virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd); //errors,warnings void SetErrorInfo(int errCode, char *pErrInfo); void SetWarningInfo(int warningCode, char *pWarningInfo); private://data层内部使用 int RegShareMem(); bool UnRegShareMem(); bool GetShareMemBuf( IMAGE_VIEW_TYPE eType, std::wstring strBufName, UINT32 nWidth, UINT32 nHeight, UINT32 nBit, unsigned long long nFrameId); int WriteImageToShareMem(unsigned long long &dwShareMemId); public://Data层实现,Owner virtual bool DEVICE_SUPPORT Support_GetFullImgDimension(); virtual bool DEVICE_SUPPORT Support_GetPreviewDimension(); virtual bool DEVICE_SUPPORT Support_GetAppMode(); virtual bool DEVICE_SUPPORT Support_SetAppMode(); virtual bool DEVICE_SUPPORT Support_GetExamMode(); virtual bool DEVICE_SUPPORT Support_SetExamMode(); virtual bool DEVICE_SUPPORT Support_SetImgID(); virtual bool DEVICE_SUPPORT Support_GetImgID(); virtual bool DEVICE_SUPPORT Support_GetSEQResource(); virtual bool DEVICE_SUPPORT Support_FramePostState(); virtual bool DEVICE_SUPPORT Support_FramePrepState(); virtual bool DEVICE_SUPPORT Support_SeqPrepState(); virtual bool DEVICE_SUPPORT Support_SeqPostState(); virtual bool DEVICE_SUPPORT Support_FrameError(); //for the Aepx RF Detector virtual bool DEVICE_SUPPORT Support_FetchFrame(); RET_STATUS DATA_ACTION FrameErrState(); RET_STATUS DATA_ACTION FramePrepState(); RET_STATUS DATA_ACTION FramePostState(); RET_STATUS DATA_ACTION SeqPrepState(); RET_STATUS DATA_ACTION SeqPostState(); RET_STATUS DATA_ACTION GetSEQResource(ResDataObject*res); RET_STATUS DATA_ACTION DTL_FetchFrame(IMAGE_VIEW_TYPE nType, void PARAM_IN PARAM_OUT** pImage , unsigned int PARAM_IN nWidth, unsigned int PARAM_IN nHeight, unsigned int PARAM_IN nBit); RET_STATUS DATA_ACTION GetFullImgDimension(ImgInfoDef PARAM_OUT& ImgSt); RET_STATUS DATA_ACTION GetPreviewDimension(ImgInfoDef PARAM_OUT&ImgSt); RET_STATUS DATA_ACTION GetAppMode(unsigned int PARAM_OUT&AppMode); RET_STATUS DATA_ACTION SetAppMode(unsigned int PARAM_IN AppMode); RET_STATUS DATA_ACTION GetExamMode(unsigned int PARAM_OUT&ExamMode); RET_STATUS DATA_ACTION SetExamMode(unsigned int PARAM_IN ExamMode); RET_STATUS DATA_ACTION SetImgID(unsigned long long PARAM_IN ImgId); RET_STATUS DATA_ACTION GetImgID(unsigned long long PARAM_IN &ImgId); public://Data实现,OEM使用 RET_STATUS DATA_ACTION SetFullImgInfo(unsigned int PARAM_IN nWidth, unsigned int PARAM_IN nHeight, unsigned int PARAM_IN nBit); RET_STATUS DATA_ACTION SetPreviewImgInfo(unsigned int PARAM_IN nWidth, unsigned int PARAM_IN nHeight, unsigned int PARAM_IN nBit); RET_STATUS DATA_ACTION SeqStateNotify(string sState,bool bValue); RET_STATUS DATA_ACTION SetState(unsigned int nState); RET_STATUS DATA_ACTION SetPanelPrepare(bool bRet);//send seqpre state RET_STATUS DATA_ACTION SetPanelReady(bool bRet);//send seqpost state RET_STATUS DATA_ACTION SendFramePost(bool bRet);//send seqpost state RET_STATUS DATA_ACTION SetError(unsigned int nErrorCode); void LogInfo(string string); void LogWarn(string string); void LogError(string string); bool SendImageInfo(IMAGE_VIEW_TYPE eType, unsigned long long dwShareMemId, unsigned long long nImageId);//为了RF!!! public://OEM重写,需要调用基类对应的函数 virtual bool DEVICE_SUPPORT Support_GetFrame(); virtual bool DEVICE_SUPPORT Support_ImageNotify(); virtual bool DEVICE_SUPPORT Support_Preview(); virtual bool DEVICE_SUPPORT Support_GetGainMode(); virtual bool DEVICE_SUPPORT Support_SetGainMode(); virtual bool DEVICE_SUPPORT Support_GetZoomMode(); virtual bool DEVICE_SUPPORT Support_SetZoomMode(); virtual bool DEVICE_SUPPORT Support_GetBinningMode(); virtual bool DEVICE_SUPPORT Support_SetBinningMode(); virtual RET_STATUS DATA_ACTION Reset() = 0; virtual RET_STATUS DATA_ACTION BeginWorkMode() = 0; virtual RET_STATUS DATA_ACTION EndWorkMode() = 0; virtual RET_STATUS DATA_ACTION SetExpEnable(bool bEnable) = 0; virtual RET_STATUS DATA_ACTION SetFrameErrNotify(bool bEnable); virtual RET_STATUS DATA_ACTION ImageNotify(IMAGE_VIEW_TYPE nType); virtual RET_STATUS DEVICE_ACTION GetFrame(IMAGE_VIEW_TYPE nType, void PARAM_IN PARAM_OUT* pOemImage, unsigned int PARAM_OUT &nWidth, unsigned int PARAM_OUT &nHeight); virtual RET_STATUS DEVICE_ACTION FetchFrame(IMAGE_VIEW_TYPE nType, void PARAM_IN PARAM_OUT** pOemImage, unsigned int PARAM_OUT &nWidth, unsigned int PARAM_OUT &nHeight); virtual RET_STATUS DEVICE_ACTION FetchFrame(IMAGE_VIEW_TYPE nType, unsigned long long &shareMemId); virtual RET_STATUS DEVICE_ACTION GetGainMode(unsigned int PARAM_OUT &GainMode); virtual RET_STATUS DEVICE_ACTION SetGainMode(unsigned int PARAM_IN GainMode); virtual RET_STATUS DEVICE_ACTION GetZoomMode(unsigned int PARAM_OUT &ZoomMode); virtual RET_STATUS DEVICE_ACTION SetZoomMode(unsigned int PARAM_IN ZoomMode); virtual RET_STATUS DEVICE_ACTION GetBinningMode(unsigned int PARAM_OUT &BinningMode); virtual RET_STATUS DEVICE_ACTION SetBinningMode(unsigned int PARAM_IN BinningMode); public: };