IRayAuthDef.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * File: iRayAuthDef.h
  3. *
  4. * Purpose: Define function Authorities for iRay products.
  5. *
  6. * @author Haitao.Ning
  7. * @version 1.0 2022/06/06
  8. *
  9. * Copyright (C) 2022, iRay Technology (Shanghai) Ltd.
  10. *
  11. */
  12. #pragma once
  13. /**
  14. * Enm_LicenseKeyMode: Enumerate the bind key mode in license file
  15. */
  16. enum Enm_LicenseKeyMode
  17. {
  18. Enm_LicenseKeyMode_Null = 0, // No H/W bind
  19. Enm_LicenseKeyMode_PCID = 1, // Bind Computer
  20. Enm_LicenseKeyMode_UserCode = 2, // Deprecated
  21. Enm_LicenseKeyMode_DetSN = 3, // Bind DetectorSN
  22. Enm_LicenseKeyMode_BatchID = 4, // Bind DetectorBatchID
  23. };
  24. #pragma pack(push, 1)
  25. struct IRayAuthority
  26. {
  27. int nSdkAuth; // 32 bit for SDK functions
  28. int nAlgAuth; // 32 bit for Algorithm functions
  29. int nDetAuth; // 32 bit for Detector functions
  30. int nTlsAuth; // 32 bit for Tool Programs functions
  31. int nReserved[12];
  32. };
  33. struct IRayLicenseInfo
  34. {
  35. int nVersion;
  36. char szPublisher[160];
  37. char szUserName[160];
  38. char szKey[256];
  39. long long tAuthorizingDay; // seconds since 1970.01.01
  40. long long tStartDay; // seconds since 1970.01.01
  41. long long tExpireDay; // seconds since 1970.01.01
  42. Enm_LicenseKeyMode eKeyMode; // Bind Computer/DetectorSN/DetectorBatchID
  43. IRayAuthority Authorities; // enable/disable functions by bitwise
  44. unsigned char btReserved[28]; // reserved
  45. }; // totol 700 bytes
  46. #pragma pack(pop)
  47. enum Enm_Authority
  48. {
  49. Enm_Authority_Basic = 0x00000000,
  50. Enm_Authority_RawImage = 0x00000001, // Bit_1
  51. Enm_Authority_UserDetConfig = 0x00000002, // Bit_2
  52. Enm_Authority_Tomo = 0x00000004, // Bit_3
  53. Enm_Authority_Test = 0x00002000, // Bit_14
  54. Enm_Authority_FactoryConfig = 0x00004000, // Bit_15
  55. Enm_Authority_WriteSN = 0x00008000, // Bit_16
  56. // extern code here
  57. Enm_Authority_Full = 0x7FFFFFFF, // Bit_1..32
  58. };
  59. enum Enm_Authority_Sdk // inherit from old version (Enm_Authority)
  60. {
  61. Enm_Authority_SDK_Basic = Enm_Authority_Basic,
  62. Enm_Authority_SDK_RawImage = Enm_Authority_RawImage,
  63. Enm_Authority_SDK_UserDetConfig = Enm_Authority_UserDetConfig,
  64. Enm_Authority_SDK_Tomo = Enm_Authority_Tomo,
  65. Enm_Authority_SDK_Test = Enm_Authority_Test,
  66. Enm_Authority_SDK_FactoryConfig = Enm_Authority_FactoryConfig,
  67. Enm_Authority_SDK_WriteSN = Enm_Authority_WriteSN,
  68. Enm_Authority_SDK_Full = Enm_Authority_Full,
  69. };
  70. enum Enm_Authority_Alg
  71. {
  72. Enm_Authority_Alg_Basic = 0x00000000,
  73. Enm_Authority_Alg_Grid_Med = 0x00000001, // Bit_1
  74. Enm_Authority_Alg_Medical = 0x00000002, // Bit_2
  75. Enm_Authority_Alg_Industry = 0x00000004, // Bit_3
  76. Enm_Authority_Alg_Security = 0x00000008, // Bit_4
  77. Enm_Authority_Alg_Grid_Vet = 0x00000010, // Bit_5
  78. Enm_Authority_Alg_Grid_Mammo = 0x00000020, // Bit_6
  79. // extern code here
  80. Enm_Authority_Alg_Full = 0x7FFFFFFF, // Bit_1..30
  81. };
  82. enum Enm_Authority_Det
  83. {
  84. Enm_Authority_Det_Basic = 0x00000000,
  85. Enm_Authority_Det_RawImage = 0x00000001, // Bit_1
  86. Enm_Authority_Det_iAEC = 0x00000002, // Bit_2
  87. Enm_Authority_Det_Tomo = 0x00000004, // Bit_3
  88. // extern code here
  89. Enm_Authority_Det_Full = 0x7FFFFFFF, // Bit_1..30
  90. };
  91. enum Enm_Authority_Tools
  92. {
  93. Enm_Authority_Tls_Basic = 0x00000000,
  94. Enm_Authority_Tls_Demo = 0x00000001, // Bit_1
  95. Enm_Authority_Tls_CustomSupport = 0x00000002, // Bit_2
  96. Enm_Authority_Tls_Manufacture = 0x00000010, // Bit_5
  97. Enm_Authority_Tls_Diagnose = 0x00000020, // Bit_6
  98. // extern code here
  99. Enm_Authority_Tlst_Full = 0x7FFFFFFF, // Bit_1..30
  100. };