ProgMgrInfoForm.cs 82 KB

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