ProgMgrInfoForm.cs 81 KB

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