otsdataconst.cs 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Drawing;
  7. namespace OTSDataType
  8. {
  9. public class otsdataconst
  10. {
  11. // minimum double enter
  12. public const double MIN_ENTER_VALUE = 0.000001;
  13. // minimum double value
  14. public const double MIN_DOUBLE_VALUE = 0.00000000001;
  15. // MolarRatio
  16. public const double MOLARRATIO_DEFAULT = 0.0;
  17. public const double MOLARRATIO_MIN = 0.0;
  18. public const double MOLARRATIO_MAX = 100.0;
  19. // percentage
  20. public const double PERCENTAGE_DEFAULT = 0.0;
  21. public const double PERCENTAGE_MIN = 0.0;
  22. public const double PERCENTAGE_MAX = 100.0;
  23. // atomic number
  24. public const long ATOMIC_NUMBER_INVALID = -1;
  25. public const long ATOMIC_NUMBER_MIN = 1;
  26. public const long ATOMIC_NUMBER_MAX = 103;
  27. // atomic weight
  28. public const double ATOMIC_WEIGHT_INVALID = -1.0;
  29. public const double ATOMIC_WEIGHT_MIN = 1.008;
  30. public const double ATOMIC_WEIGHT_MAX = 260.00;
  31. // energy value
  32. public const double ENERGY_VALUE_INVALID = -1.0;
  33. // density
  34. public const double DENSITY_DEFAULT = 0.0;
  35. // x-ray channel
  36. public const long GENERALXRAYCHANNELS = 2000;
  37. //invalid sample hole id
  38. public const int INVALID_HOLE_ID = -1;
  39. public const int MAX_PATH = 260;
  40. public const int IDS_OPEN_STAGE_FILE = 12404;
  41. public const int IDC_PIC_STAGE = 12018;
  42. public const String TEXTFILE_FILTER = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||";
  43. public const char FILE_VALUE_SPLIT = ',';
  44. public const String FILE_TITLE_SPLIT = ":";
  45. public const String LINE_END = "\r\n";
  46. public static int[] DWELLTIME_BRUKER_VALUES = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 };
  47. // IMAGE_RESOLUTION of BRUKER
  48. public const int RESOLUTION_ID_MIN = 0;
  49. public const int RESOLUTION_ID_MAX = 7;
  50. public const int RESOLUTION_ID_DEFAULT = 4;
  51. public const int RESOLUTION_ID_FIRST_TIE = 0;
  52. // private Size[] rESOLUTION_VALUE; /*= { new Size(512, 384), new Size(1024, 684), new Size(1024, 704), new Size(1024, 768), new Size(1536, 1024), new Size(2048, 1408),new Size(2048,1416), new Size(2048, 1536), new Size(3072, 2048),new Size(4096, 3072) };*/
  53. // private string[] rESOLUTION_STRINGS;/* = { "512 X 384", "1024 X 684", "1024 X 704", "1024 X 768", "1536 X 1024", "2048 X 1408", "2048 X 1416" , "2048 X 1536", "3072 X 2048", "4096 X 3072" };
  54. //*/
  55. // image parameter
  56. public const int STOP_PARAM_PARTICLE_MIN = 0;
  57. public const int STOP_PARAM_PARTICLE_MAX = 100000;
  58. public const int STOP_PARAM_FIELD_MIN = 0;
  59. public const int STOP_PARAM_FIELD_MAX = 10000;
  60. public const int STOP_PARAM_MSR_TINE_MIN = 0;
  61. public const int STOP_PARAM_MSR_TINE_MAX = 10000;
  62. // image process
  63. public const int PARTICLE_AREA_MIN = 0;
  64. public const int PARTICLE_AREA_MAX = 500000;
  65. public const int GRAY_LEVEL_MIN = 0;
  66. public const int GRAY_LEVEL_MAX = 255;
  67. // x-ray parameters
  68. public const int COUNTS_MIN = 0;
  69. // magnification
  70. public const double MAGNIFICATION_MIN = 20.0;
  71. public const double MAGNIFICATION_MAX = 10000.0;
  72. // scan field
  73. public const double SCANFIELDSIZE_MIN = 0.00000001;
  74. // max pixel size
  75. public const double RESOLUTION_MIN = 0.1;
  76. public const double RESOLUTION_MAX = 100.0;
  77. // avaltomicweight(min avaz)
  78. public const double AVALTOMICWEIGHT_MIN = 1.0;
  79. // avaltomicweight(max avaz)
  80. public const double AVALTOMICWEIGHT_MAX = 272;
  81. // bulkmod
  82. public const double BULKMOD_DEFAULT = 1.0;
  83. // rigiditymod
  84. public const double RIGIDITYMOD_DEFAULT = 1.0;
  85. public const int INVALIDPART_GROUPID = -1;
  86. public const int USR_MODIFY_CLASSIFYID_BASE = 50000;//user modify classify id base, when user manually modify classify id of particles.
  87. public enum OTS_IMAGE_RESULOTION_OPTIONS
  88. {
  89. _512_384 = 0,
  90. _1024_684 = 1,
  91. _1024_704 = 2,
  92. _1024_768 = 3,
  93. _1536_1024 = 4,
  94. _2048_1408 = 5,
  95. _2048_1536 = 6,
  96. _3072_2048 = 7,
  97. _3072_2112 = 8,
  98. _3072_2304 = 9,
  99. _4096_2816 =10,
  100. _4096_3072 = 11,
  101. _1280_960 = 12
  102. }
  103. public static Size[] RESOLUTION_VALUE
  104. {
  105. get
  106. {
  107. var names = Enum.GetNames(typeof(OTS_IMAGE_RESULOTION_OPTIONS));
  108. var rESOLUTION_VALUE = new Size[names.Length];
  109. int i = 0;
  110. foreach (var itm in names)
  111. {
  112. Size s = new Size();
  113. s.Width =Convert.ToInt32( itm.TrimStart('_').Split('_')[0]);
  114. s.Height = Convert.ToInt32(itm.TrimStart('_').Split('_')[1]);
  115. rESOLUTION_VALUE[i] = s;
  116. i++;
  117. }
  118. return rESOLUTION_VALUE;
  119. }
  120. }
  121. public static string[] RESOLUTION_STRINGS
  122. {
  123. get
  124. {
  125. string[] names = Enum.GetNames(typeof(OTS_IMAGE_RESULOTION_OPTIONS));
  126. foreach (var itm in names)
  127. {
  128. itm.TrimStart('_');
  129. itm.Replace('_', 'X');
  130. }
  131. return names;
  132. }
  133. }
  134. public enum OTS_X_AXIS_DIRECTION
  135. {
  136. LEFT_TOWARD = 0,
  137. RIGHT_TOWARD = 1
  138. }
  139. public enum RunMode
  140. {
  141. ProfessionalMode = 0, //专家模式
  142. PlainMode = 1 //普通模式
  143. }
  144. public enum FrameEndMode
  145. {
  146. FieldParticlePercentage = 0, //颗粒百分比
  147. ParticleNumber = 1 //颗粒数量
  148. }
  149. public enum OTS_AUTOBGREMOVETYPE
  150. {
  151. AUTO = 0,
  152. MANUAL = 1
  153. }
  154. public enum OTS_IMAGE_MODE
  155. {
  156. MIDDLE = 0,
  157. DOWNWARD = 1,
  158. UPWARD = 2
  159. }
  160. public enum OTS_SysType_ID
  161. {
  162. IncA = 0,
  163. TCCleannessA = 1,
  164. BatteryCleannessA=2
  165. }
  166. public enum OTS_CLASSIFY_ENGINE_TYPE
  167. {
  168. InclustionEngine = 0,
  169. ExpressionParse = 1,
  170. InclutionPlusExpressionParse = 2,
  171. SpectrumMatch = 3
  172. }
  173. public enum OTS_Y_AXIS_DIRECTION
  174. {
  175. UP_TOWARD = 0,
  176. DOWN_TOWARD = 1,
  177. }
  178. public enum OTS_MEASURE_STOP_MODE
  179. {
  180. CoverMode = 0,
  181. ParticleMode = 1,
  182. FieldMode = 2,
  183. TimeMode = 3,
  184. AreaMode=4
  185. }
  186. public enum DOMAIN_SHAPE
  187. {
  188. ROUND = 0,
  189. RECTANGLE = 1,
  190. POLYGON=2
  191. }
  192. public enum OTS_MEASURE_FIELD_STOP_MODE
  193. {
  194. ParticlesPercentage = 0,
  195. Particles = 1,
  196. }
  197. public enum OTS_BGREMOVE_TYPE
  198. {
  199. //MIN = 0,
  200. AUTO = 0,
  201. MANUAL = 1,
  202. MATRIX=2,
  203. WaterShed = 3
  204. }
  205. public enum OTS_AUTOBGREMOVE_TYPE
  206. {
  207. MIDDLE = 0,
  208. DOWNWARD = 1,
  209. UPWARD = 2,
  210. }
  211. public enum OTS_GET_IMAGE_MODE
  212. {
  213. Spiral = 0,
  214. Snake = 1,
  215. Zshape = 2
  216. }
  217. public enum OTS_IMAGE_SCANSPEED_OPTIONS
  218. {
  219. low = 0,//低
  220. meddium = 1,//中
  221. high = 2// 高
  222. }
  223. public enum OTS_X_RAY_SCAN_MODE
  224. {
  225. PointMode = 0,
  226. FeatureMode = 1,
  227. ExpandMode=2
  228. }
  229. public enum OTS_X_RAY_QUANTIFY_MODE
  230. {
  231. Standard = 0,
  232. AutoId = 1,
  233. NoQuantify = 2
  234. }
  235. public enum OTS_MSR_THREAD_STATUS
  236. {
  237. READY = 0,
  238. //MIN = 0,
  239. INPROCESS = 1,
  240. PAUSED=2,
  241. STOPPED = 3,
  242. FAILED = 4,
  243. COMPLETED = 5,
  244. //MAX = 4
  245. }
  246. public enum OTS_THREAD_TIME_TYPE
  247. {
  248. //MIN = 0,
  249. START = 1,
  250. STOPPED = 2,
  251. COMPLT = 3,
  252. //MAX = 3
  253. }
  254. public enum STEEL_TECHNOLOGY
  255. {
  256. GeneralProcessMode = 0,
  257. CaProcessMode = 1,
  258. MgProcessMode = 2,
  259. RareEarthMode = 3
  260. }
  261. public enum MEMBRANE_TYPE
  262. {
  263. INVALID = -1,
  264. MIN = 0,
  265. Abrasive = 0,
  266. Metallic_Gold = 1,
  267. Metallic_Silver = 2,
  268. MAX = 2
  269. }
  270. public enum MEASURE_SHAPE
  271. {
  272. CIRCLE = 0,
  273. RECT = 1
  274. }
  275. // particle type
  276. public enum OTS_PARTICLE_TYPE
  277. {
  278. INVALID = -1,
  279. MIN = 0,
  280. UNCLASSIFY = 0,
  281. OVERSIZE = 1,
  282. AVE_GRAY_NOT_INRANRE = 2,
  283. SEARCH_X_RAY = 3,
  284. LOW_COUNT = 4,
  285. NO_INTEREST_ELEMENTS = 5,
  286. NO_ANALYSIS_X_RAY = 6,
  287. ISNOT_INCLUTION = 7,
  288. NOT_USE = 8,
  289. NOT_IDENTIFIED = 9,
  290. IDENTIFIED = 10,//当为可识别类型时,可以被进一步识别为用户类型(1000以上),系统预定义类型(10000以上),所以最终颗粒类型不会为8,但可能为7
  291. MAX = 10,
  292. }
  293. public enum OTS_USING_X_RAY
  294. {
  295. No = 0,
  296. Yes = 1
  297. }
  298. }
  299. }