ProgMgrInfoForm.cs 80 KB

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