IRayAuthDef.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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£¬UTC time
  40. long long tStartDay; // seconds since 1970.01.01£¬UTC time
  41. long long tExpireDay; // seconds since 1970.01.01£¬UTC time
  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_WithoutOffset = 0x00000001, // Bit_1
  51. Enm_Authority_UserDetConfig = 0x00000002, // Bit_2
  52. Enm_Authority_Tomo = 0x00000004, // Bit_3
  53. Enm_Authority_RawImage_WithoutGain = 0x0000008, // Bit_4
  54. Enm_Authority_RawImage_WithoutDefect = 0x00000010, // Bit_5
  55. Enm_Authority_DiagnoseTFT = 0x00000020, // Bit_6
  56. Enm_Authority_Test = 0x00002000, // Bit_14
  57. Enm_Authority_FactoryConfig = 0x00004000, // Bit_15
  58. Enm_Authority_WriteSN = 0x00008000, // Bit_16
  59. // extern code here
  60. Enm_Authority_Full = 0x7FFFFFFF, // Bit_1..31
  61. };
  62. enum Enm_Authority_Sdk // inherit from old version (Enm_Authority)
  63. {
  64. Enm_Authority_SDK_Basic = Enm_Authority_Basic,
  65. Enm_Authority_SDK_RawImage_WithoutOffset = Enm_Authority_RawImage_WithoutOffset, // Bit_1
  66. Enm_Authority_SDK_RawImage_WithoutGain = Enm_Authority_RawImage_WithoutGain, // Bit_4
  67. Enm_Authority_SDK_RawImage_WithoutDefect = Enm_Authority_RawImage_WithoutDefect, // Bit_5
  68. Enm_Authority_SDK_DiagnoseTFT = Enm_Authority_DiagnoseTFT, // Bit_6
  69. Enm_Authority_SDK_UserDetConfig = Enm_Authority_UserDetConfig, // Bit_2
  70. Enm_Authority_SDK_Tomo = Enm_Authority_Tomo, // Bit_3
  71. Enm_Authority_SDK_Test = Enm_Authority_Test, // Bit_14
  72. Enm_Authority_SDK_FactoryConfig = Enm_Authority_FactoryConfig, // Bit_15
  73. Enm_Authority_SDK_WriteSN = Enm_Authority_WriteSN, // Bit_16
  74. Enm_Authority_SDK_Full = Enm_Authority_Full, // Bit_1..31
  75. };
  76. enum Enm_Authority_Alg
  77. {
  78. Enm_Authority_Alg_Basic = 0x00000000,
  79. Enm_Authority_Alg_Grid_Med = 0x00000001, // Bit_1
  80. Enm_Authority_Alg_Medical = 0x00000002, // Bit_2
  81. Enm_Authority_Alg_Industry = 0x00000004, // Bit_3
  82. Enm_Authority_Alg_Security = 0x00000008, // Bit_4
  83. Enm_Authority_Alg_Grid_Vet = 0x00000010, // Bit_5
  84. Enm_Authority_Alg_Grid_Mammo = 0x00000020, // Bit_6
  85. Enm_Authority_Alg_Defect = 0x00000040, // Bit_7
  86. // extern code here
  87. Enm_Authority_Alg_Full = 0x7FFFFFFF, // Bit_1..31
  88. };
  89. enum Enm_Authority_Det
  90. {
  91. Enm_Authority_Det_Basic = 0x00000000,
  92. //Enm_Authority_Det_RawImage = 0x00000001, // Bit_1
  93. Enm_Authority_Det_iAEC = 0x00000002, // Bit_2
  94. Enm_Authority_Det_Tomo = 0x00000004, // Bit_3
  95. Enm_Authority_Det_Rent = 0x00000008, // Bit_4
  96. // extern code here
  97. Enm_Authority_Det_Full = 0x7FFFFFFF, // Bit_1..31
  98. };
  99. enum Enm_Authority_Tools
  100. {
  101. Enm_Authority_Tls_Basic = 0x00000000,
  102. Enm_Authority_Tls_Demo = 0x00000001, // Bit_1
  103. Enm_Authority_Tls_CustomSupport = 0x00000002, // Bit_2
  104. Enm_Authority_Tls_Manufacture = 0x00000010, // Bit_5
  105. Enm_Authority_Tls_Diagnose = 0x00000020, // Bit_6
  106. Enm_Authority_Tls_DecryptImage = 0x00000040, // Bit_7
  107. // extern code here
  108. Enm_Authority_Tlst_Full = 0x7FFFFFFF, // Bit_1..31
  109. };