ProgMgrInfoForm.cs 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5. using System.Text.RegularExpressions;
  6. using System.Collections;
  7. using System.Diagnostics;
  8. using OTSDataType;
  9. using OTSModelSharp;
  10. using System.IO;
  11. using static OTSModelSharp.ResourceManage.ResourceData;
  12. using static OTSDataType.otsdataconst;
  13. using OTSModelSharp.Measure.GetStageInfo;
  14. using OTSMeasureApp._0_OTSModel.Measure.ParamData;
  15. namespace OTSMeasureApp
  16. {
  17. public partial class ProgMgrInfoForm : Form
  18. {
  19. #region 定义变量
  20. //初始化函数功能类
  21. public CStage m_cstage; //样品台类
  22. public CStageParam m_cstagefile; //样品台文件类
  23. public COTSDefaultParam m_cotsprogmgrparamfile; //参数类
  24. public CSEMStageData m_csemstagedata; //SEM样品台处理类
  25. public COTSImgScanPrm m_cotsimgscanprm; //图像扫描类
  26. public COTSGeneralParam m_cgenparam; //一般参数类
  27. public COTSImageProcParam m_cotsimgprocprm; //图像处理类
  28. public COTSXRayParam m_cotsxrayprm;
  29. public bool m_b_checkstagefile = false;
  30. //定位程序管理路径用的变量
  31. public string m_ParameterPath;
  32. //国际化
  33. OTSSysMgrTools.Language lan;
  34. Hashtable table;
  35. NLog.Logger log ;
  36. #endregion
  37. /// <summary>
  38. /// 样品台加载
  39. /// </summary>
  40. /// <returns></returns>
  41. public bool StageLoad()
  42. {
  43. if (!m_cstagefile.Load( true, !m_b_checkstagefile))
  44. {
  45. log.Error("(OTSProgMgrInfoFun.StageLoad) 加载样品台信息失败");
  46. return false;
  47. }
  48. return true;
  49. }
  50. #region 构造函数
  51. /// <summary>
  52. /// 默认构造函数
  53. /// </summary>
  54. public ProgMgrInfoForm()
  55. {
  56. log = NLog.LogManager.GetCurrentClassLogger();
  57. m_cotsprogmgrparamfile = new COTSDefaultParam();
  58. m_cstagefile = new CStageParam();
  59. InitializeComponent();
  60. //国际化
  61. lan = new OTSSysMgrTools.Language(this);
  62. table = lan.GetNameTable(this.Name);
  63. }
  64. #endregion
  65. #region 绑定各combobox控件
  66. /// <summary>
  67. /// 绑定各combobox控件下拉列表
  68. /// </summary>
  69. public void BindComboBox()
  70. {
  71. //样品台
  72. if (!StageLoad())
  73. {
  74. this.Close();
  75. return;//加载失败返回
  76. }
  77. //绑定样品台列表信息
  78. BindStageCombobox();
  79. //初始化选项,下拉框---------------------------------------------
  80. //绑定标准库
  81. IDC_COMBO_STDSelect.Items.Clear();
  82. string STDLibFolderName = m_cgenparam.GetPartSTDLibFolderName();
  83. string[] files = System.IO.Directory.GetFiles(STDLibFolderName, "*.db");
  84. System.IO.DirectoryInfo folder = new System.IO.DirectoryInfo(STDLibFolderName);
  85. foreach (System.IO.FileInfo file in folder.GetFiles("*.db"))
  86. {
  87. ComboBoxItem cbi = new ComboBoxItem();
  88. string FileNameWithoutExtension = Path.GetFileNameWithoutExtension(file.FullName);
  89. cbi.Text = FileNameWithoutExtension;
  90. //cbi.Value = (int)enum_one;
  91. IDC_COMBO_STDSelect.Items.Add(cbi);
  92. }
  93. //添加下拉列表中null项
  94. ComboBoxItem cbiNull = new ComboBoxItem();
  95. cbiNull.Text = "NoSTDDB";
  96. //cbi.Value = (int)enum_one;
  97. IDC_COMBO_STDSelect.Items.Add(cbiNull);
  98. this.IDC_COMBO_STDSelect.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STDSelect_SelectedIndexChanged);
  99. if (IDC_COMBO_STDSelect.Items.Count > 0)
  100. IDC_COMBO_STDSelect.SelectedIndex = 0;
  101. //----------------------------------------------------------------------
  102. this.IDC_COMBO_STDSelect.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STDSelect_SelectedIndexChanged);
  103. //x轴方向
  104. IDC_COMBO_XDIREC.Items.Clear();
  105. foreach (otsdataconst.OTS_X_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(otsdataconst.OTS_X_AXIS_DIRECTION)))
  106. {
  107. ComboBoxItem cbi = new ComboBoxItem();
  108. cbi.Text = GetXAxisDirectionIdString(enum_one);
  109. cbi.Value = (int)enum_one;
  110. IDC_COMBO_XDIREC.Items.Add(cbi);
  111. }
  112. this.IDC_COMBO_XDIREC.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_XDIREC_SelectedIndexChanged);
  113. if (IDC_COMBO_XDIREC.Items.Count > 0)
  114. IDC_COMBO_XDIREC.SelectedIndex = 0;
  115. this.IDC_COMBO_XDIREC.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_XDIREC_SelectedIndexChanged);
  116. //y轴方向
  117. IDC_COMBO_YDIRECT.Items.Clear();
  118. foreach (otsdataconst.OTS_Y_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(otsdataconst.OTS_Y_AXIS_DIRECTION)))
  119. {
  120. ComboBoxItem cbi = new ComboBoxItem();
  121. cbi.Text = GetYAxisDirectionIdString(enum_one);
  122. cbi.Value = (int)enum_one;
  123. IDC_COMBO_YDIRECT.Items.Add(cbi);
  124. }
  125. this.IDC_COMBO_YDIRECT.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_YDIRECT_SelectedIndexChanged);
  126. if (IDC_COMBO_YDIRECT.Items.Count > 0)
  127. IDC_COMBO_YDIRECT.SelectedIndex = 0;
  128. this.IDC_COMBO_YDIRECT.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_YDIRECT_SelectedIndexChanged);
  129. //测量终止方式
  130. IDC_COMBO_STOPMODE.Items.Clear();
  131. foreach (otsdataconst.OTS_MEASURE_STOP_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_MEASURE_STOP_MODE)))
  132. {
  133. ComboBoxItem cbi = new ComboBoxItem();
  134. cbi.Text = GetStopModeIdString(enum_one);
  135. cbi.Value = (int)enum_one;
  136. IDC_COMBO_STOPMODE.Items.Add(cbi);
  137. }
  138. this.IDC_COMBO_STOPMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
  139. if (IDC_COMBO_STOPMODE.Items.Count > 0)
  140. IDC_COMBO_STOPMODE.SelectedIndex = 0;
  141. this.IDC_COMBO_STOPMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
  142. //取图方式
  143. IDC_COMBO_FETCHIMGMODE.Items.Clear();
  144. foreach (otsdataconst.OTS_GET_IMAGE_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_GET_IMAGE_MODE)))
  145. {
  146. ComboBoxItem cbi = new ComboBoxItem();
  147. cbi.Text = GetGetImageIdString(enum_one);
  148. cbi.Value = (int)enum_one;
  149. IDC_COMBO_FETCHIMGMODE.Items.Add(cbi);
  150. }
  151. this.IDC_COMBO_FETCHIMGMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged);
  152. if (IDC_COMBO_FETCHIMGMODE.Items.Count > 0)
  153. IDC_COMBO_FETCHIMGMODE.SelectedIndex = 0;
  154. this.IDC_COMBO_FETCHIMGMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged);
  155. //扫描图精度
  156. IDC_COMBO_IMGSCANSPEED.Items.Clear();
  157. foreach (otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)))
  158. {
  159. ComboBoxItem cbi = new ComboBoxItem();
  160. cbi.Text = GetScanSpeedString(enum_one);
  161. cbi.Value = (int)enum_one;
  162. IDC_COMBO_IMGSCANSPEED.Items.Add(cbi);
  163. }
  164. this.IDC_COMBO_IMGSCANSPEED.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged);
  165. if (IDC_COMBO_IMGSCANSPEED.Items.Count > 0)
  166. IDC_COMBO_IMGSCANSPEED.SelectedIndex = 0;
  167. this.IDC_COMBO_IMGSCANSPEED.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged);
  168. //扫描图尺寸
  169. IDC_COMBO_IMGSIZE.Items.Clear();
  170. foreach (otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS)))
  171. {
  172. ComboBoxItem cbi = new ComboBoxItem();
  173. cbi.Text = GetImageSizeIdString(enum_one);
  174. cbi.Value = (int)enum_one;
  175. IDC_COMBO_IMGSIZE.Items.Add(cbi);
  176. }
  177. this.IDC_COMBO_IMGSIZE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_IMGSIZE_SelectedIndexChanged);
  178. if (IDC_COMBO_IMGSIZE.Items.Count > 0)
  179. IDC_COMBO_IMGSIZE.SelectedIndex = 0;
  180. this.IDC_COMBO_IMGSIZE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_IMGSIZE_SelectedIndexChanged);
  181. //搜索X-Ray精度
  182. IDC_COMBO_SEARCHXRAYSPEED.Items.Clear();
  183. foreach (otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)))
  184. {
  185. ComboBoxItem cbi = new ComboBoxItem();
  186. cbi.Text = GetXRaySearchSpeedIdString(enum_one);
  187. cbi.Value = (int)enum_one;
  188. IDC_COMBO_SEARCHXRAYSPEED.Items.Add(cbi);
  189. }
  190. this.IDC_COMBO_SEARCHXRAYSPEED.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged);
  191. if (IDC_COMBO_SEARCHXRAYSPEED.Items.Count > 0)
  192. IDC_COMBO_SEARCHXRAYSPEED.SelectedIndex = 0;
  193. this.IDC_COMBO_SEARCHXRAYSPEED.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged);
  194. //去背景方式
  195. IDC_COMBO_BGREMOVETYPE.Items.Clear();
  196. foreach (otsdataconst.OTS_AUTOBGREMOVETYPE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_AUTOBGREMOVETYPE)))
  197. {
  198. ComboBoxItem cbi = new ComboBoxItem();
  199. cbi.Text = GetBGREMOVETYPEString(enum_one);
  200. cbi.Value = (int)enum_one;
  201. IDC_COMBO_BGREMOVETYPE.Items.Add(cbi);
  202. }
  203. this.IDC_COMBO_BGREMOVETYPE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged);
  204. if (IDC_COMBO_BGREMOVETYPE.Items.Count > 0)
  205. IDC_COMBO_BGREMOVETYPE.SelectedIndex = 0;
  206. this.IDC_COMBO_BGREMOVETYPE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged);
  207. //自动去背景方式
  208. IDC_COMBO_AUTOBGREMOVETYP.Items.Clear();
  209. foreach (otsdataconst.OTS_IMAGE_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_MODE)))
  210. {
  211. ComboBoxItem cbi = new ComboBoxItem();
  212. cbi.Text = GetAUTOBGREMOVETYPEString(enum_one);
  213. cbi.Value = (int)enum_one;
  214. IDC_COMBO_AUTOBGREMOVETYP.Items.Add(cbi);
  215. }
  216. this.IDC_COMBO_AUTOBGREMOVETYP.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged);
  217. if (IDC_COMBO_AUTOBGREMOVETYP.Items.Count > 0)
  218. IDC_COMBO_AUTOBGREMOVETYP.SelectedIndex = 0;
  219. this.IDC_COMBO_AUTOBGREMOVETYP.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged);
  220. //X-Ray扫描方式
  221. IDC_COMBO_XRAYSCANMODE.Items.Clear();
  222. foreach (otsdataconst.OTS_X_RAY_SCAN_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_X_RAY_SCAN_MODE)))
  223. {
  224. ComboBoxItem cbi = new ComboBoxItem();
  225. cbi.Text = GetXRayScanModeIdString(enum_one);
  226. cbi.Value = (int)enum_one;
  227. //只添加点扫描
  228. IDC_COMBO_XRAYSCANMODE.Items.Add(cbi);
  229. }
  230. this.IDC_COMBO_XRAYSCANMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged);
  231. if (IDC_COMBO_XRAYSCANMODE.Items.Count > 0)
  232. IDC_COMBO_XRAYSCANMODE.SelectedIndex = 0;
  233. this.IDC_COMBO_XRAYSCANMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged);
  234. //分析X-Ray精度
  235. IDC_COMBO_ANALYXRAYSPEED.Items.Clear();
  236. foreach (otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)))
  237. {
  238. ComboBoxItem cbi = new ComboBoxItem();
  239. cbi.Text = GetXRayAnalySpeedIdString(enum_one);
  240. cbi.Value = (int)enum_one;
  241. IDC_COMBO_ANALYXRAYSPEED.Items.Add(cbi);
  242. }
  243. this.IDC_COMBO_ANALYXRAYSPEED.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged);
  244. if (IDC_COMBO_ANALYXRAYSPEED.Items.Count > 0)
  245. IDC_COMBO_ANALYXRAYSPEED.SelectedIndex = 0;
  246. this.IDC_COMBO_ANALYXRAYSPEED.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged);
  247. //精炼工艺下拉框选项
  248. IDC_COMBO_TECHNOLOGY.Items.Clear();
  249. foreach (STEEL_TECHNOLOGY enum_one in Enum.GetValues(typeof(STEEL_TECHNOLOGY)))
  250. {
  251. ComboBoxItem cbi = new ComboBoxItem();
  252. cbi.Text = GetSteelTechIdString((otsdataconst.STEEL_TECHNOLOGY)enum_one);
  253. cbi.Value = (int)enum_one;
  254. IDC_COMBO_TECHNOLOGY.Items.Add(cbi);
  255. }
  256. this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
  257. if (IDC_COMBO_TECHNOLOGY.Items.Count > 0)
  258. IDC_COMBO_TECHNOLOGY.SelectedIndex = 0;
  259. this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
  260. //测量区域形状
  261. cBMeasShape.Items.Clear();
  262. foreach (otsdataconst.MEASURE_SHAPE enum_one in Enum.GetValues(typeof(otsdataconst.MEASURE_SHAPE)))
  263. {
  264. ComboBoxItem cbi = new ComboBoxItem();
  265. cbi.Text = GetAreaShapeString(enum_one);
  266. cbi.Value = (int)enum_one;
  267. cBMeasShape.Items.Add(cbi);
  268. }
  269. this.cBMeasShape.SelectedIndexChanged -= new System.EventHandler(this.cBMeasShape_SelectedIndexChanged);
  270. if (cBMeasShape.Items.Count > 0)
  271. cBMeasShape.SelectedIndex = 0;
  272. this.cBMeasShape.SelectedIndexChanged += new System.EventHandler(this.cBMeasShape_SelectedIndexChanged);
  273. //模式选择
  274. IDC_COMBO_Model.Items.Clear();
  275. foreach (otsdataconst.RunMode enum_one in Enum.GetValues(typeof(otsdataconst.RunMode)))
  276. {
  277. OTSPeriodicTable.ComboBoxItem cbi = new OTSPeriodicTable.ComboBoxItem();
  278. cbi.Text = GetRunModeString(enum_one);
  279. cbi.Value = (int)enum_one;
  280. IDC_COMBO_Model.Items.Add(cbi);
  281. }
  282. this.IDC_COMBO_Model.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_Model_SelectedIndexChanged);
  283. if (IDC_COMBO_Model.Items.Count > 0)
  284. IDC_COMBO_Model.SelectedIndex = 0;
  285. this.IDC_COMBO_Model.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_Model_SelectedIndexChanged);
  286. }
  287. public CStage GetWorkingStage()
  288. {
  289. CStage ls_cstageclr = m_cstagefile.GetWorkingStage();
  290. if (null == ls_cstageclr)
  291. {
  292. log.Error("(OTSProgMgrInfoFun.GetWorkingStage) 获取正在工作的样品台类失败");
  293. return ls_cstageclr;
  294. }
  295. return ls_cstageclr;
  296. }
  297. /// <summary>
  298. /// 获取正在工作的样品台ID
  299. /// </summary>
  300. /// <returns></returns>
  301. public int GetWorkingStageId()
  302. {
  303. int stageid = m_cstagefile.GetWorkingStageId();
  304. return stageid;
  305. }
  306. /// <summary>
  307. /// 获取样品台信息列表
  308. /// </summary>
  309. /// <returns></returns>
  310. public List<CStage> GetStageList()
  311. {
  312. List<CStage> l_cstageclr = m_cstagefile.GetStagesList();
  313. if (null == l_cstageclr)
  314. {
  315. log.Error("(OTSProgMgrInfoFun.GetStageList) 获取样品台信息列表失败");
  316. return l_cstageclr;
  317. }
  318. return l_cstageclr;
  319. }
  320. /// <summary>
  321. /// 绑定样品台列表信息
  322. /// </summary>
  323. private void BindStageCombobox()
  324. {
  325. //先插入正在工作的样品台
  326. int ls_workingstageid = 0;
  327. IDC_COMBO_STAGE.Items.Clear();
  328. CStage ls_cstageclr = GetWorkingStage();
  329. ComboBoxItem ls_cbi = new ComboBoxItem();
  330. ls_cbi.Text = ls_cstageclr.GetName();
  331. ls_workingstageid = GetWorkingStageId();
  332. ls_cbi.Value = ls_workingstageid;
  333. IDC_COMBO_STAGE.Items.Add(ls_cbi);
  334. //添加其它的样品台信息
  335. List<CStage> l_cstageclr = GetStageList();
  336. for (int i = 0; i < l_cstageclr.Count(); i++)
  337. {
  338. if (ls_workingstageid != i)//将已经插入过的正在工作样品台信息跳过去
  339. {
  340. ComboBoxItem cbi = new ComboBoxItem();
  341. cbi.Text = l_cstageclr[i].GetName().ToString();
  342. cbi.Value = i.ToString();
  343. IDC_COMBO_STAGE.Items.Add(cbi);
  344. }
  345. }
  346. //防止进入窗体后,马上进入下拉项选择事件,先把事件去掉,一会再注册上
  347. this.IDC_COMBO_STAGE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STAGE_SelectedIndexChanged);
  348. //默认选择上
  349. if (IDC_COMBO_STAGE.Items.Count > 0)
  350. {
  351. IDC_COMBO_STAGE.SelectedIndex = 0;
  352. }
  353. this.IDC_COMBO_STAGE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STAGE_SelectedIndexChanged);
  354. }
  355. #endregion
  356. #region 参数相关方法封装
  357. /// <summary>
  358. /// 读取SEM样品台参数信息
  359. /// </summary>
  360. public void LoadSEMStageData()
  361. {
  362. //100倍时屏幕尺寸/mm
  363. IDC_EDIT_SCREENWIDTH.Text = m_csemstagedata.GetScanFieldSize100().ToString();
  364. //x轴方向
  365. foreach (ComboBoxItem cbi in IDC_COMBO_XDIREC.Items)
  366. {
  367. if (cbi.Value.ToString() != "")
  368. if (Convert.ToInt32(cbi.Value) == (int)m_csemstagedata.GetXAxisDir())
  369. {
  370. IDC_COMBO_XDIREC.SelectedItem = cbi;
  371. }
  372. }
  373. //x轴行程/mm 起,取值时,乘1000
  374. IDC_EDIT_XSTART.Text = (m_csemstagedata.GetXAxis().GetStart() / 1000).ToString();
  375. //x轴行程/mm 始
  376. IDC_EDIT_XEND.Text = (m_csemstagedata.GetXAxis().GetEnd() / 1000).ToString();
  377. //y轴方向
  378. foreach (ComboBoxItem cbi in IDC_COMBO_YDIRECT.Items)
  379. {
  380. if (cbi.Value.ToString() != "")
  381. if (Convert.ToInt32(cbi.Value) == (int)m_csemstagedata.GetYAxisDir())
  382. {
  383. IDC_COMBO_YDIRECT.SelectedItem = cbi;
  384. }
  385. }
  386. //y轴行程/mm 起
  387. IDC_EDIT_YSTART.Text = (m_csemstagedata.GetYAxis().GetStart() / 1000).ToString();
  388. //y轴行程/mm 始
  389. IDC_EDIT_YEND.Text = (m_csemstagedata.GetYAxis().GetEnd() / 1000).ToString();
  390. //最小放大倍数
  391. IDC_EDIT_MINMAG.Text = m_csemstagedata.GetMinMag().ToString();
  392. }
  393. /// <summary>
  394. /// 加载图像扫描参数
  395. /// </summary>
  396. public void LoadImageScanPrm()
  397. {
  398. //测量终止方式
  399. foreach (ComboBoxItem cbi in IDC_COMBO_STOPMODE.Items)
  400. {
  401. if (cbi.Value.ToString() != "")
  402. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetStopMode())
  403. {
  404. IDC_COMBO_STOPMODE.SelectedItem = cbi;
  405. }
  406. }
  407. //终止时间
  408. IDC_EDIT_STOP_TIME.Text = m_cotsimgscanprm.GetStopParamMeasTime().ToString();
  409. //终止帧图数
  410. IDC_EDIT_STOP_FIELD_NUM.Text = m_cotsimgscanprm.GetStopParamFields().ToString();
  411. //终止夹杂物数
  412. IDC_EDIT_STOP_INCA_NUM.Text = m_cotsimgscanprm.GetStopParamParticles().ToString();
  413. //取图方式
  414. foreach (ComboBoxItem cbi in IDC_COMBO_FETCHIMGMODE.Items)
  415. {
  416. if (cbi.Value.ToString() != "")
  417. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetFieldStartMode())
  418. {
  419. IDC_COMBO_FETCHIMGMODE.SelectedItem = cbi;
  420. }
  421. }
  422. //扫描图精度
  423. foreach (ComboBoxItem cbi in IDC_COMBO_IMGSCANSPEED.Items)
  424. {
  425. if (cbi.Value.ToString() != "")
  426. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetScanImageSpeed())
  427. {
  428. IDC_COMBO_IMGSCANSPEED.SelectedItem = cbi;
  429. }
  430. }
  431. //扫描图尺寸
  432. foreach (ComboBoxItem cbi in IDC_COMBO_IMGSIZE.Items)
  433. {
  434. if (cbi.Value.ToString() != "")
  435. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetImageResulotion())
  436. {
  437. IDC_COMBO_IMGSIZE.SelectedItem = cbi;
  438. }
  439. }
  440. }
  441. /// <summary>
  442. /// 加载一般常规参数
  443. /// </summary>
  444. public void LoadCGenParam()
  445. {
  446. //样品名
  447. IDC_EDIT_SAMPLENAME.Text = m_cgenparam.GetSampleName().ToString();
  448. //执行开关
  449. IDC_MEAS_SWITCH.Checked = m_cgenparam.GetMeasurementSwitch();
  450. //是否使用系统库开关
  451. IDC_SYS_LIB.Checked = m_cgenparam.GetSysSTD();
  452. //测量参数文件夹
  453. IDC_EDIT_MEASUREPARAMPATH.Text = m_cgenparam.GetMsrParamFileFolderName().ToString();
  454. //颗粒分析标准库文件夹
  455. IDC_EDIT_ANALYSESTDLIBPATH.Text = m_cgenparam.GetPartSTDLibFolderName().ToString();
  456. //选择颗粒分析标准库
  457. foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
  458. {
  459. if (cbi.Value.ToString() != "")
  460. if (Convert.ToInt32(cbi.Value) == m_cgenparam.GetPartStdLibTypeIndex())
  461. {
  462. //IDC_COMBO_TECHNOLOGY.SelectedItem = cbi;
  463. }
  464. }
  465. //精炼工艺选项
  466. foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
  467. {
  468. if (cbi.Value.ToString() != "")
  469. if (Convert.ToInt32(cbi.Value) == m_cgenparam.GetSteelTechnology())
  470. {
  471. IDC_COMBO_TECHNOLOGY.SelectedItem = cbi;
  472. }
  473. }
  474. //测量区域形状
  475. foreach (ComboBoxItem cbi in cBMeasShape.Items)
  476. {
  477. if (cbi.Value.ToString() != "")
  478. if (Convert.ToInt32(cbi.Value) == (int)m_cgenparam.GetShape())
  479. {
  480. cBMeasShape.SelectedItem = cbi;
  481. }
  482. }
  483. //测量区域面积
  484. tBMeasArea.Text = m_cgenparam.GetArea().ToString();
  485. //标准库选择
  486. foreach (ComboBoxItem cbi in IDC_COMBO_STDSelect.Items)
  487. {
  488. if (cbi.Text.ToString() != "")
  489. if (cbi.Text.ToString() == m_cgenparam.GetSTDSelect())
  490. {
  491. IDC_COMBO_STDSelect.SelectedItem = cbi;
  492. }
  493. }
  494. }
  495. /// <summary>
  496. /// 加载默认参数
  497. /// </summary>
  498. public void LoadDefaultParam()
  499. {
  500. //模式
  501. foreach (OTSPeriodicTable.ComboBoxItem cbi in IDC_COMBO_Model.Items)
  502. {
  503. if (cbi.Value.ToString() != "")
  504. if (Convert.ToInt32(cbi.Value) == (int)m_cotsprogmgrparamfile.GetRunMode())
  505. {
  506. IDC_COMBO_Model.SelectedItem = cbi;
  507. }
  508. }
  509. }
  510. /// <summary>
  511. /// 加载图像处理参数
  512. /// </summary>
  513. public void LoadImageProc()
  514. {
  515. //颗粒面积范围 最小
  516. IDC_EDIT_PARTAREAMIN.Text = m_cotsimgprocprm.GetIncAreaRange().GetStart().ToString();
  517. //颗粒面积范围 最大
  518. IDC_EDIT_PARTAREAMAX.Text = m_cotsimgprocprm.GetIncAreaRange().GetEnd().ToString();
  519. //背景灰度范围 最小
  520. IDC_EDIT_BACKMIN.Text = m_cotsimgprocprm.GetBGGray().GetStart().ToString();
  521. //背景灰度范围 最大
  522. IDC_EDIT_BACKMAX.Text = m_cotsimgprocprm.GetBGGray().GetEnd().ToString();
  523. //颗粒灰度范围 最小
  524. IDC_EDIT_PARTMIN.Text = m_cotsimgprocprm.GetParticleGray().GetStart().ToString();
  525. //颗粒灰度范围 最大
  526. IDC_EDIT_PARTMAX.Text = m_cotsimgprocprm.GetParticleGray().GetEnd().ToString();
  527. //去背景方式
  528. foreach (ComboBoxItem cbi in IDC_COMBO_BGREMOVETYPE.Items)
  529. {
  530. if (cbi.Value.ToString() != "")
  531. {
  532. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgprocprm.GetBGRemoveType())
  533. {
  534. IDC_COMBO_BGREMOVETYPE.SelectedItem = cbi;
  535. break;
  536. }
  537. }
  538. }
  539. foreach (ComboBoxItem cbi in IDC_COMBO_AUTOBGREMOVETYP.Items)
  540. {
  541. if (cbi.Value.ToString() != "")
  542. {
  543. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgprocprm.GetAutoBGRemoveType())
  544. {
  545. IDC_COMBO_AUTOBGREMOVETYP.SelectedItem = cbi;
  546. break;
  547. }
  548. }
  549. }
  550. }
  551. /// <summary>
  552. /// 加载X-Ray参数
  553. /// </summary>
  554. public void LoadXRayParam()
  555. {
  556. //搜索X-ray精度
  557. //foreach (ComboBoxItem cbi in IDC_COMBO_SEARCHXRAYSPEED.Items)
  558. //{
  559. // if (cbi.Value.ToString() != "")
  560. // if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetSearchSpeed())
  561. // {
  562. // IDC_COMBO_SEARCHXRAYSPEED.SelectedItem = cbi;
  563. // }
  564. //}
  565. //搜索X-ray精度对应的时间
  566. IDC_TEXTBOX_SEARCHXRAYSPEED_TIME.Text = m_cotsxrayprm.GetMidSearchAQTime().ToString();
  567. //搜索X-ray最低计数
  568. //IDC_EDIT_SEARCHXRAYCOUNTLIMIT.Text = m_cotsxrayprm.GetXRaySearchCount().ToString();
  569. //X-ray扫描方式
  570. foreach (ComboBoxItem cbi in IDC_COMBO_XRAYSCANMODE.Items)
  571. {
  572. if (cbi.Value.ToString() != "")
  573. if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetScanMode())
  574. {
  575. IDC_COMBO_XRAYSCANMODE.SelectedItem = cbi;
  576. }
  577. }
  578. //是否使用电镜
  579. IDC_USINGXRAY_LIB.Checked = m_cotsxrayprm.GetUsingXray();
  580. //分析X-ray精度
  581. foreach (ComboBoxItem cbi in IDC_COMBO_ANALYXRAYSPEED.Items)
  582. {
  583. if (cbi.Value.ToString() != "")
  584. if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetAnalySpeed())
  585. {
  586. IDC_COMBO_ANALYXRAYSPEED.SelectedItem = cbi;
  587. }
  588. }
  589. //分析X-ray精度对应的时间
  590. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text = m_cotsxrayprm.GetMidAnalyAQTime().ToString();
  591. //分析X-ray计数期望值
  592. IDC_EDIT_ANALYXRAYAIMVALUE.Text = m_cotsxrayprm.GetAnalyExpCount().ToString();
  593. IDC_EDIT_QuantifyMinSize.Text = m_cotsxrayprm.GetFeatureModeMinSize().ToString();
  594. IDC_EDIT_SmallPartAQTime.Text = m_cotsxrayprm.GetFastXrayTime().ToString();
  595. //IDC_XRAY_MODE_SWITCH.Checked = m_cotsxrayprm.GetShowScanMode();
  596. //IDC_XRAY_TIME_SWITCH.Checked = m_cotsxrayprm.GetShowSpeed();
  597. //IDC_XRAY_COUNT_SWITCH.Checked = m_cotsxrayprm.GetShowExpCount();
  598. }
  599. /// <summary>
  600. /// 保存SEM样品台参数
  601. /// </summary>
  602. public void SaveSEMStageData()
  603. {
  604. //100倍时屏幕尺寸/mm
  605. m_csemstagedata.SetScanFieldSize100(Convert.ToInt32(IDC_EDIT_SCREENWIDTH.Text));
  606. //x轴方向
  607. ComboBoxItem cbi_x = (ComboBoxItem)IDC_COMBO_XDIREC.SelectedItem;
  608. m_csemstagedata.SetXAxisDir((otsdataconst.OTS_X_AXIS_DIRECTION)Convert.ToInt32(cbi_x.Value));
  609. //x轴行程/mm 起,始
  610. CIntRange crc_x = new CIntRange(Convert.ToInt32(IDC_EDIT_XSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_XEND.Text) * 1000);
  611. m_csemstagedata.SetXAxis(crc_x);
  612. //y轴方向
  613. ComboBoxItem cbi_y = (ComboBoxItem)IDC_COMBO_YDIRECT.SelectedItem;
  614. m_csemstagedata.SetYAxisDir((otsdataconst.OTS_Y_AXIS_DIRECTION)Convert.ToInt32(cbi_y.Value));
  615. //y轴行程/mm 起,始
  616. CIntRange crc_y = new CIntRange(Convert.ToInt32(IDC_EDIT_YSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_YEND.Text) * 1000);
  617. m_csemstagedata.SetYAxis(crc_y);
  618. //最小放大倍数
  619. m_csemstagedata.SetMinMag(Convert.ToDouble(IDC_EDIT_MINMAG.Text));
  620. }
  621. /// <summary>
  622. /// 保存图像扫描参数
  623. /// </summary>
  624. public void SaveImageScanPrm()
  625. {
  626. // 保存图像扫描参数");
  627. //测量终止方式
  628. ComboBoxItem enum_stopmode = (ComboBoxItem)IDC_COMBO_STOPMODE.SelectedItem;
  629. m_cotsimgscanprm.SetStopMode((otsdataconst.OTS_MEASURE_STOP_MODE)Convert.ToInt32(enum_stopmode.Value));
  630. //终止时间
  631. m_cotsimgscanprm.SetStopParamMeasTime(Convert.ToInt32(IDC_EDIT_STOP_TIME.Text));
  632. //终止帧图数
  633. m_cotsimgscanprm.SetStopParamFields(Convert.ToInt32(IDC_EDIT_STOP_FIELD_NUM.Text));
  634. //终止夹杂物数
  635. m_cotsimgscanprm.SetStopParamParticles(Convert.ToInt32(IDC_EDIT_STOP_INCA_NUM.Text));
  636. //取图方式
  637. ComboBoxItem enum_fetchimgmode = (ComboBoxItem)IDC_COMBO_FETCHIMGMODE.SelectedItem;
  638. m_cotsimgscanprm.SetStartImageMode((otsdataconst.OTS_GET_IMAGE_MODE)Convert.ToInt32(enum_fetchimgmode.Value));
  639. //扫描图精度
  640. ComboBoxItem enum_imgscanspeed = (ComboBoxItem)IDC_COMBO_IMGSCANSPEED.SelectedItem;
  641. m_cotsimgscanprm.SetScanImageSpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_imgscanspeed.Value));
  642. //扫描图尺寸
  643. ComboBoxItem enum_imgsize = (ComboBoxItem)IDC_COMBO_IMGSIZE.SelectedItem;
  644. m_cotsimgscanprm.SetImageResulotion((otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS)Convert.ToInt32(enum_imgsize.Value));
  645. }
  646. /// <summary>
  647. /// 保存一般常规参数
  648. /// </summary>
  649. public void SaveCGenParam()
  650. {
  651. //样品名
  652. m_cgenparam.SetSampleName(IDC_EDIT_SAMPLENAME.Text);
  653. //执行开关
  654. m_cgenparam.SetMeasurementSwitch(IDC_MEAS_SWITCH.Checked);
  655. //是否使用系统库
  656. m_cgenparam.SetSysSTD(IDC_SYS_LIB.Checked);
  657. //测量参数文件夹
  658. m_cgenparam.SetMsrParamFileFolderName(IDC_EDIT_MEASUREPARAMPATH.Text);
  659. //颗粒分析标准库文件夹
  660. m_cgenparam.SetPartSTDLibFolderName(IDC_EDIT_ANALYSESTDLIBPATH.Text);
  661. //获取精炼工艺索引
  662. ComboBoxItem cbiTECH = new ComboBoxItem();
  663. cbiTECH = (ComboBoxItem)IDC_COMBO_TECHNOLOGY.SelectedItem;
  664. //设置参数文件类中精炼工艺索引值
  665. m_cgenparam.SetSteelTechnology((int)cbiTECH.Value);
  666. //测量区域形状
  667. ComboBoxItem enum_Shape = (ComboBoxItem)cBMeasShape.SelectedItem;
  668. m_cgenparam.SetShape((otsdataconst.DOMAIN_SHAPE)Convert.ToInt32(enum_Shape.Value));
  669. //测量区域大小
  670. m_cgenparam.SetArea(Convert.ToDouble(tBMeasArea.Text));
  671. //标准库选择
  672. ComboBoxItem enum_STDLIBSELECT = (ComboBoxItem)IDC_COMBO_STDSelect.SelectedItem;
  673. m_cgenparam.SetSTDSelect(enum_STDLIBSELECT.Text.ToString());
  674. }
  675. /// <summary>
  676. /// 保存图像处理参数
  677. /// </summary>
  678. public void SaveImageProc()
  679. {
  680. //颗粒面积范围 最小 最大
  681. CDoubleRange crc_partareamin = new CDoubleRange(Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text), 2), Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text), 2));
  682. m_cotsimgprocprm.SetIncAreaRange(crc_partareamin);
  683. //背景灰度范围 最小 最大
  684. CIntRange crc_backmin = new CIntRange(Convert.ToInt32(IDC_EDIT_BACKMIN.Text), Convert.ToInt32(IDC_EDIT_BACKMAX.Text));
  685. m_cotsimgprocprm.SetBGGray(crc_backmin);
  686. //颗粒灰度范围 最小 最大
  687. CIntRange crc_partmin = new CIntRange(Convert.ToInt32(IDC_EDIT_PARTMIN.Text), Convert.ToInt32(IDC_EDIT_PARTMAX.Text));
  688. m_cotsimgprocprm.SetParticleGray(crc_partmin);
  689. //去背景方式
  690. ComboBoxItem enum_BGREMOVETYPE = (ComboBoxItem)IDC_COMBO_BGREMOVETYPE.SelectedItem;
  691. m_cotsimgprocprm.SetBGRemoveType((otsdataconst.OTS_BGREMOVE_TYPE)enum_BGREMOVETYPE.Value);
  692. //去背景方式
  693. ComboBoxItem enum_AUTOBGREMOVETYP = (ComboBoxItem)IDC_COMBO_AUTOBGREMOVETYP.SelectedItem;
  694. m_cotsimgprocprm.SetAutoBGRemoveType((otsdataconst.OTS_AUTOBGREMOVE_TYPE)enum_AUTOBGREMOVETYP.Value);
  695. }
  696. /// <summary>
  697. /// 保存X-Ray参数
  698. /// </summary>
  699. public void SaveXRayParam()
  700. {
  701. //搜索X-ray精度
  702. ComboBoxItem enum_searchxrayspeed = (ComboBoxItem)IDC_COMBO_SEARCHXRAYSPEED.SelectedItem;
  703. //m_cotsxrayprm.SetSearchSpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_searchxrayspeed.Value));
  704. //搜索X - ray精度对应的时间
  705. m_cotsxrayprm.SetMidSearchAQTime(Convert.ToInt32(IDC_TEXTBOX_SEARCHXRAYSPEED_TIME.Text.Trim()));
  706. //搜索X-ray最低计数
  707. //m_cotsxrayprm.SetXRaySearchCount(Convert.ToInt32(IDC_EDIT_SEARCHXRAYCOUNTLIMIT.Text));
  708. //X-ray扫描方式
  709. ComboBoxItem enum_xrayscanmode = (ComboBoxItem)IDC_COMBO_XRAYSCANMODE.SelectedItem;
  710. m_cotsxrayprm.SetScanMode((otsdataconst.OTS_X_RAY_SCAN_MODE)Convert.ToInt32(enum_xrayscanmode.Value));
  711. //是否使用X-ray
  712. m_cotsxrayprm.SetUsingXray(IDC_USINGXRAY_LIB.Checked);
  713. //分析X-ray精度
  714. ComboBoxItem enum_analyxrayspeed = (ComboBoxItem)IDC_COMBO_ANALYXRAYSPEED.SelectedItem;
  715. m_cotsxrayprm.SetAnalySpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_analyxrayspeed.Value));
  716. //分析X-ray精度对应的时间
  717. m_cotsxrayprm.SetMidAnalyAQTime(Convert.ToInt32(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()));
  718. //分析X-ray计数期望值
  719. m_cotsxrayprm.SetAnalyExpCount(Convert.ToInt32(IDC_EDIT_ANALYXRAYAIMVALUE.Text));
  720. m_cotsxrayprm.SetQuantifyMinSize(Convert.ToDouble(IDC_EDIT_QuantifyMinSize.Text));
  721. m_cotsxrayprm.SetFastXrayTime(Convert.ToInt32(IDC_EDIT_SmallPartAQTime.Text));
  722. //m_cotsxrayprm.SetShowScanMode(IDC_XRAY_MODE_SWITCH.Checked);
  723. //m_cotsxrayprm.SetShowSpeed(IDC_XRAY_TIME_SWITCH.Checked);
  724. //m_cotsxrayprm.SetShowExpCount(IDC_XRAY_COUNT_SWITCH.Checked);
  725. }
  726. /// <summary>
  727. /// 将参数保存到文件
  728. /// </summary>
  729. /// <param name="a_nPackId"></param>
  730. /// <param name="a_pStageData"></param>
  731. /// <param name="a_pGenParam"></param>
  732. /// <param name="a_pImageScanParam"></param>
  733. /// <param name="a_pImageProcParam"></param>
  734. /// <param name="a_pXRayParam"></param>
  735. /// <returns></returns>
  736. public bool SaveInfoToProgMgrFile()
  737. {
  738. //SaveInfoToProgMgrFile()
  739. if (false == m_cotsprogmgrparamfile.SaveInfoToProgMgrFile())
  740. {
  741. log.Error("(OTSProgMgrInfoFun.SaveInfoToProgMgrFile) Failed to save parameters to file");
  742. return false;
  743. }
  744. return true;
  745. }
  746. /// <summary>
  747. /// 加载参数各个类
  748. /// </summary>
  749. public bool LoadParamFun()
  750. {
  751. bool result = m_cotsprogmgrparamfile.LoadInfoFromProgMgrFile();
  752. if (!result)
  753. {
  754. log.Error("(OTSProgMgrInfoFun.LoadParamFun) LoadInfoFromProgMgrFile Failed");
  755. return false;
  756. }
  757. m_csemstagedata = m_cotsprogmgrparamfile.GetStageDataParam();
  758. if (null == m_csemstagedata)
  759. {
  760. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetStageData Failed");
  761. return false;
  762. }
  763. m_cotsimgscanprm = m_cotsprogmgrparamfile.GetImageScanParam();
  764. if (null == m_cotsimgscanprm)
  765. {
  766. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageScanParam Failed");
  767. return false;
  768. }
  769. m_cgenparam = m_cotsprogmgrparamfile.GetGenParam();
  770. if (null == m_cgenparam)
  771. {
  772. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetGenParam Failed");
  773. return false;
  774. }
  775. m_cotsimgprocprm = m_cotsprogmgrparamfile.GetImageProcParam();
  776. if (null == m_cotsimgprocprm)
  777. {
  778. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageProcParam Failed");
  779. return false;
  780. }
  781. m_cotsxrayprm = m_cotsprogmgrparamfile.GetXRayParam();
  782. if (null == m_cotsxrayprm)
  783. {
  784. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetXRayParam Failed");
  785. return false;
  786. }
  787. return true;
  788. }
  789. #endregion
  790. #region 窗体加载
  791. private void ProgMgrInfoForm_Load(object sender, EventArgs e)
  792. {
  793. //加载各参数类
  794. LoadParamFun();
  795. //初始化combobox下拉框列表
  796. BindComboBox();
  797. //加载相关参数信息
  798. LoadDefaultParam();
  799. LoadSEMStageData();
  800. LoadImageScanPrm();
  801. LoadCGenParam();
  802. LoadImageProc();
  803. LoadXRayParam();
  804. if (m_b_checkstagefile == false)
  805. btnok.Enabled = true;
  806. else
  807. btnok.Enabled = false;
  808. //关于路径定位问题
  809. this.folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
  810. string strb = ".\\Config\\SysData\\";
  811. string strc = ".\\Config\\ProData\\";
  812. string m_STDPath = strb;
  813. m_ParameterPath = strc;
  814. this.folderBrowserDialog1.SelectedPath = m_ParameterPath;
  815. IDC_EDIT_MEASUREPARAMPATH.Text = m_ParameterPath;
  816. IDC_EDIT_ANALYSESTDLIBPATH.Text = m_STDPath;
  817. if(m_cotsprogmgrparamfile.GetSysType() == "IncA")
  818. {
  819. label42.Visible = true;
  820. IDC_COMBO_TECHNOLOGY.Visible = true;
  821. }
  822. else
  823. {
  824. label42.Visible = false;
  825. IDC_COMBO_TECHNOLOGY.Visible = false;
  826. }
  827. }
  828. #endregion
  829. #region 各按钮控件点击事件
  830. private void IDC_BUTTON_KLFX_Click(object sender, EventArgs e)
  831. {
  832. try
  833. {
  834. if (IDC_COMBO_STDSelect.Text != "NoSTDDB")
  835. {
  836. Process p = System.Diagnostics.Process.Start(".\\OTSPartA_STDEditor.exe", Application.StartupPath + "\\Config\\SysData\\" + IDC_COMBO_STDSelect.Text+".db");
  837. p.WaitForExit();
  838. }
  839. else
  840. {
  841. string message = table["message55"].ToString();
  842. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  843. }
  844. }
  845. catch (Exception ex)
  846. {
  847. log.Error("OTSPartA_STDEditor:" + ex.ToString());
  848. }
  849. }
  850. private void IDC_BUTTON_MEASPRAMPATHSET_Click(object sender, EventArgs e)
  851. {
  852. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  853. {
  854. IDC_EDIT_MEASUREPARAMPATH.Text = folderBrowserDialog1.SelectedPath;
  855. }
  856. else {
  857. folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
  858. }
  859. }
  860. private void IDC_BUTTON_PARTSTDLIBPATHSET_Click(object sender, EventArgs e)
  861. {
  862. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  863. {
  864. IDC_EDIT_ANALYSESTDLIBPATH.Text = folderBrowserDialog1.SelectedPath;
  865. }
  866. else {
  867. folderBrowserDialog1.SelectedPath = IDC_EDIT_ANALYSESTDLIBPATH.Text;
  868. }
  869. }
  870. /// <summary>
  871. /// 弹出样品台管理窗体
  872. /// </summary>
  873. /// <param name="a_nPackId"></param>
  874. /// <param name="a_pStageFile"></param>
  875. /// <returns></returns>
  876. public void ShowStageDialogExport()
  877. {
  878. DlgStageMgr dlgStageMgr = new DlgStageMgr(m_cstagefile);
  879. dlgStageMgr.ShowDialog();
  880. return;
  881. }
  882. /// <summary>
  883. /// 保存样品台信息
  884. /// </summary>
  885. /// <returns></returns>
  886. public bool CStageFileClrSave()
  887. {
  888. if (m_cstagefile == null)
  889. {
  890. //报错
  891. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) Error saving sample station information!");
  892. }
  893. else
  894. {
  895. bool b_ret = m_cstagefile.Save();
  896. if (false == b_ret)
  897. {
  898. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) Error saving sample table information!");
  899. }
  900. }
  901. return false;
  902. }
  903. private void IDC_BUTTON_STAGE_Click(object sender, EventArgs e)
  904. {
  905. //弹出管理样品台管理窗体
  906. ShowStageDialogExport();
  907. //弹出后再保存样品台信息
  908. CStageFileClrSave();
  909. //刷新绑定样品台列表
  910. BindStageCombobox();
  911. //检测是否已经有修改
  912. ThisSetIsModify();
  913. }
  914. /// <summary>
  915. /// 判断各控件值是否正确
  916. /// </summary>
  917. /// <returns></returns>
  918. private bool CheckSetupValues(int bz)
  919. {
  920. if ("" == IDC_COMBO_STAGE.Text)
  921. {
  922. string message = table["message1"].ToString();
  923. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  924. IDC_COMBO_STAGE.Focus();
  925. IDC_COMBO_STAGE.SelectAll();
  926. return false;
  927. }
  928. if ("" == IDC_EDIT_SCREENWIDTH.Text)
  929. {
  930. string message = table["message2"].ToString();
  931. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  932. IDC_EDIT_SCREENWIDTH.Focus();
  933. IDC_EDIT_SCREENWIDTH.SelectAll();
  934. return false;
  935. }
  936. if ("" == IDC_COMBO_XDIREC.Text)
  937. {
  938. string message = table["message3"].ToString();
  939. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  940. IDC_COMBO_XDIREC.Focus();
  941. IDC_COMBO_XDIREC.SelectAll();
  942. return false;
  943. }
  944. if ("" == IDC_EDIT_XSTART.Text)
  945. {
  946. string message = table["message4"].ToString();
  947. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  948. IDC_EDIT_XSTART.Focus();
  949. IDC_EDIT_XSTART.SelectAll();
  950. return false;
  951. }
  952. if ("" == IDC_EDIT_XEND.Text)
  953. {
  954. string message = table["message4"].ToString();
  955. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  956. IDC_EDIT_XEND.Focus();
  957. IDC_EDIT_XEND.SelectAll();
  958. return false;
  959. }
  960. if ("" == IDC_COMBO_YDIRECT.Text)
  961. {
  962. string message = table["message5"].ToString();
  963. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  964. IDC_COMBO_YDIRECT.Focus();
  965. IDC_COMBO_YDIRECT.SelectAll();
  966. return false;
  967. }
  968. if ("" == IDC_EDIT_YSTART.Text)
  969. {
  970. string message = table["message6"].ToString();
  971. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  972. IDC_EDIT_YSTART.Focus();
  973. IDC_EDIT_YSTART.SelectAll();
  974. return false;
  975. }
  976. if ("" == IDC_EDIT_YEND.Text)
  977. {
  978. string message = table["message6"].ToString();
  979. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  980. IDC_EDIT_YEND.Focus();
  981. IDC_EDIT_YEND.SelectAll();
  982. return false;
  983. }
  984. if ("" == IDC_EDIT_STOP_TIME.Text)
  985. {
  986. string message = table["message7"].ToString();
  987. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  988. IDC_EDIT_STOP_TIME.Focus();
  989. IDC_EDIT_STOP_TIME.SelectAll();
  990. return false;
  991. }
  992. if ("" == IDC_EDIT_STOP_FIELD_NUM.Text)
  993. {
  994. string message = table["message8"].ToString();
  995. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  996. IDC_EDIT_STOP_FIELD_NUM.Focus();
  997. IDC_EDIT_STOP_FIELD_NUM.SelectAll();
  998. return false;
  999. }
  1000. if ("" == IDC_EDIT_STOP_INCA_NUM.Text)
  1001. {
  1002. string message = table["message9"].ToString();
  1003. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1004. IDC_EDIT_STOP_INCA_NUM.Focus();
  1005. IDC_EDIT_STOP_INCA_NUM.SelectAll();
  1006. return false;
  1007. }
  1008. if ("" == IDC_COMBO_FETCHIMGMODE.Text)
  1009. {
  1010. string message = table["message10"].ToString();
  1011. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1012. IDC_COMBO_FETCHIMGMODE.Focus();
  1013. IDC_COMBO_FETCHIMGMODE.SelectAll();
  1014. return false;
  1015. }
  1016. if ("" == IDC_COMBO_IMGSCANSPEED.Text)
  1017. {
  1018. string message = table["message11"].ToString();
  1019. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1020. IDC_COMBO_IMGSCANSPEED.Focus();
  1021. IDC_COMBO_IMGSCANSPEED.SelectAll();
  1022. return false;
  1023. }
  1024. if ("" == IDC_COMBO_IMGSIZE.Text)
  1025. {
  1026. string message = table["message12"].ToString();
  1027. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1028. IDC_COMBO_IMGSIZE.Focus();
  1029. IDC_COMBO_IMGSIZE.SelectAll();
  1030. return false;
  1031. }
  1032. if ("" == IDC_EDIT_MINMAG.Text)
  1033. {
  1034. string message = table["message13"].ToString();
  1035. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1036. IDC_EDIT_MINMAG.Focus();
  1037. IDC_EDIT_MINMAG.SelectAll();
  1038. return false;
  1039. }
  1040. if ("" == IDC_EDIT_PARTAREAMIN.Text)
  1041. {
  1042. string message = table["message14"].ToString();
  1043. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1044. IDC_EDIT_PARTAREAMIN.Focus();
  1045. IDC_EDIT_PARTAREAMIN.SelectAll();
  1046. return false;
  1047. }
  1048. if ("" == IDC_EDIT_PARTAREAMAX.Text)
  1049. {
  1050. string message = table["message15"].ToString();
  1051. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1052. IDC_EDIT_PARTAREAMAX.Focus();
  1053. IDC_EDIT_PARTAREAMAX.SelectAll();
  1054. return false;
  1055. }
  1056. if ("" == IDC_EDIT_BACKMIN.Text)
  1057. {
  1058. string message = table["message16"].ToString();
  1059. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1060. IDC_EDIT_BACKMIN.Focus();
  1061. IDC_EDIT_BACKMIN.SelectAll();
  1062. return false;
  1063. }
  1064. if ("" == IDC_EDIT_BACKMAX.Text)
  1065. {
  1066. string message = table["message17"].ToString();
  1067. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1068. IDC_EDIT_BACKMAX.Focus();
  1069. IDC_EDIT_BACKMAX.SelectAll();
  1070. return false;
  1071. }
  1072. if ("" == IDC_EDIT_PARTMIN.Text)
  1073. {
  1074. string message = table["message18"].ToString();
  1075. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1076. IDC_EDIT_PARTMIN.Focus();
  1077. IDC_EDIT_PARTMIN.SelectAll();
  1078. return false;
  1079. }
  1080. if ("" == IDC_EDIT_PARTMAX.Text)
  1081. {
  1082. string message = table["message19"].ToString();
  1083. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1084. IDC_EDIT_PARTMAX.Focus();
  1085. IDC_EDIT_PARTMAX.SelectAll();
  1086. return false;
  1087. }
  1088. if ("" == IDC_COMBO_XRAYSCANMODE.Text)
  1089. {
  1090. string message = table["message20"].ToString();
  1091. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1092. IDC_COMBO_XRAYSCANMODE.Focus();
  1093. IDC_COMBO_XRAYSCANMODE.SelectAll();
  1094. return false;
  1095. }
  1096. if ("" == IDC_COMBO_ANALYXRAYSPEED.Text)
  1097. {
  1098. string message = table["message21"].ToString();
  1099. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1100. IDC_COMBO_ANALYXRAYSPEED.Focus();
  1101. IDC_COMBO_ANALYXRAYSPEED.SelectAll();
  1102. return false;
  1103. }
  1104. if ("" == IDC_EDIT_ANALYXRAYAIMVALUE.Text)
  1105. {
  1106. string message = table["message22"].ToString();
  1107. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1108. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1109. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1110. return false;
  1111. }
  1112. if ("" == tBMeasArea.Text)
  1113. {
  1114. string message = table["message62"].ToString();
  1115. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1116. tBMeasArea.Focus();
  1117. tBMeasArea.SelectAll();
  1118. return false;
  1119. }
  1120. //string pat = @"^(-|\+)?\d{1,8}$";//只能输入1到3位的正负整数
  1121. string pat = @"^-?[0-9]\d*$";//只能限定正负整数,包含0
  1122. string scope = @"^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$";
  1123. string PositiveDecimals = @"^(([1-9]\d*)(\.\d+)?)$|^0\.\d*[1-9]$"; //正浮点数
  1124. Regex rg = new Regex(pat);
  1125. Regex rgScope = new Regex(scope);
  1126. Regex rgPositiveDecimals = new Regex(PositiveDecimals);
  1127. //是否是正确的数值格式类型判断
  1128. //100倍时屏幕尺寸
  1129. if (false == rg.Match(IDC_EDIT_SCREENWIDTH.Text.Trim()).Success)
  1130. {
  1131. IDC_EDIT_SCREENWIDTH.Focus();
  1132. IDC_EDIT_SCREENWIDTH.SelectAll();
  1133. string message = table["message23"].ToString();
  1134. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1135. return false;
  1136. }
  1137. //x轴行程/mm 起
  1138. if (false == rg.Match(IDC_EDIT_XSTART.Text.Trim()).Success)
  1139. {
  1140. IDC_EDIT_XSTART.Focus();
  1141. IDC_EDIT_XSTART.SelectAll();
  1142. string message = table["message24"].ToString();
  1143. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1144. return false;
  1145. }
  1146. //x轴行程/mm 止
  1147. if (false == rg.Match(IDC_EDIT_XEND.Text.Trim()).Success)
  1148. {
  1149. IDC_EDIT_XEND.Focus();
  1150. IDC_EDIT_XEND.SelectAll();
  1151. string message = table["message25"].ToString();
  1152. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1153. return false;
  1154. }
  1155. //y轴行程/mm 起
  1156. if (false == rg.Match(IDC_EDIT_YSTART.Text.Trim()).Success)
  1157. {
  1158. IDC_EDIT_YSTART.Focus();
  1159. IDC_EDIT_YSTART.SelectAll();
  1160. string message = table["message26"].ToString();
  1161. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1162. return false;
  1163. }
  1164. //y轴行程/mm 止
  1165. if (false == rg.Match(IDC_EDIT_YEND.Text.Trim()).Success)
  1166. {
  1167. IDC_EDIT_YEND.Focus();
  1168. IDC_EDIT_YEND.SelectAll();
  1169. string message = table["message27"].ToString();
  1170. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1171. return false;
  1172. }
  1173. //终止时间
  1174. if (false == rg.Match(IDC_EDIT_STOP_TIME.Text.Trim()).Success)
  1175. {
  1176. IDC_EDIT_STOP_TIME.Focus();
  1177. IDC_EDIT_STOP_TIME.SelectAll();
  1178. string message = table["message28"].ToString();
  1179. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1180. return false;
  1181. }
  1182. //终止帧图数
  1183. if (false == rg.Match(IDC_EDIT_STOP_FIELD_NUM.Text.Trim()).Success)
  1184. {
  1185. IDC_EDIT_STOP_FIELD_NUM.Focus();
  1186. IDC_EDIT_STOP_FIELD_NUM.SelectAll();
  1187. string message = table["message29"].ToString();
  1188. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1189. return false;
  1190. }
  1191. //终止夹杂物数
  1192. if (false == rg.Match(IDC_EDIT_STOP_INCA_NUM.Text.Trim()).Success)
  1193. {
  1194. IDC_EDIT_STOP_INCA_NUM.Focus();
  1195. IDC_EDIT_STOP_INCA_NUM.SelectAll();
  1196. string message = table["message30"].ToString();
  1197. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1198. return false;
  1199. }
  1200. //颗粒面积范围 最小
  1201. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMIN.Text.Trim()).Success)
  1202. {
  1203. IDC_EDIT_PARTAREAMIN.Focus();
  1204. IDC_EDIT_PARTAREAMIN.SelectAll();
  1205. string message = table["message31"].ToString();
  1206. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1207. return false;
  1208. }
  1209. //颗粒面积范围 最大
  1210. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMAX.Text.Trim()).Success)
  1211. {
  1212. IDC_EDIT_PARTAREAMAX.Focus();
  1213. IDC_EDIT_PARTAREAMAX.SelectAll();
  1214. string message = table["message32"].ToString();
  1215. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1216. return false;
  1217. }
  1218. //背景灰度范围 最小
  1219. if (false == rg.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1220. {
  1221. IDC_EDIT_BACKMIN.Focus();
  1222. IDC_EDIT_BACKMIN.SelectAll();
  1223. string message = table["message33"].ToString();
  1224. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1225. return false;
  1226. }
  1227. else
  1228. {
  1229. if (false == rgScope.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1230. {
  1231. IDC_EDIT_BACKMIN.Focus();
  1232. IDC_EDIT_BACKMIN.SelectAll();
  1233. string message = table["message34"].ToString();
  1234. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1235. return false;
  1236. }
  1237. }
  1238. //背景灰度范围 最大
  1239. if (false == rg.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1240. {
  1241. IDC_EDIT_BACKMAX.Focus();
  1242. IDC_EDIT_BACKMAX.SelectAll();
  1243. string message = table["message35"].ToString();
  1244. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1245. return false;
  1246. }
  1247. else
  1248. {
  1249. if (false == rgScope.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1250. {
  1251. IDC_EDIT_BACKMAX.Focus();
  1252. IDC_EDIT_BACKMAX.SelectAll();
  1253. string message = table["message36"].ToString();
  1254. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1255. return false;
  1256. }
  1257. }
  1258. //颗粒灰度范围 最小
  1259. if (false == rg.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1260. {
  1261. IDC_EDIT_PARTMIN.Focus();
  1262. IDC_EDIT_PARTMIN.SelectAll();
  1263. string message = table["message37"].ToString();
  1264. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1265. return false;
  1266. }
  1267. else
  1268. {
  1269. if (false == rgScope.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1270. {
  1271. IDC_EDIT_PARTMIN.Focus();
  1272. IDC_EDIT_PARTMIN.SelectAll();
  1273. string message = table["message38"].ToString();
  1274. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1275. return false;
  1276. }
  1277. }
  1278. //颗粒灰度范围 最大
  1279. if (false == rg.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1280. {
  1281. IDC_EDIT_PARTMAX.Focus();
  1282. IDC_EDIT_PARTMAX.SelectAll();
  1283. string message = table["message39"].ToString();
  1284. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1285. return false;
  1286. }
  1287. else
  1288. {
  1289. if (false == rgScope.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1290. {
  1291. IDC_EDIT_PARTMAX.Focus();
  1292. IDC_EDIT_PARTMAX.SelectAll();
  1293. string message = table["message40"].ToString();
  1294. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1295. return false;
  1296. }
  1297. }
  1298. //分析X-ray计数期望值 最大
  1299. if (false == rg.Match(IDC_EDIT_ANALYXRAYAIMVALUE.Text.Trim()).Success)
  1300. {
  1301. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1302. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1303. string message = table["message41"].ToString();
  1304. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1305. return false;
  1306. }
  1307. //分析X-ray精度对应的时间
  1308. if (false == rg.Match(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()).Success)
  1309. {
  1310. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Focus();
  1311. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.SelectAll();
  1312. string message = table["message42"].ToString();
  1313. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1314. return false;
  1315. }
  1316. if (false == rgPositiveDecimals.Match(IDC_EDIT_QuantifyMinSize.Text.Trim()).Success)
  1317. {
  1318. IDC_EDIT_QuantifyMinSize.Focus();
  1319. IDC_EDIT_QuantifyMinSize.SelectAll();
  1320. string message = table["message63"].ToString();
  1321. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1322. return false;
  1323. }
  1324. if (false == rg.Match(IDC_EDIT_SmallPartAQTime.Text.Trim()).Success)
  1325. {
  1326. IDC_EDIT_SmallPartAQTime.Focus();
  1327. IDC_EDIT_SmallPartAQTime.SelectAll();
  1328. string message = table["message64"].ToString();
  1329. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1330. return false;
  1331. }
  1332. pat = @"^[0-9]+(\.[0-9]{1,3})?$"; //只能输入,1到3位小数的正数
  1333. rg = new Regex(pat);
  1334. //最小放大倍数
  1335. if (false == rg.Match(IDC_EDIT_MINMAG.Text.Trim()).Success)
  1336. {
  1337. IDC_EDIT_MINMAG.Focus();
  1338. IDC_EDIT_MINMAG.SelectAll();
  1339. string message = table["message43"].ToString();
  1340. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1341. return false;
  1342. }
  1343. //最小放大倍数不得小于45倍
  1344. if (Convert.ToInt32(IDC_EDIT_MINMAG.Text.Trim()) < 45)
  1345. {
  1346. IDC_EDIT_MINMAG.Focus();
  1347. IDC_EDIT_MINMAG.SelectAll();
  1348. string message = "The minimum magnification cannot be less than 45 times";
  1349. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1350. return false;
  1351. }
  1352. //再限制,x轴,y轴,的起止的,输入长度,因为现在已经有在mm和um之间的转换,所以这里要限制一下
  1353. //x轴行程/mm 起
  1354. if (IDC_EDIT_XSTART.Text.Length > 4)
  1355. {
  1356. IDC_EDIT_XSTART.Focus();
  1357. IDC_EDIT_XSTART.SelectAll();
  1358. string message = table["message44"].ToString();
  1359. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1360. return false;
  1361. }
  1362. //x轴行程/mm 止
  1363. if (IDC_EDIT_XEND.Text.Length > 4)
  1364. {
  1365. IDC_EDIT_XEND.Focus();
  1366. IDC_EDIT_XEND.SelectAll();
  1367. string message = table["message45"].ToString();
  1368. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1369. return false;
  1370. }
  1371. //y轴行程/mm 起
  1372. if (IDC_EDIT_YSTART.Text.Length > 4)
  1373. {
  1374. IDC_EDIT_YSTART.Focus();
  1375. IDC_EDIT_YSTART.SelectAll();
  1376. string message = table["message46"].ToString();
  1377. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1378. return false;
  1379. }
  1380. //y轴行程/mm 止
  1381. if (IDC_EDIT_YEND.Text.Length > 4)
  1382. {
  1383. IDC_EDIT_YEND.Focus();
  1384. IDC_EDIT_YEND.SelectAll();
  1385. string message = table["message47"].ToString();
  1386. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1387. return false;
  1388. }
  1389. if (Convert.ToInt32(IDC_EDIT_XSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_XEND.Text.Trim()))
  1390. {
  1391. IDC_EDIT_XEND.Focus();
  1392. IDC_EDIT_XEND.SelectAll();
  1393. string message = table["message50"].ToString();
  1394. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1395. return false;
  1396. }
  1397. if (Convert.ToInt32(IDC_EDIT_YSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_YEND.Text.Trim()))
  1398. {
  1399. IDC_EDIT_YEND.Focus();
  1400. IDC_EDIT_YEND.SelectAll();
  1401. string message = table["message53"].ToString();
  1402. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1403. return false;
  1404. }
  1405. //颗粒尺寸范围
  1406. if (Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text.Trim()) > Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text.Trim()))
  1407. {
  1408. IDC_EDIT_PARTAREAMIN.Focus();
  1409. IDC_EDIT_PARTAREAMIN.SelectAll();
  1410. string message = table["message56"].ToString();
  1411. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1412. return false;
  1413. }
  1414. //背景灰度范围
  1415. if (Convert.ToInt32(IDC_EDIT_BACKMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_BACKMAX.Text.Trim()))
  1416. {
  1417. IDC_EDIT_BACKMIN.Focus();
  1418. IDC_EDIT_BACKMIN.SelectAll();
  1419. string message = table["message57"].ToString();
  1420. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1421. return false;
  1422. }
  1423. //颗粒灰度范围
  1424. if (Convert.ToInt32(IDC_EDIT_PARTMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_PARTMAX.Text.Trim()))
  1425. {
  1426. IDC_EDIT_PARTMIN.Focus();
  1427. IDC_EDIT_PARTMIN.SelectAll();
  1428. string message = table["message58"].ToString();
  1429. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1430. return false;
  1431. }
  1432. return true;
  1433. }
  1434. /// <summary>
  1435. /// 判断当前样品台是否在被修改
  1436. /// </summary>
  1437. /// <returns></returns>
  1438. public bool IsModified()
  1439. {
  1440. return m_cstagefile.IsModified();
  1441. }
  1442. /// <summary>
  1443. /// 样品台保存
  1444. /// </summary>
  1445. /// <returns></returns>
  1446. public bool StageSave()
  1447. {
  1448. if (!m_cstagefile.Save())
  1449. {
  1450. log.Error("(OTSProgMgrInfoFun.StageLoad) Failed to save sample station information!");
  1451. return false;
  1452. }
  1453. return true;
  1454. }
  1455. private void btnok_Click(object sender, EventArgs e)
  1456. {
  1457. //先判断
  1458. if (false == CheckSetupValues(1))
  1459. {
  1460. return;
  1461. }
  1462. //先把各个值都保存到各类
  1463. m_cotsprogmgrparamfile.m_runmode = (RunMode)IDC_COMBO_Model.SelectedIndex;
  1464. SaveSEMStageData();
  1465. SaveImageScanPrm();
  1466. SaveCGenParam();
  1467. SaveImageProc();
  1468. SaveXRayParam();
  1469. //然后再把各类传入到SaveInfoToProgMgrFile函数中
  1470. if (false == SaveInfoToProgMgrFile())
  1471. {
  1472. return;
  1473. }
  1474. //保存样品台到文件,在被修改时进行保存
  1475. if (true == IsModified())
  1476. {
  1477. if (true == StageSave())
  1478. {
  1479. this.DialogResult = DialogResult.OK;
  1480. this.Close();
  1481. return;
  1482. }
  1483. else
  1484. {
  1485. string message = table["message54"].ToString();
  1486. log.Error("(ProgMgrInfoForm.btnok_Click) " + message);
  1487. this.Close();
  1488. return;
  1489. }
  1490. }
  1491. }
  1492. //关闭窗体
  1493. private void btncancel_Click(object sender, EventArgs e)
  1494. {
  1495. this.Close();
  1496. }
  1497. #endregion
  1498. #region 选择样品台事件
  1499. private void IDC_COMBO_STAGE_SelectedIndexChanged(object sender, EventArgs e)
  1500. {
  1501. //样品台
  1502. if (!StageLoad())
  1503. {
  1504. this.Close();
  1505. return;//加载失败返回
  1506. }
  1507. ThisSetIsModify();
  1508. //加载相关参数信息
  1509. //StageLoad();
  1510. //LoadSEMStageData();
  1511. //LoadImageScanPrm();
  1512. //LoadCGenParam();
  1513. //LoadImageProc();
  1514. //LoadXRayParam();
  1515. }
  1516. /// <summary>
  1517. /// 通过id设置当前正在工作的样品台
  1518. /// </summary>
  1519. /// <param name="id"></param>
  1520. public void SetWorkingStageId(int id)
  1521. {
  1522. m_cstagefile.SetWorkingStageId(id);
  1523. }
  1524. /// <summary>
  1525. /// 设置当前样品台正在被修改中
  1526. /// </summary>
  1527. /// <param name="yn"></param>
  1528. public void SetModify(bool yn)
  1529. {
  1530. m_cstagefile.SetModify(true);
  1531. }
  1532. /// <summary>
  1533. /// 设置当前窗体可以保存了
  1534. /// </summary>
  1535. private void ThisSetIsModify()
  1536. {
  1537. ComboBoxItem cbi = new ComboBoxItem();
  1538. if (IDC_COMBO_STAGE.Items.Count > 0)
  1539. if (null != IDC_COMBO_STAGE.SelectedItem)
  1540. {
  1541. cbi = (ComboBoxItem)IDC_COMBO_STAGE.SelectedItem;
  1542. SetWorkingStageId(Convert.ToInt32(cbi.Value));
  1543. SetModify(true);
  1544. btnok.Enabled = true;
  1545. }
  1546. }
  1547. #endregion
  1548. #region 监视控件改变状态事件
  1549. private void IDC_EDIT_SCREENWIDTH_TextChanged(object sender, EventArgs e)
  1550. {
  1551. ThisSetIsModify();
  1552. }
  1553. private void IDC_COMBO_XDIREC_SelectedIndexChanged(object sender, EventArgs e)
  1554. {
  1555. ThisSetIsModify();
  1556. }
  1557. private void IDC_EDIT_XSTART_TextChanged(object sender, EventArgs e)
  1558. {
  1559. ThisSetIsModify();
  1560. }
  1561. private void IDC_EDIT_XEND_TextChanged(object sender, EventArgs e)
  1562. {
  1563. ThisSetIsModify();
  1564. }
  1565. private void IDC_COMBO_YDIRECT_SelectedIndexChanged(object sender, EventArgs e)
  1566. {
  1567. ThisSetIsModify();
  1568. }
  1569. private void IDC_EDIT_YSTART_TextChanged(object sender, EventArgs e)
  1570. {
  1571. ThisSetIsModify();
  1572. }
  1573. private void IDC_EDIT_YEND_TextChanged(object sender, EventArgs e)
  1574. {
  1575. ThisSetIsModify();
  1576. }
  1577. private void IDC_EDIT_MINMAG_TextChanged(object sender, EventArgs e)
  1578. {
  1579. ThisSetIsModify();
  1580. }
  1581. private void IDC_COMBO_STOPMODE_SelectedIndexChanged(object sender, EventArgs e)
  1582. {
  1583. ThisSetIsModify();
  1584. }
  1585. private void IDC_EDIT_STOP_TIME_TextChanged(object sender, EventArgs e)
  1586. {
  1587. ThisSetIsModify();
  1588. }
  1589. private void IDC_EDIT_STOP_FIELD_NUM_TextChanged(object sender, EventArgs e)
  1590. {
  1591. ThisSetIsModify();
  1592. }
  1593. private void IDC_EDIT_STOP_INCA_NUM_TextChanged(object sender, EventArgs e)
  1594. {
  1595. ThisSetIsModify();
  1596. }
  1597. private void IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged(object sender, EventArgs e)
  1598. {
  1599. ThisSetIsModify();
  1600. }
  1601. private void IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1602. {
  1603. ThisSetIsModify();
  1604. }
  1605. private void IDC_COMBO_IMGSIZE_SelectedIndexChanged(object sender, EventArgs e)
  1606. {
  1607. ThisSetIsModify();
  1608. }
  1609. private void IDC_EDIT_SAMPLENAME_TextChanged(object sender, EventArgs e)
  1610. {
  1611. ThisSetIsModify();
  1612. }
  1613. private void IDC_MEAS_SWITCH_CheckedChanged(object sender, EventArgs e)
  1614. {
  1615. ThisSetIsModify();
  1616. }
  1617. private void IDC_EDIT_MEASUREPARAMPATH_TextChanged(object sender, EventArgs e)
  1618. {
  1619. ThisSetIsModify();
  1620. }
  1621. private void IDC_EDIT_ANALYSESTDLIBPATH_TextChanged(object sender, EventArgs e)
  1622. {
  1623. ThisSetIsModify();
  1624. }
  1625. private void IDC_EDIT_STDLIBNAME_TextChanged(object sender, EventArgs e)
  1626. {
  1627. ThisSetIsModify();
  1628. }
  1629. private void IDC_EDIT_PARTAREAMIN_TextChanged(object sender, EventArgs e)
  1630. {
  1631. ThisSetIsModify();
  1632. }
  1633. private void IDC_EDIT_PARTAREAMAX_TextChanged(object sender, EventArgs e)
  1634. {
  1635. ThisSetIsModify();
  1636. }
  1637. private void IDC_EDIT_BACKMIN_TextChanged(object sender, EventArgs e)
  1638. {
  1639. ThisSetIsModify();
  1640. }
  1641. private void IDC_EDIT_BACKMAX_TextChanged(object sender, EventArgs e)
  1642. {
  1643. ThisSetIsModify();
  1644. }
  1645. private void IDC_EDIT_PARTMIN_TextChanged(object sender, EventArgs e)
  1646. {
  1647. ThisSetIsModify();
  1648. }
  1649. private void IDC_EDIT_PARTMAX_TextChanged(object sender, EventArgs e)
  1650. {
  1651. ThisSetIsModify();
  1652. }
  1653. private void IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1654. {
  1655. ThisSetIsModify();
  1656. }
  1657. private void IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1658. {
  1659. ComboBox cbBGREMOVETYPE = (ComboBox)sender;
  1660. int selectValue=Convert.ToInt32(((OTSMeasureApp.ComboBoxItem)cbBGREMOVETYPE.Items[cbBGREMOVETYPE.SelectedIndex]).Value);
  1661. if (selectValue == (int)otsdataconst.OTS_AUTOBGREMOVETYPE.MANUAL)
  1662. {
  1663. IDC_COMBO_AUTOBGREMOVETYP.Enabled = false;
  1664. }
  1665. else
  1666. {
  1667. IDC_COMBO_AUTOBGREMOVETYP.Enabled = true;
  1668. }
  1669. ThisSetIsModify();
  1670. }
  1671. private void IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1672. {
  1673. ThisSetIsModify();
  1674. }
  1675. private void IDC_EDIT_SEARCHXRAYCOUNTLIMIT_TextChanged(object sender, EventArgs e)
  1676. {
  1677. ThisSetIsModify();
  1678. }
  1679. private void IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged(object sender, EventArgs e)
  1680. {
  1681. ThisSetIsModify();
  1682. }
  1683. private void IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1684. {
  1685. ThisSetIsModify();
  1686. }
  1687. private void IDC_EDIT_ANALYXRAYAIMVALUE_TextChanged(object sender, EventArgs e)
  1688. {
  1689. ThisSetIsModify();
  1690. }
  1691. //选择颗粒标准库下拉框
  1692. //private void IDC_COMBO_STDLIBSELECT_SelectedIndexChanged(object sender, EventArgs e)
  1693. //{
  1694. // ComboBoxItem cbi = new ComboBoxItem();
  1695. // cbi = (ComboBoxItem)IDC_COMBO_STDLIBSELECT.SelectedItem;
  1696. // ThisSetIsModify();
  1697. //}
  1698. private void IDC_COMBO_TECHNOLOGY_SelectedIndexChanged(object sender, EventArgs e)
  1699. {
  1700. ThisSetIsModify();
  1701. }
  1702. private void IDC_STOP_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1703. {
  1704. ThisSetIsModify();
  1705. }
  1706. private void IDC_STOP_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1707. {
  1708. ThisSetIsModify();
  1709. }
  1710. private void IDC_STOP_FIELD_SWITCH_CheckedChanged(object sender, EventArgs e)
  1711. {
  1712. ThisSetIsModify();
  1713. }
  1714. private void IDC_STOP_PARTICAL_SWITCH_CheckedChanged(object sender, EventArgs e)
  1715. {
  1716. ThisSetIsModify();
  1717. }
  1718. private void IDC_FETCH_IMAGE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1719. {
  1720. ThisSetIsModify();
  1721. }
  1722. private void IDC_SCAN_SPEED_SWITCH_CheckedChanged(object sender, EventArgs e)
  1723. {
  1724. ThisSetIsModify();
  1725. }
  1726. private void IDC_IMAGE_SIZE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1727. {
  1728. ThisSetIsModify();
  1729. }
  1730. private void IDC_PART_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1731. {
  1732. ThisSetIsModify();
  1733. }
  1734. private void IDC_PART_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1735. {
  1736. ThisSetIsModify();
  1737. }
  1738. private void IDC_BACK_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1739. {
  1740. ThisSetIsModify();
  1741. }
  1742. private void IDC_BACK_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1743. {
  1744. ThisSetIsModify();
  1745. }
  1746. private void IDC_PART_GRAY_SWITCH_CheckedChanged(object sender, EventArgs e)
  1747. {
  1748. ThisSetIsModify();
  1749. }
  1750. private void IDC_PART_GRAY_MAX_CheckedChanged(object sender, EventArgs e)
  1751. {
  1752. ThisSetIsModify();
  1753. }
  1754. private void IDC_XRAY_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1755. {
  1756. ThisSetIsModify();
  1757. }
  1758. private void IDC_XRAY_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1759. {
  1760. ThisSetIsModify();
  1761. }
  1762. private void IDC_XRAY_COUNT_SWITCH_CheckedChanged(object sender, EventArgs e)
  1763. {
  1764. ThisSetIsModify();
  1765. }
  1766. private void cBMeasShape_SelectedIndexChanged(object sender, EventArgs e)
  1767. {
  1768. ThisSetIsModify();
  1769. }
  1770. private void tBMeasArea_TextChanged(object sender, EventArgs e)
  1771. {
  1772. ThisSetIsModify();
  1773. }
  1774. private void IDC_SYS_LIB_CheckedChanged(object sender, EventArgs e)
  1775. {
  1776. ThisSetIsModify();
  1777. }
  1778. #endregion
  1779. private void IDC_COMBO_STDSelect_SelectedIndexChanged(object sender, EventArgs e)
  1780. {
  1781. ThisSetIsModify();
  1782. }
  1783. private void IDC_COMBO_USINGXRAYS_SelectedIndexChanged(object sender, EventArgs e)
  1784. {
  1785. ThisSetIsModify();
  1786. }
  1787. private void IDC_COMBO_Model_SelectedIndexChanged(object sender, EventArgs e)
  1788. {
  1789. ThisSetIsModify();
  1790. }
  1791. private void button1_Click(object sender, EventArgs e)
  1792. {
  1793. System.Diagnostics.Process.Start("notepad.exe",CSpecialGrayRangeParam.GetParamFileFullName());
  1794. }
  1795. }
  1796. public class ComboBoxItem
  1797. {
  1798. private string _text = null;
  1799. private object _value = null;
  1800. public string Text { get { return this._text; } set { this._text = value; } }
  1801. public object Value { get { return this._value; } set { this._value = value; } }
  1802. public override string ToString()
  1803. {
  1804. return this._text;
  1805. }
  1806. }
  1807. }