GridData.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. #pragma once
  2. #include "OTSParticle.h"
  3. namespace OTSMODEL {
  4. using namespace OTSDATA;
  5. typedef enum class __declspec(dllexport) REPORT_GRID_DATA_TYPE
  6. {
  7. INVALID = -1,
  8. MIN = 0,
  9. STRING = 0,
  10. PARTICLE = 1,
  11. INT = 2,
  12. FLOAT = 3,
  13. MAX = 3
  14. }REPORT_GRID_DATA_TYPE;
  15. typedef enum class __declspec(dllexport) REPORT_PARTICLE_GEN_INFO_GRID_CLUMN
  16. {
  17. INVALID = -1,
  18. MIN = 0,
  19. NAME = 0,
  20. IMAGE = 1,
  21. SIZE = 2,
  22. MAXLENGTH = 3,
  23. MINLENGTH =4,
  24. AXIALRATIO = 5,
  25. EquivalentCircleDiameter = 6,
  26. FerretDiameter = 7,
  27. PERP = 8,
  28. PERI = 9,
  29. INSCR = 10,
  30. MEAN = 11,
  31. ELONG = 12,
  32. ASPECT_ELONG = 13,
  33. ASPECT_MAX = 14,
  34. Orientation = 15,
  35. //ELEMENTLIST =3,
  36. MAX = 15
  37. }REPORT_PARTICLE_GEN_INFO_GRID_CLUMN;
  38. typedef enum class __declspec(dllexport) REPORT_PARTICLE_TRIO_INFO_GRID_CLUMN
  39. {
  40. INVALID = -1,
  41. MIN = 0,
  42. SIZE = 0,//Á£¼¶¼¶±ð
  43. Location = 1,
  44. MAX = 1
  45. }REPORT_PARTICLE_TRIO_INFO_GRID_CLUMN;
  46. typedef enum class __declspec(dllexport) REPORT_MEASURE_RESULT_INFO_GRID_CLUMN
  47. {
  48. INVALID = -1,
  49. MIN = 0,
  50. NAME = 0,
  51. INFORMATIN = 1,
  52. MAX = 1
  53. }REPORT_MEASURE_RESULT_INFO_GRID_CLUMN;
  54. typedef enum class __declspec(dllexport) REPORT_SORT_CLASS_GRID_CLUMN
  55. {
  56. INVALID = -1,
  57. MIN = 0,
  58. TOO_SMALL = 0,
  59. OVER_SIZE = 1,
  60. GRAY_NO_INTERS = 2,
  61. LOW_COUNT =3,
  62. NO_INTEREST_ELEMENTS = 4,
  63. NOT_INCLUSION_SIC = 5,
  64. NOT_INCLUSION_FEO = 6,
  65. NOT_IDENTIFIED = 7,
  66. IDENTIFIED = 8,
  67. MAX = 8
  68. }REPORT_SORT_CLASS_GRID_CLUMN;
  69. typedef enum class __declspec(dllexport) REPORT_SORT_KIND_GRID_CLUMN
  70. {
  71. INVALID = -1,
  72. MIN = 0,
  73. NOT_IDENTIFIED = 0,
  74. MAX = 0
  75. }REPORT_SORT_KIND_GRID_CLUMN;
  76. typedef enum class __declspec(dllexport) REPORT_SORT_SIZE_GRID_CLUMN
  77. {
  78. INVALID = -1,
  79. MIN = 0,
  80. USER_DENTIFIED = 0,
  81. MAX = 0
  82. }REPORT_SORT_SIZE_GRID_CLUMN;
  83. typedef enum class __declspec(dllexport) REPORT_PARTICLE_COMPONENT_GRID_CLUMN
  84. {
  85. INVALID = -1,
  86. MIN = 0,
  87. NAME = 0,
  88. COLOUR = 1,
  89. PARTICLE_NUM = 2,
  90. AVE_VALUE = 3,
  91. MAX_VALUE = 4,
  92. MAX = 4
  93. }REPORT_PARTICLE_COMPONENT_GRID_CLUMN;
  94. typedef enum class __declspec(dllexport) REPORT_ELEMENT_COMPONENT_GRID_CLUMN
  95. {
  96. INVALID = -1,
  97. MIN = 0,
  98. NAME = 0,
  99. NUM = 1,
  100. MAX = 1
  101. }REPORT_ELEMENT_COMPONENT_GRID_CLUMN;
  102. typedef enum class __declspec(dllexport) REPORT_AVE_ELEMENT_GRID_CLUMN
  103. {
  104. INVALID = -1,
  105. MIN = 0,
  106. PATICLE_TYPE = 0,
  107. AREA = 1,
  108. MAX = 1
  109. }REPORT_AVE_ELEMENT_GRID_CLUMN;
  110. typedef enum class __declspec(dllexport) REPORT_SIZE_DISTRIBUTION_GRID_CLUMN
  111. {
  112. INVALID = -1,
  113. MIN = 0,
  114. NAME = 0,
  115. COLOUR = 1,
  116. MAX = 1
  117. }REPORT_SIZE_DISTRIBUTION_GRID_CLUMN;
  118. typedef enum class __declspec(dllexport) REPORT_LEVEL_CLASS_GRID_CLUMN
  119. {
  120. INVALID = -1,
  121. MIN = 0,
  122. NAME = 0,
  123. WIDTH = 1,
  124. MAX = 1
  125. }REPORT_LEVEL_CLASSN_GRID_CLUMN;
  126. typedef enum class __declspec(dllexport) REPORT_COMMON_FIVE_GRID_CLUMN
  127. {
  128. INVALID = -1,
  129. MIN = 0,
  130. SULFIDE_OXIDE = 0,
  131. OXIDE = 1,
  132. SULFIDE = 2,
  133. NITRIDES = 3,
  134. SPINEL = 4,
  135. MAX = 4
  136. }REPORT_COMMON_FIVE_GRID_CLUMN;
  137. class __declspec(dllexport) CGridRow
  138. {
  139. public:
  140. // constructor
  141. CGridRow(); // constructor
  142. CGridRow(const CGridRow&); // copy constructor
  143. CGridRow(CGridRow*); // copy constructor
  144. CGridRow& operator=(const CGridRow&); // =operator
  145. BOOL operator==(const CGridRow&); // ==operator
  146. virtual ~CGridRow(); // destructor
  147. // data type
  148. REPORT_GRID_DATA_TYPE GetDataType() { return m_nDataType; }
  149. void SetDataType(REPORT_GRID_DATA_TYPE a_nDataType) { m_nDataType = a_nDataType; }
  150. // get string value
  151. CString GetStringValue() { return m_strValue; }
  152. void SetStringValue(CString a_strValue) { m_strValue = a_strValue; }
  153. COTSParticlePtr GetParticle() { return m_oParticle; }
  154. BOOL SetParticle(COTSParticlePtr a_oParticle);
  155. int GetIntValue() { return m_nIntValue; }
  156. void SetIntValue(int a_nIntValue) { m_nIntValue = a_nIntValue; }
  157. double GetDoubleValue() { return m_dFloatValue; }
  158. void SetDoubleValue(double a_dFloatValue) { m_dFloatValue = a_dFloatValue; }
  159. protected:
  160. // cleanup
  161. void Cleanup();
  162. // initialization
  163. void Init();
  164. // duplication
  165. void Duplicate(const CGridRow& a_oSource);
  166. // data type
  167. REPORT_GRID_DATA_TYPE m_nDataType;
  168. // string data
  169. CString m_strValue;
  170. // particle data
  171. COTSParticlePtr m_oParticle;
  172. // int value
  173. int m_nIntValue;
  174. // float value
  175. double m_dFloatValue;
  176. };
  177. typedef std::shared_ptr<CGridRow> __declspec(dllexport) CGridRowPtr;
  178. typedef std::vector<CGridRowPtr> __declspec(dllexport) CGridRowsList;
  179. class __declspec(dllexport) CGridColumn
  180. {
  181. public:
  182. // constructor
  183. CGridColumn(); // constructor
  184. CGridColumn(const CGridColumn&); // copy constructor
  185. CGridColumn(CGridColumn*); // copy constructor
  186. CGridColumn& operator=(const CGridColumn&); // =operator
  187. BOOL operator==(const CGridColumn&); // ==operator
  188. virtual ~CGridColumn(); // destructor
  189. CString GetName() { return m_strName; }
  190. void SetName(CString a_strName) { m_strName = a_strName; }
  191. CGridRowsList GetRowList() { return m_listGridRows; }
  192. BOOL SetGridRowsList(CGridRowsList a_listGridRows, BOOL a_bClear = TRUE);
  193. protected:
  194. // cleanup
  195. void Cleanup();
  196. // initialization
  197. void Init();
  198. // duplication
  199. void Duplicate(const CGridColumn& a_oSource);
  200. // name
  201. CString m_strName;
  202. // list of rows
  203. CGridRowsList m_listGridRows;
  204. };
  205. typedef std::shared_ptr<CGridColumn> __declspec(dllexport) CGridColumnPtr;
  206. typedef std::vector<CGridColumnPtr> __declspec(dllexport) CGridColumnsList;
  207. class __declspec(dllexport) CGridData
  208. {
  209. public:
  210. // constructor
  211. CGridData(); // constructor
  212. CGridData(const CGridData&); // copy constructor
  213. CGridData(CGridData*); // copy constructor
  214. CGridData& operator=(const CGridData&); // =operator
  215. BOOL operator==(const CGridData&); // ==operator
  216. virtual ~CGridData(); // destructor
  217. CGridColumnsList GetGridColumnList() { return m_listGridColumn; }
  218. BOOL SetGridColumnList(CGridColumnsList a_listGridColumn, BOOL a_bClear = TRUE);
  219. // data source id
  220. std::vector<CString>& GetDataSourceList() { return m_listDataSource; }
  221. BOOL SetDataSourceList(std::vector<CString> a_listDataSource);
  222. int GetDataSourceId() { return m_nDataSourceId; }
  223. BOOL SetDataSourceId(int a_nDataSourceId);
  224. protected:
  225. // cleanup
  226. void Cleanup();
  227. // initialization
  228. void Init();
  229. // duplication
  230. void Duplicate(const CGridData& a_oSource);
  231. // list of column
  232. CGridColumnsList m_listGridColumn;
  233. // data source id
  234. std::vector<CString> m_listDataSource;
  235. int m_nDataSourceId;
  236. };
  237. typedef std::shared_ptr<CGridData> __declspec(dllexport) CGridDataPtr;
  238. typedef std::vector<CGridDataPtr> __declspec(dllexport) CGridDatasList;
  239. /*typedef std::vector<CGridDatasList> __declspec(dllexport) CMultiGridDataList;*/
  240. }