// 下列 ifdef 块是创建使从 DLL 导出更简单的 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 WHEELDPC_EXPORTS // 符号编译的。在使用此 DLL 的 // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将 // SYNCFPDDPC_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的 // 符号视为是被导出的。 #pragma once #ifndef DEMOSYNCBOX_EXPORTS #ifdef WIN_64BIT #ifdef _DEBUG #pragma comment(lib, "DemoSyncBoxX64D.lib") #else #pragma comment(lib, "DemoSyncBoxX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "DemoSyncBoxD.lib") #else #pragma comment(lib, "DemoSyncBox.lib") #endif #endif #endif #include "DYNHeader.h" #include "Generator_Model_Def.h" #ifdef DEMOSYNCBOX_EXPORTS #define UCB_API __declspec(dllexport) #else #define UCB_API __declspec(dllimport) #endif extern "C" UCB_API DriverDPC* GetDriverDPC(); extern "C" UCB_API void ReleaseDriverDPC(DriverDPC *p); class UCB_API DYNSyncBox : public LogicDriver { std::string *m_pWorkpath; public: DYNSyncBox(void); virtual ~DYNSyncBox(void); ResDataObject m_DeviceConfig; //设备属性 virtual bool DriverEntry(ResDataObject &Configuration); virtual bool Driver_Probe(ResDataObject &HardwareInfo); virtual bool SYSTEM_CALL SetDriverWorkPath(const char * PARAM_IN pWorkPath); virtual PVOID SYSTEM_CALL LoadDriver();//无根节点 virtual void SYSTEM_CALL UnloadDriver(); virtual bool SYSTEM_CALL OnHeartBeat(); //virtual DWORD ReceiveHeartBeat(const char * pRevData, DWORD PacketLength); RET_STATUS SYSTEM_CALL GetDriverDictionary(ResDataObject& PARAM_OUT DriverInfo); virtual bool Connect(); virtual void DisConnect(); //给硬件驱动设置Unique工作路径 //如果是同一设备同一连接情况下,硬件多次接入,系统会保证工作路径是一样的. //连接后,单一硬件相关的数据要保存在此. virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath); //逻辑设备树的加载和卸载 virtual PVOID SYSTEM_CALL LoadLogicDevices(); virtual void SYSTEM_CALL UnloadLogicDevices(); virtual bool Device_Probe(ResDataObject &HardwareInfo); RET_STATUS GetDeviceResource(ResDataObject *pDeviceResource); RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig); RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig); bool SendBySCF(const char * chChannelID, bool bStatus); bool SendSPSBySCF(const char * chChannelID, int nCycle, int nPulse, int nWaitTime); bool SendSPEBySCF(const char * chChannelID, UCHAR cMode, UCHAR cEnable, int nWaitTime); bool SendSMSBySCF(const char * cExpMode, const char *cExpCount, int nWaitTime); /*void start(); void stop();*/ bool SendCANBySCF(int cmdID, unsigned char * cmd, int cmdlen); class OemSeq *m_pSynFPD; class CGenSeq *m_pSynGen; class CCollimaotr *m_pColllimator; //void * m_pNotify; bool m_nInExpState; DWORD m_wStartEXPTime; string CurrentExamMode; int m_nExpTimes; int m_nCurrentExpTimes; int m_nCircleTime; bool m_bINEEnable; private: int ChartoInt(char uc); int CalChecksum(const char * cCmd, int nCmdSize); bool FormatCmd(char *cCmd, int &nSize); bool CmdtoString(const char * cCmd, int nCmdSize, string &strCmd); string GetContentFromString(string &strContent, char ch); int String2Hex(string str); typedef SCF* (*GetSCF)(); GetSCF getSCF; typedef void(*ReleaseSCF)(SCF *p); ReleaseSCF releaseSCF; SCFPacket *m_pSendPacket; SCFPacket *m_pReceivePacket; SCF *m_pSCFInstance; DWORD m_wReceiveTime; ResDataObject ResDYNConfig; DYNHeader_t m_DYNMap; private: HMODULE m_DllFileHandle; ConfigInfo *m_pGenVender; ConfigInfo *m_pGenModel; ConfigInfo *m_pGenSyncType; ConfigInfo *m_pGenSCFType; ConfigInfo *m_pGenSCFPort; };