CareRayAPIDll.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef __CARERAY_API_DLL_530_H__
  2. #define __CARERAY_API_DLL_530_H__
  3. #include "ICallback.h"
  4. #include <map>
  5. using namespace std;
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #ifndef CARERAY_LINUX_VERSION
  10. #ifdef _CARERAY_API_
  11. #define CARERAY_API_PORT __declspec(dllexport)
  12. #else
  13. #define CARERAY_API_PORT __declspec(dllimport)
  14. #endif
  15. #else
  16. #define CARERAY_API_PORT
  17. #endif
  18. // ************************ Common API ************************ //
  19. CARERAY_API_PORT int CR_InitializeLibrary();
  20. CARERAY_API_PORT int CR_DeinitializeLibrary();
  21. CARERAY_API_PORT void CR_GetLastIntlMsg(char* szMsgBuf, int nBufLen, int nErrorCode = -1);
  22. CARERAY_API_PORT int CR_RegisterEventCallback(int nDetrIndex, ICallback* pCallback);
  23. CARERAY_API_PORT int CR_GetConfigItemValue(const char *pItemName, char *pItemValue);
  24. CARERAY_API_PORT int CR_SetConfigItemValue(const char *pItemName, const char *pItemValue);
  25. CARERAY_API_PORT int CR_GetDetectorIndexAndIPAddress(CR_DetrIdxAndIPAddr* pDetrIdxAndIPAddr, int* pDetrNum);
  26. CARERAY_API_PORT int CR_Connect(int nDetrIdx);
  27. CARERAY_API_PORT int CR_Disconnect(int nDetrIdx);
  28. CARERAY_API_PORT int CR_ResetDetector(int nDetrIdx, bool isNeedReboot);
  29. CARERAY_API_PORT int CR_GetSystemInformation(int nDetrIdx, CR_SystemInfo* pSystemInformation);
  30. CARERAY_API_PORT int CR_GetApplicationMode(int nDetrIdx, CR_ModeInfo* pModeInfo, int* pModeNum);
  31. CARERAY_API_PORT int CR_RegisterApplicationMode(int nDetrIdx, int nAppModeKey, int nModeID, float *pFrameRate, float *pExposureTime, int nTriggType, int nGainType, int nRowIdx = 0, int nColumnIdx = 0);
  32. CARERAY_API_PORT int CR_SetFrameFilter(int nDetrIdx, int nAppModeKey, const char *pFrameFilter);
  33. CARERAY_API_PORT int CR_GetModeInfoByAppModeKey(int nDetrIdx, int nAppModeKey, CR_ModeInfo *pModeInfo);
  34. CARERAY_API_PORT int CR_LoadReference(int nDetrIdx, int nAppModeKey);
  35. CARERAY_API_PORT int CR_UnloadReference(int nDetrIdx, int nAppModeKey);
  36. CARERAY_API_PORT int CR_StartAcquisition(int nDetrIdx, int nAppModeKey, void* pBuffer, int nBuffSize, int nNumFrmReqFromDetr = -1);
  37. // nNumFrmReqFromDetr == -1 means that detector sends out frames continuously until StopAcquisition() is received.
  38. CARERAY_API_PORT int CR_StartAcquisitionWithCorrOpt(int nDetrIdx, int nAppModeKey, void* pBuffer, int nBuffSize, unsigned int uCorrOpt);
  39. // Only for rad
  40. CARERAY_API_PORT int CR_StartDarkAcquisition(int nDetrIdx, int nAppModeKey, int nNumFrmReqFromDetr = -1);
  41. // Only for rad
  42. CARERAY_API_PORT int CR_StartDarkAcquisitionWithCorrOpt(int nDetrIdx, int nAppModeKey, unsigned int uCorrOpt);
  43. CARERAY_API_PORT int CR_StopAcquisition(int nDetrIdx);
  44. CARERAY_API_PORT int CR_GetAcquisitionStatInfo(int nDetrIdx, struct CR_AcquisitionStatInfo* pStatInfo);
  45. CARERAY_API_PORT int CR_QueryAcquisitionStatus(int nDetrIdx, CR_ExpProgress* pExpProg);
  46. CARERAY_API_PORT int CR_QueryAedExposureProgress(int nDetrIdx, CR_AedExpProgress* pExpProg);
  47. CARERAY_API_PORT int CR_RequestExposure(int nDetrIdx);
  48. CARERAY_API_PORT int CR_PermitExposure(int nDetrIdx);
  49. CARERAY_API_PORT int CR_GetImage(int nDetrIdx, void* pImage, size_t nBuffLen, int nWaitMs = 9000);
  50. CARERAY_API_PORT int CR_GetNoHeaderImage(int nDetrIdx, void* pImage, size_t nBuffLen, int nWaitMs = 9000);
  51. // only for rad
  52. CARERAY_API_PORT int CR_GetPreviewImage(int nDetrIdx, void* pImage, size_t nBuffLen, int nWaitMs = 9000);
  53. CARERAY_API_PORT int CR_StartDarkCalibration(int nDetrIdx, int nAppModeKey, bool isTradCalib = true, bool isUpdateDefectMap = false);
  54. CARERAY_API_PORT int CR_StartGainCalibration(int nDetrIdx, int nAppModeKey);
  55. CARERAY_API_PORT int CR_StopCalibration(int nDetrIdx);
  56. CARERAY_API_PORT int CR_QueryCalibrationStatus(int nDetrIdx, CR_CalibrationInfo* pCalProgInfo);
  57. CARERAY_API_PORT int CR_QueryReferenceStatus(int nDetrIdx, int nAppModeKey, CR_RefStatusInfo* pRefStatusInfo);
  58. CARERAY_API_PORT int CR_GetDefectInfo(const int nDetrIdx, const int nAppModeKey, CR_DefectInfo *pDefectInfo);
  59. CARERAY_API_PORT int CR_GetDetrStatus(int nDetrIdx, CR_DetrStatus* pDetrStatus);
  60. CARERAY_API_PORT int CR_GetConnectionStatus(int nDetrIdx, CR_ConnectionStatus *pStatus);
  61. CARERAY_API_PORT int CR_GetDaecActiveAreas(int nDetrIdx, CR_ActiveAreaInfo *pActiveAreasArray, int *pActiveAreasNum, int *pThreshold, int nAppModeKey);
  62. CARERAY_API_PORT int CR_SetDaecActiveAreas(int nDetrIdx, CR_ActiveAreaInfo *pActiveAreasArray, int nActiveAreasNum, int nThreshold, int nAppModeKey);
  63. // ********************* YosemiteView API ********************* //
  64. CARERAY_API_PORT int CR_Nudge(int nDetrIdx);
  65. CARERAY_API_PORT int CR_SetWorklist(int nDetrIdx, CR_Examination* pExaminations, int nTotalNum);
  66. CARERAY_API_PORT int CR_GetWorklist(int nDetrIdx, int* pExamNum, CR_Examination* pExaminations);
  67. CARERAY_API_PORT int CR_ClearWorklist(int nDetrIdx);
  68. CARERAY_API_PORT int CR_GetInnerStoredImage(int nDetrIdx, void* pImage, size_t nBuffLen, const char* pFileName, int nWaitMs = 9000);
  69. CARERAY_API_PORT int CR_SetPowerMode(int nDetrIdx, CR_PowerModeID nModeID);
  70. CARERAY_API_PORT int CR_GetBatteryInfos(int nDetrIdx, CR_BatteryInfo* pBatteryArray, int* pValidBatteryNum);
  71. CARERAY_API_PORT int CR_GetWirelessStatus(int nDetrIdx, CR_WirelessStatus* pWirelessStatus);
  72. // ************************* JSON API ************************* //
  73. // New interface: simplify acquisition and calibration
  74. // Get all support application modes in JSON format
  75. CARERAY_API_PORT void CR_GetApplicationModeInJson(int nDetrIdx, char *pResultBuffer);
  76. // Register custom modes from configuration file
  77. CARERAY_API_PORT void CR_RegisterCustomModeFromConfigFile(int nDetrIdx, char *pResultBuffer);
  78. // Generate sample configuration file for custom modes
  79. CARERAY_API_PORT void CR_GenerateSampleCustomModeConfigFile(int nDetrIdx);
  80. // Get acquisition progress in JSON format - rad mode only
  81. CARERAY_API_PORT void CR_GetAcquisitionProgressInJson(int nDetrIdx, char *pResultBuffer);
  82. // Get calibration progress in JSON format
  83. CARERAY_API_PORT void CR_GetCalibrationProgressInJson(int nDetrIdx, char *pResultBuffer);
  84. CARERAY_API_PORT void CR_GetModeInfoByAppModeKeyInJson(int nDetrIdx, int nAppModeKey, char *pResultBuffer);
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif