PropItem.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. #pragma once
  2. namespace OTSMODEL {
  3. typedef enum class __declspec(dllexport) OTS_SAMPLE_PROP_GRID_ITEMS
  4. {// we prepare 10 items for every group.so the first group starts from 0,the second starts from 10,and so on.
  5. //the item's value is contrast to the position exactly when it's display in the property grid.and the caption string is read from the resource file by the value too.
  6. INVALID = -1,
  7. MIN = 0,
  8. GENERAL_GRP_MIN = 0,
  9. SAMPLE_NAME = 0,
  10. SAMPLE_HOLE_NAME = 1,
  11. SWITCH = 2,
  12. MEASURE_PARAM_FILE_NAME = 3,
  13. STD_FILE_NAME = 4,
  14. STEEL_TECHNOLOGY = 5,
  15. ROCK_TYPE = 6,
  16. GENERAL_GRP_MAX = 6,
  17. IMAGE_GRP_MIN = 10,
  18. START_MODE = 10,
  19. STOP_MODE = 11,
  20. STOP_PARAM_PARTICLE = 12,
  21. STOP_PARAM_FIELD = 13,
  22. STOP_PARAM_TIME = 14,
  23. SCAN_SPEED = 15,
  24. IMAGE_RESOLUTION = 16,
  25. OVER_LAP = 17,
  26. IMAGE_GRP_MAX = 17,
  27. IMAGE_PROC_MIN = 20,
  28. PARTICLE_AREA_MIN = 20,
  29. PARTICLE_AREA_MAX = 21,
  30. BG_GRAY_MIN = 22,
  31. BG_GRAY_MAX = 23,
  32. PARTICLE_GRAY_MIN = 24,
  33. PARTICLE_GRAY_MAX = 25,
  34. IMAGE_PROC_MAX = 26,
  35. XRAY_MIN = 30,
  36. SEARCH_RESOLUTION = 30,
  37. LOW_COUNTS = 31,
  38. ANALYSIS_RESOLUTION = 32,
  39. SCAN_MODE = 33,
  40. ANALYSIS_COUNTS = 34,
  41. XRAY_STEP = 35,
  42. XRAY_MAX = 35,
  43. SEM_DATA_MIN = 40,
  44. MAGNIFICATION = 40,
  45. PIXEL_SIZE = 41,
  46. WORKING_DISTANCE = 42,
  47. TOTAL_FIELDS = 43,
  48. TOTAL_TO_MEASURE_AREA = 44,
  49. SEM_DATA_MAX = 44,
  50. MEASURE_STATAU_MIN = 50,
  51. MEASURE_STATAU = 50,
  52. START_TIME = 51,
  53. USED_TIME = 52,
  54. FINISH_TIME = 53,
  55. COMPLETED_FIELDS = 54,
  56. MEASURE_STATAU_MAX = 55,
  57. MEASURE_RESULT_MIM = 60,
  58. RADIO = 60,
  59. TOTAL_AREA = 61,
  60. TOTAL_PARTICLE = 62,
  61. TOTAL_PARTICLE_AREA = 63,
  62. MEASURE_RESULT_MAX = 63,
  63. MAX = 63
  64. } OTS_SAMPLE_PROP_GRID_ITEMS;
  65. typedef enum class __declspec(dllexport) OTS_RETORT_PROP_GRID_ITEMS
  66. {
  67. INVALID = -1,
  68. MIN = 0,
  69. DATA_SOURCE = 0,
  70. DATA_SOURCE_TYPE = 1,
  71. IMAGE_TYPE = 2,
  72. IMAGE_DISPLAY_TYPE = 3,
  73. MEASURE_DATA_TYPE = 4,
  74. CALCULATE_TABLE_TYPE = 5,
  75. CALCULATE_CHART_TYPE = 6,
  76. PARTICLE_TYPE = 7,
  77. STD_ID = 8,
  78. GRAIN_SIZE_CLASS_TABLE = 9,
  79. GRAIN_SIZE_CLASS = 10,
  80. GRAIN_SIZE_MIN = 11,
  81. GRAIN_SIZE_MAX = 12,
  82. SIZE_CAL_METHOD_TYPE = 13,
  83. SIZE_GRID_CAL_METHOD_TYPE = 14,
  84. TRIO_CHART_TYPE = 15,
  85. ANALY_PARTICLE_TYPE = 16,
  86. MAX = 16
  87. }OTS_RETORT_PROP_GRID_ITEMS;
  88. typedef enum class __declspec(dllexport) OTS_SAMPLE_PROP_GRID_ITEM_GROUPS
  89. {
  90. INVALID = -1,
  91. MIN = 0,
  92. GENERAL = 0,
  93. IMAGE = 1,
  94. IMAGE_PROCESS = 2,
  95. XRAY = 3,
  96. SEM = 4,
  97. MEASURE_STATUS = 5,
  98. MEASURE_RESULTS = 6,
  99. MAX = 6
  100. } OTS_SAMPLE_PROP_GRID_ITEM_GROUPS;
  101. typedef enum class __declspec(dllexport) OTS_ITEM_TYPES
  102. {
  103. INVALID = -1,
  104. MIN = 0,
  105. BOOL = 0,
  106. INT = 1,
  107. DOUBLE = 2,
  108. STRING = 3,
  109. COMBO = 4,
  110. TIME = 5,
  111. TIME_SPAN = 6,
  112. FILE_LIST = 7,
  113. MAX = 7
  114. } OTS_ITEM_TYPES;
  115. class __declspec(dllexport) CPropItem
  116. {
  117. public:
  118. CPropItem(); // constructor
  119. CPropItem(const CPropItem&); // copy constructor
  120. CPropItem(CPropItem*); // copy constructor
  121. CPropItem& operator=(const CPropItem&); // =operator
  122. virtual ~CPropItem(); // destructor
  123. // set sample parameters
  124. void SetSmplParameter(OTS_SAMPLE_PROP_GRID_ITEMS a_nSmplId, OTS_ITEM_TYPES a_nType, BOOL a_bReadOnly, BOOL a_bShow);
  125. // set report parameter
  126. void SetReportParameter(OTS_RETORT_PROP_GRID_ITEMS a_nId, OTS_ITEM_TYPES a_nType, BOOL a_bReadOnly);
  127. // name
  128. CString GetName() { return m_strName; }
  129. void SetName(CString a_strName) { m_strName = a_strName; }
  130. // description
  131. CString GetDescription() { return m_strDescription; }
  132. void SetDescription(CString a_strDescription) { m_strDescription = a_strDescription; }
  133. // sample item Id
  134. OTS_SAMPLE_PROP_GRID_ITEMS GetSmplItemId() { return m_nSmplId; }
  135. void SetSmplItemId(OTS_SAMPLE_PROP_GRID_ITEMS a_nSmplId) { m_nSmplId = a_nSmplId; }
  136. // report item Id
  137. OTS_RETORT_PROP_GRID_ITEMS GetReportItemId() { return m_nReportId; }
  138. void SetReportItemId(OTS_RETORT_PROP_GRID_ITEMS a_nReportId) { m_nReportId = a_nReportId; }
  139. CString GetItemValueStr();
  140. // item type
  141. OTS_ITEM_TYPES GetTypeId() { return m_nType; }
  142. void SetTypeId(OTS_ITEM_TYPES a_nType) { m_nType = a_nType; }
  143. // read only flag
  144. BOOL IsReadOnly() { return m_bReadOnly; }
  145. void SetReadOnly(BOOL a_bReadOnly) { m_bReadOnly = a_bReadOnly; }
  146. protected:
  147. // cleanup
  148. void Cleanup();
  149. // initialization
  150. void Init();
  151. // duplication
  152. void Duplicate(const CPropItem& a_oSource);
  153. // name
  154. CString m_strName;
  155. // description
  156. CString m_strDescription;
  157. // sample item Id
  158. OTS_SAMPLE_PROP_GRID_ITEMS m_nSmplId;
  159. // report item Id
  160. OTS_RETORT_PROP_GRID_ITEMS m_nReportId;
  161. // item type
  162. OTS_ITEM_TYPES m_nType;
  163. // read only flag
  164. BOOL m_bReadOnly;
  165. // show flag, this is used for interface to sure if this propetry should be show, it is controlled by C++ now.
  166. BOOL m_bShow;
  167. };
  168. typedef std::shared_ptr<CPropItem> __declspec(dllexport) CPropItemPtr;
  169. typedef std::vector<CPropItemPtr> __declspec(dllexport) CPropItemsList;
  170. class __declspec(dllexport) CPropItemGrp
  171. {
  172. public:
  173. CPropItemGrp(); // constructor
  174. CPropItemGrp(const CPropItemGrp&); // copy constructor
  175. CPropItemGrp(CPropItemGrp*); // copy constructor
  176. CPropItemGrp& operator=(const CPropItemGrp&); // =operator
  177. virtual ~CPropItemGrp(); // destructor
  178. // group name
  179. CString GetName() { return m_strName; }
  180. void SetName(CString a_strName) { m_strName = a_strName; }
  181. // items group Id
  182. OTS_SAMPLE_PROP_GRID_ITEM_GROUPS GetGroupId() { return m_nId; }
  183. void SetGroupId(OTS_SAMPLE_PROP_GRID_ITEM_GROUPS a_nId) { m_nId = a_nId; }
  184. // items list
  185. CPropItemsList& GetItemsList() { return m_listPropItems; }
  186. void SetItemsList(CPropItemsList& a_listPropItems);
  187. void GetItemsIdRange(OTS_SAMPLE_PROP_GRID_ITEMS& a_nItemIdMin, OTS_SAMPLE_PROP_GRID_ITEMS& a_nItemIdMax);
  188. protected:
  189. // cleanup
  190. void Cleanup();
  191. // initialization
  192. void Init();
  193. // duplication
  194. void Duplicate(const CPropItemGrp& a_oSource);
  195. // group name
  196. CString m_strName;
  197. // group id
  198. OTS_SAMPLE_PROP_GRID_ITEM_GROUPS m_nId;
  199. // items list
  200. CPropItemsList m_listPropItems;
  201. };
  202. typedef std::shared_ptr<CPropItemGrp> __declspec(dllexport) CPropItemGrpPtr;
  203. typedef std::vector<CPropItemGrpPtr> __declspec(dllexport) CPropItemGrpsList;
  204. }