123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469 |
- // CCOS.Dev.FPD.PZMedicalDF.cpp: 定义 DLL 的初始化例程。
- //
- #include "pch.h"
- #include "framework.h"
- #include "CCOS.Dev.FPD.PZMedicalDF.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- //
- //TODO: 如果此 DLL 相对于 MFC DLL 是动态链接的,
- // 则从此 DLL 导出的任何调入
- // MFC 的函数必须将 AFX_MANAGE_STATE 宏添加到
- // 该函数的最前面。
- //
- // 例如:
- //
- // extern "C" BOOL PASCAL EXPORT ExportedFunction()
- // {
- // AFX_MANAGE_STATE(AfxGetStaticModuleState());
- // // 此处为普通函数体
- // }
- //
- // 此宏先于任何 MFC 调用
- // 出现在每个函数中十分重要。 这意味着
- // 它必须作为以下项中的第一个语句:
- // 出现,甚至先于所有对象变量声明,
- // 这是因为它们的构造函数可能生成 MFC
- // DLL 调用。
- //
- // 有关其他详细信息,
- // 请参阅 MFC 技术说明 33 和 58。
- //
- // CCCOSDevFPDPZMedicalDFApp
- BEGIN_MESSAGE_MAP(CCCOSDevFPDPZMedicalDFApp, CWinApp)
- END_MESSAGE_MAP()
- // CCCOSDevFPDPZMedicalDFApp 构造
- CCCOSDevFPDPZMedicalDFApp::CCCOSDevFPDPZMedicalDFApp()
- {
- // TODO: 在此处添加构造代码,
- // 将所有重要的初始化放置在 InitInstance 中
- }
- // 唯一的 CCCOSDevFPDPZMedicalDFApp 对象
- CCCOSDevFPDPZMedicalDFApp theApp;
- class CAppSettings;
- CString strAppPath;
- CAppSettings* g_pAcqParam;
- extern CString g_strConfFilePath;
- extern CString g_strHWConfFilePath;
- // CCCOSDevFPDPZMedicalDFApp 初始化
- CString strAppDYNHandleName;
- CString strAppMechCompHandleName;
- CString strAppRFDTHandleName;
- CString strAppDRDTHandleName;
- CString strAppHardwareHandleName;
- CString strAppRFOCHandleName;
- CString g_strLogFilePath;
- CString g_strHWConfFilePath;
- CString g_strConfFilePath;
- BOOL CCCOSDevFPDPZMedicalDFApp::InitInstance()
- {
- CWinApp::InitInstance();
- if (!AfxSocketInit())
- {
- AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
- return FALSE;
- }
- return TRUE;
- }
- //////////////////////////////////////////////////////////////////
- ///
- /// 驱动接口,必须实现
- ///
- //////////////////////////////////////////////////////////////////
- void DRV_Prepare()
- {
- }
- bool DRV_DriverEntry(std::string CfgFileName)
- {
- return true;
- }
- //返回驱动静态资源,如厂商/序列号/等不会变化的常量信息,包括不限于字典等
- std::string DRV_DriverProbe()
- {
- return "";
- }
- //为了保持的一定的兼容性,GUID保留,每个公开的值 参考相关文档
- std::string DRV_GetGUID()
- {
- return "";
- }
- //返回驱动资源,包括各种可能变更的属性、方法等等
- std::string DRV_GetResource()
- {
- return "";
- }
- //返回该驱动下所有设备的静态资源,如序列号、字典等信息
- std::string DRV_DeviceProbe()
- {
- return "";
- }
- bool DRV_OnHeartBeat()
- {
- return true;
- }
- bool DRV_ReLoadConfig()
- {
- return true;
- }
- DEVICE_HANDLE DRV_CreateDevice(int index)
- {
- return nullptr;
- }
- void DRV_FreeDevice(DEVICE_HANDLE)
- {
-
- }
- bool DRV_GetDeviceConfig(std::string& Cfg)
- {
- return true;
- }
- bool DRV_SetDeviceConfig(std::string Cfg)
- {
- return true;
- }
- int DRV_Get(const std::string attrName, std::string& Out)
- {
- return 2;
- }
- int DRV_Set(const std::string attrName, std::string& Out)
- {
- return 2;
- }
- /// XXX 为属性名,可以定义任意多个,每次取一个属性值,等同 DRV_GET(XXX,Out)
- int DRV_Get_XXX(std::string& Out)
- {
- return 2;
- }
- /// XXX 为属性名,可以定义任意多个,每次取一个属性值,等同 DRV_GET(XXX,Out)
- int DRV_Set_XXX(std::string& InOut)
- {
- return 2;
- }
- //////////////////////////////////////////////////////////////////
- ///
- /// 通用设备接口 Part1,必须实现
- ///
- //////////////////////////////////////////////////////////////////
- std::string DEV_GetGUID(DEVICE_HANDLE hDev)
- {
- return "";
- }
- std::string DEV_GetPath(DEVICE_HANDLE hDev)
- {
- return "";
- }
- //这里定义了该设备的模型资源,含属性、方法
- std::string DEV_GetResource(DEVICE_HANDLE hDev)
- {
- return "";
- }
- void DEV_CompleteInit(DEVICE_HANDLE hDev)
- {
- }
- bool DEV_Prepare(DEVICE_HANDLE hDev)
- {
- return true;
- }
- void DEV_CompleteUnInit(DEVICE_HANDLE hDev)
- {
- }
- void DEV_GetSubscribeTopicList(DEVICE_HANDLE hDev, std::vector<string>& TopicList)
- {
- }
- //////////////////////////////////////////////////////////////////
- ///
- /// 通用设备接口 Part2,通用模型化原始接口实现,ADD/DELETE/UPDATE/ACTION/GET/SET
- /// 参考 HTTP RESTFULL,
- /// 驱动可以直接实现此接口,无需额外创建接口,适用任意设备
- /// DEVPath 为设备路径访问接口,直接访问对应设备路径的方法
- /// 各驱动可以根据自己特点,实现一套或者2套,不实现的方法需要返回-2
- //////////////////////////////////////////////////////////////////
- //int DEV_Add(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
- //int DEV_Delete(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
- //int DEV_Update(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
- //int DEV_Action(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
- //int DEV_Get(DEVICE_HANDLE hDev, const std::string funcName, std::string& Out);
- //int DEV_Set(DEVICE_HANDLE hDev, const std::string funcName, std::string In);
- //
- //int DEVPath_Add(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
- //int DEVPath_Delete(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
- //int DEVPath_Update(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
- //int DEVPath_Action(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
- //int DEVPath_Get(const std::string devPath, const std::string funcName, std::string& Out);
- //int DEVPath_Set(const std::string devPath, const std::string funcName, std::string In);
- //////////////////////////////////////////////////////////////////
- ///
- /// 设备模型接口 Part3,各中设备的标准方法
- /// XXX为属性名或者方法名,用于区分行为的Key
- /// 各驱动可以根据自己特点,定义标准方法集合
- //////////////////////////////////////////////////////////////////
- //实现者需要为每一个创建的设备对象定义模型实现,入口参数为设备时创建的对象句柄,需要自行区分对象与方法的对应
- //int DEV_Add_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
- //int DEV_Delete_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
- //int DEV_Update_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
- //int DEV_Action_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
- //int DEV_Get_XXX(DEVICE_HANDLE hDev, std::string& Out);
- //int DEV_Set_XXX(DEVICE_HANDLE hDev, std::string In);
- //实现者需要为每一个逻辑对象的设备路径 定义模型实现,需要自行根据设备路径和 方法进行区分
- //int DEVPath_Add_XXX(const std::string devPath, std::string In, std::string& Out);
- //int DEVPath_Delete_XXX(const std::string devPath, std::string In, std::string& Out);
- //int DEVPath_Update_XXX(const std::string devPath, std::string In, std::string& Out);
- //int DEVPath_Action_XXX(const std::string devPath, std::string In, std::string& Out);
- //int DEVPath_Get_XXX(const std::string devPath, std::string& Out);
- //int DEVPath_Set_XXX(const std::string devPath, std::string In);
- //设备树的模型实现
- //根设备的模型方法一套
- //只有一套接口,就是根设备路径的方法
- int DEVPath_Add_XXX_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Delete_XXX_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Update_XXX_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_XXX_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Get_XXX_(std::string& Out)
- {
- return 2;
- }
- int DEVPath_Set_XXX_(std::string& InOut)
- {
- return 2;
- }
- int DEVPath_Get_CalibrateAllModes_(std::string& Out)
- {
- return 2;
- } //
- //(int& nLogicMode, int& nOffsetIndex);
- int DEVPath_Get_ActiveMode_(std::string& Out)
- {
- return 2;
- }
- //(vector <ZSKK_DETECTOR_MODE_INFO>& vecDetectorMode);
- int DEVPath_Get_LogicModeList_(std::string& Out)
- {
- return 2;
- }
- //Set sequence shot fps
- int DEVPath_Set_SpotFrameRate_(std::string& InOut)
- {
- return 2;
- }
- //Set FLU fps (float fps);
- int DEVPath_Set_FLUFrameRate_(std::string& InOut)
- {
- return 2;
- }
- //Set CINE fps (float fps);
- int DEVPath_Set_CINEFrameRate_(std::string& InOut)
- {
- return 2;
- }
- //(int nmode); (float fps);
- int DEVPath_Set_SetGrabMode_(std::string& InOut)
- {
- return 2;
- }
- //(int nLogicMode, vector <ZSKK_PROTOCOL_OFFSET_INFO>& vecOffsetInfo);
- int DEVPath_Action_GetOffsetInfo_(std::string& Out)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex, ZSKK_CAL_STATUS& modeStatus);
- int DEVPath_Action_GetCalibrationStatus_(std::string& Out)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex, int nSpeed);
- int DEVPath_Action_SetRadOffsetMode_(std::string In, std::string& InOut)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex, float fSpeed);
- int DEVPath_Action_SetFluOffsetMode_(std::string In, std::string& InOut)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex, float fSpeed);
- int DEVPath_Action_SetCinOffsetMode_(std::string In, std::string& InOut)
- {
- return 2;
- }
- int DEVPath_Action_BeginWorkMode_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_EndWorkMode_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_StartGrab_(std::string In, std::string& Out)
- {
- return 2;
- }
- //(int nXRayOnNum = 0);
- int DEVPath_Action_StopGrab_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_ExpEnable_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_ExpDisable_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_FluEnable_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_FluDisable_(std::string In, std::string& Out)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex, int nCalMode);
- int DEVPath_Action_BeginCalibration_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_EnterCalibration_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_ExitCalibration_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_AbortCalibration_(std::string In, std::string& Out)
- {
- return 2;
- }
- //(bool bEn);
- int DEVPath_Action_EnableAutoOffset_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_StartOffsetRefresh_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_StartOffsetCalibration_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_OffsetByUser_(std::string In, std::string& Out)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex);
- int DEVPath_Action_SelectRADMode_(std::string In, std::string& Out)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex);
- int DEVPath_Action_SelectFLUMode_(std::string In, std::string& Out)
- {
- return 2;
- }
- //(int nLogicMode, int nOffsetIndex);
- int DEVPath_Action_SelectCINEMode_(std::string In, std::string& Out)
- {
- return 2;
- }
- int DEVPath_Action_DownloadCorrectionFile2Device_(std::string In, std::string& Out)
- {
- return 2;
- } //
- int DEVPath_Action_ActiveRADMode_(std::string In, std::string& Out)
- {
- return 2;
- } //
- int DEVPath_Action_ActiveFLUMode_(std::string In, std::string& Out)
- {
- return 2;
- } //
- int DEVPath_Action_ActiveCINEMode_(std::string In, std::string& Out)
- {
- return 2;
- } //
- int DEVPath_Action_SetNextStepEvent_(std::string In, std::string& Out)
- {
- return 2;
- } //
|