ProgMgrInfoForm.cs 80 KB

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