ProgMgrInfoForm.cs 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109
  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. frmMeasureStopMode 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. if (StopModeDialog == null)
  406. {
  407. StopModeDialog = new frmMeasureStopMode();
  408. StopModeDialog.FieldMode = m_cotsimgscanprm.GetStopParamFields();
  409. StopModeDialog.TimeMode = m_cotsimgscanprm.GetStopParamMeasTime();
  410. StopModeDialog.ParticleMode = m_cotsimgscanprm.GetStopParamParticles();
  411. StopModeDialog.AreaMode = m_cotsimgscanprm.GetStopParamArea();
  412. StopModeDialog.StopMode = tB_StopMode.Text;
  413. }
  414. //取图方式
  415. foreach (ComboBoxItem cbi in IDC_COMBO_FETCHIMGMODE.Items)
  416. {
  417. if (cbi.Value.ToString() != "")
  418. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetFieldStartMode())
  419. {
  420. IDC_COMBO_FETCHIMGMODE.SelectedItem = cbi;
  421. }
  422. }
  423. //扫描图精度
  424. foreach (ComboBoxItem cbi in IDC_COMBO_IMGSCANSPEED.Items)
  425. {
  426. if (cbi.Value.ToString() != "")
  427. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetScanImageSpeed())
  428. {
  429. IDC_COMBO_IMGSCANSPEED.SelectedItem = cbi;
  430. }
  431. }
  432. //扫描图尺寸
  433. foreach (ComboBoxItem cbi in IDC_COMBO_IMGSIZE.Items)
  434. {
  435. if (cbi.Value.ToString() != "")
  436. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetImageResulotion())
  437. {
  438. IDC_COMBO_IMGSIZE.SelectedItem = cbi;
  439. }
  440. }
  441. }
  442. /// <summary>
  443. /// 加载一般常规参数
  444. /// </summary>
  445. public void LoadCGenParam()
  446. {
  447. //样品名
  448. IDC_EDIT_SAMPLENAME.Text = m_cgenparam.GetSampleName().ToString();
  449. //执行开关
  450. IDC_MEAS_SWITCH.Checked = m_cgenparam.GetMeasurementSwitch();
  451. //是否使用系统库开关
  452. IDC_SYS_LIB.Checked = m_cgenparam.GetSysSTD();
  453. //测量参数文件夹
  454. IDC_EDIT_MEASUREPARAMPATH.Text = m_cgenparam.GetMsrParamFileFolderName().ToString();
  455. //颗粒分析标准库文件夹
  456. IDC_EDIT_ANALYSESTDLIBPATH.Text = m_cgenparam.GetPartSTDLibFolderName().ToString();
  457. //选择颗粒分析标准库
  458. foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
  459. {
  460. if (cbi.Value.ToString() != "")
  461. if (Convert.ToInt32(cbi.Value) == m_cgenparam.GetPartStdLibTypeIndex())
  462. {
  463. //IDC_COMBO_TECHNOLOGY.SelectedItem = cbi;
  464. }
  465. }
  466. //精炼工艺选项
  467. foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
  468. {
  469. if (cbi.Value.ToString() != "")
  470. if (Convert.ToInt32(cbi.Value) == m_cgenparam.GetSteelTechnology())
  471. {
  472. IDC_COMBO_TECHNOLOGY.SelectedItem = cbi;
  473. }
  474. }
  475. //测量区域形状
  476. foreach (ComboBoxItem cbi in cBMeasShape.Items)
  477. {
  478. if (cbi.Value.ToString() != "")
  479. if (Convert.ToInt32(cbi.Value) == (int)m_cgenparam.GetShape())
  480. {
  481. cBMeasShape.SelectedItem = cbi;
  482. }
  483. }
  484. //测量区域面积
  485. tBMeasArea.Text = m_cgenparam.GetArea().ToString();
  486. //标准库选择
  487. foreach (ComboBoxItem cbi in IDC_COMBO_STDSelect.Items)
  488. {
  489. if (cbi.Text.ToString() != "")
  490. if (cbi.Text.ToString() == m_cgenparam.GetSTDSelect())
  491. {
  492. IDC_COMBO_STDSelect.SelectedItem = cbi;
  493. }
  494. }
  495. }
  496. /// <summary>
  497. /// 加载默认参数
  498. /// </summary>
  499. public void LoadDefaultParam()
  500. {
  501. //模式
  502. foreach (OTSPeriodicTable.ComboBoxItem cbi in IDC_COMBO_Model.Items)
  503. {
  504. if (cbi.Value.ToString() != "")
  505. if (Convert.ToInt32(cbi.Value) == (int)m_cotsprogmgrparamfile.GetRunMode())
  506. {
  507. IDC_COMBO_Model.SelectedItem = cbi;
  508. }
  509. }
  510. }
  511. /// <summary>
  512. /// 加载图像处理参数
  513. /// </summary>
  514. public void LoadImageProc()
  515. {
  516. //颗粒面积范围 最小
  517. IDC_EDIT_PARTAREAMIN.Text = m_cotsimgprocprm.GetIncAreaRange().GetStart().ToString();
  518. //颗粒面积范围 最大
  519. IDC_EDIT_PARTAREAMAX.Text = m_cotsimgprocprm.GetIncAreaRange().GetEnd().ToString();
  520. //背景灰度范围 最小
  521. IDC_EDIT_BACKMIN.Text = m_cotsimgprocprm.GetBGGray().GetStart().ToString();
  522. //背景灰度范围 最大
  523. IDC_EDIT_BACKMAX.Text = m_cotsimgprocprm.GetBGGray().GetEnd().ToString();
  524. //颗粒灰度范围 最小
  525. IDC_EDIT_PARTMIN.Text = m_cotsimgprocprm.GetParticleGray().GetStart().ToString();
  526. //颗粒灰度范围 最大
  527. IDC_EDIT_PARTMAX.Text = m_cotsimgprocprm.GetParticleGray().GetEnd().ToString();
  528. //腐蚀膨胀系数
  529. IDC_COMBO_CorrosionExpansionCoefficient.Text=m_cotsimgprocprm.GetErrodDilateParam().ToString();
  530. //去背景方式
  531. foreach (ComboBoxItem cbi in IDC_COMBO_BGREMOVETYPE.Items)
  532. {
  533. if (cbi.Value.ToString() != "")
  534. {
  535. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgprocprm.GetBGRemoveType())
  536. {
  537. IDC_COMBO_BGREMOVETYPE.SelectedItem = cbi;
  538. break;
  539. }
  540. }
  541. }
  542. foreach (ComboBoxItem cbi in IDC_COMBO_AUTOBGREMOVETYP.Items)
  543. {
  544. if (cbi.Value.ToString() != "")
  545. {
  546. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgprocprm.GetAutoBGRemoveType())
  547. {
  548. IDC_COMBO_AUTOBGREMOVETYP.SelectedItem = cbi;
  549. break;
  550. }
  551. }
  552. }
  553. }
  554. /// <summary>
  555. /// 加载X-Ray参数
  556. /// </summary>
  557. public void LoadXRayParam()
  558. {
  559. //搜索X-ray精度
  560. //foreach (ComboBoxItem cbi in IDC_COMBO_SEARCHXRAYSPEED.Items)
  561. //{
  562. // if (cbi.Value.ToString() != "")
  563. // if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetSearchSpeed())
  564. // {
  565. // IDC_COMBO_SEARCHXRAYSPEED.SelectedItem = cbi;
  566. // }
  567. //}
  568. //搜索X-ray精度对应的时间
  569. IDC_TEXTBOX_SEARCHXRAYSPEED_TIME.Text = m_cotsxrayprm.GetMidSearchAQTime().ToString();
  570. //搜索X-ray最低计数
  571. //IDC_EDIT_SEARCHXRAYCOUNTLIMIT.Text = m_cotsxrayprm.GetXRaySearchCount().ToString();
  572. //X-ray扫描方式
  573. foreach (ComboBoxItem cbi in IDC_COMBO_XRAYSCANMODE.Items)
  574. {
  575. if (cbi.Value.ToString() != "")
  576. if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetScanMode())
  577. {
  578. IDC_COMBO_XRAYSCANMODE.SelectedItem = cbi;
  579. }
  580. }
  581. //是否使用电镜
  582. IDC_USINGXRAY_LIB.Checked = m_cotsxrayprm.GetUsingXray();
  583. //分析X-ray精度
  584. //foreach (ComboBoxItem cbi in IDC_COMBO_ANALYXRAYSPEED.Items)
  585. //{
  586. // if (cbi.Value.ToString() != "")
  587. // if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetAnalySpeed())
  588. // {
  589. // IDC_COMBO_ANALYXRAYSPEED.SelectedItem = cbi;
  590. // }
  591. //}
  592. //分析X-ray精度对应的时间
  593. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text = m_cotsxrayprm.GetMidAnalyAQTime().ToString();
  594. //分析X-ray计数期望值
  595. IDC_EDIT_ANALYXRAYAIMVALUE.Text = m_cotsxrayprm.GetAnalyExpCount().ToString();
  596. IDC_EDIT_QuantifyMinSize.Text = m_cotsxrayprm.GetFeatureModeMinSize().ToString();
  597. IDC_EDIT_SmallPartAQTime.Text = m_cotsxrayprm.GetFastXrayTime().ToString();
  598. IDC_EDIT_XrayLimit.Text = m_cotsxrayprm.GetXrayLimit().ToString();
  599. //IDC_XRAY_MODE_SWITCH.Checked = m_cotsxrayprm.GetShowScanMode();
  600. //IDC_XRAY_TIME_SWITCH.Checked = m_cotsxrayprm.GetShowSpeed();
  601. //IDC_XRAY_COUNT_SWITCH.Checked = m_cotsxrayprm.GetShowExpCount();
  602. }
  603. /// <summary>
  604. /// 保存SEM样品台参数
  605. /// </summary>
  606. public void SaveSEMStageData()
  607. {
  608. //100倍时屏幕尺寸/mm
  609. m_csemstagedata.SetScanFieldSize100(Convert.ToInt32(IDC_EDIT_SCREENWIDTH.Text));
  610. //x轴方向
  611. ComboBoxItem cbi_x = (ComboBoxItem)IDC_COMBO_XDIREC.SelectedItem;
  612. m_csemstagedata.SetXAxisDir((otsdataconst.OTS_X_AXIS_DIRECTION)Convert.ToInt32(cbi_x.Value));
  613. //x轴行程/mm 起,始
  614. CIntRange crc_x = new CIntRange(Convert.ToInt32(IDC_EDIT_XSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_XEND.Text) * 1000);
  615. m_csemstagedata.SetXAxis(crc_x);
  616. //y轴方向
  617. ComboBoxItem cbi_y = (ComboBoxItem)IDC_COMBO_YDIRECT.SelectedItem;
  618. m_csemstagedata.SetYAxisDir((otsdataconst.OTS_Y_AXIS_DIRECTION)Convert.ToInt32(cbi_y.Value));
  619. //y轴行程/mm 起,始
  620. CIntRange crc_y = new CIntRange(Convert.ToInt32(IDC_EDIT_YSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_YEND.Text) * 1000);
  621. m_csemstagedata.SetYAxis(crc_y);
  622. //最小放大倍数
  623. m_csemstagedata.SetMinMag(Convert.ToDouble(IDC_EDIT_MINMAG.Text));
  624. }
  625. /// <summary>
  626. /// 保存图像扫描参数
  627. /// </summary>
  628. public void SaveImageScanPrm()
  629. {
  630. // 保存图像扫描参数");
  631. //测量终止方式
  632. m_cotsimgscanprm.SetStopMode(tB_StopMode.Text);
  633. //终止时间
  634. m_cotsimgscanprm.SetStopParamMeasTime(StopModeDialog.TimeMode);
  635. ////终止帧图数
  636. m_cotsimgscanprm.SetStopParamFields(StopModeDialog.FieldMode);
  637. ////终止夹杂物数
  638. m_cotsimgscanprm.SetStopParamParticles(StopModeDialog.ParticleMode);
  639. ////终止面积
  640. m_cotsimgscanprm.SetStopParamArea(StopModeDialog.AreaMode);
  641. //取图方式
  642. ComboBoxItem enum_fetchimgmode = (ComboBoxItem)IDC_COMBO_FETCHIMGMODE.SelectedItem;
  643. m_cotsimgscanprm.SetStartImageMode((otsdataconst.OTS_GET_IMAGE_MODE)Convert.ToInt32(enum_fetchimgmode.Value));
  644. //扫描图精度
  645. ComboBoxItem enum_imgscanspeed = (ComboBoxItem)IDC_COMBO_IMGSCANSPEED.SelectedItem;
  646. m_cotsimgscanprm.SetScanImageSpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_imgscanspeed.Value));
  647. //扫描图尺寸
  648. ComboBoxItem enum_imgsize = (ComboBoxItem)IDC_COMBO_IMGSIZE.SelectedItem;
  649. m_cotsimgscanprm.SetImageResulotion((otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS)Convert.ToInt32(enum_imgsize.Value));
  650. }
  651. /// <summary>
  652. /// 保存一般常规参数
  653. /// </summary>
  654. public void SaveCGenParam()
  655. {
  656. //样品名
  657. m_cgenparam.SetSampleName(IDC_EDIT_SAMPLENAME.Text);
  658. //执行开关
  659. m_cgenparam.SetMeasurementSwitch(IDC_MEAS_SWITCH.Checked);
  660. //是否使用系统库
  661. m_cgenparam.SetSysSTD(IDC_SYS_LIB.Checked);
  662. //测量参数文件夹
  663. m_cgenparam.SetMsrParamFileFolderName(IDC_EDIT_MEASUREPARAMPATH.Text);
  664. //颗粒分析标准库文件夹
  665. m_cgenparam.SetPartSTDLibFolderName(IDC_EDIT_ANALYSESTDLIBPATH.Text);
  666. //获取精炼工艺索引
  667. ComboBoxItem cbiTECH = new ComboBoxItem();
  668. cbiTECH = (ComboBoxItem)IDC_COMBO_TECHNOLOGY.SelectedItem;
  669. //设置参数文件类中精炼工艺索引值
  670. m_cgenparam.SetSteelTechnology((int)cbiTECH.Value);
  671. //测量区域形状
  672. ComboBoxItem enum_Shape = (ComboBoxItem)cBMeasShape.SelectedItem;
  673. m_cgenparam.SetShape((otsdataconst.DOMAIN_SHAPE)Convert.ToInt32(enum_Shape.Value));
  674. //测量区域大小
  675. m_cgenparam.SetArea(Convert.ToDouble(tBMeasArea.Text));
  676. //标准库选择
  677. ComboBoxItem enum_STDLIBSELECT = (ComboBoxItem)IDC_COMBO_STDSelect.SelectedItem;
  678. m_cgenparam.SetSTDSelect(enum_STDLIBSELECT.Text.ToString());
  679. }
  680. /// <summary>
  681. /// 保存图像处理参数
  682. /// </summary>
  683. public void SaveImageProc()
  684. {
  685. //颗粒面积范围 最小 最大
  686. CDoubleRange crc_partareamin = new CDoubleRange(Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text), 2), Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text), 2));
  687. m_cotsimgprocprm.SetIncAreaRange(crc_partareamin);
  688. //背景灰度范围 最小 最大
  689. CIntRange crc_backmin = new CIntRange(Convert.ToInt32(IDC_EDIT_BACKMIN.Text), Convert.ToInt32(IDC_EDIT_BACKMAX.Text));
  690. m_cotsimgprocprm.SetBGGray(crc_backmin);
  691. //颗粒灰度范围 最小 最大
  692. CIntRange crc_partmin = new CIntRange(Convert.ToInt32(IDC_EDIT_PARTMIN.Text), Convert.ToInt32(IDC_EDIT_PARTMAX.Text));
  693. m_cotsimgprocprm.SetParticleGray(crc_partmin);
  694. //去背景方式
  695. ComboBoxItem enum_BGREMOVETYPE = (ComboBoxItem)IDC_COMBO_BGREMOVETYPE.SelectedItem;
  696. m_cotsimgprocprm.SetBGRemoveType((otsdataconst.OTS_BGREMOVE_TYPE)enum_BGREMOVETYPE.Value);
  697. //去背景方式
  698. ComboBoxItem enum_AUTOBGREMOVETYP = (ComboBoxItem)IDC_COMBO_AUTOBGREMOVETYP.SelectedItem;
  699. m_cotsimgprocprm.SetAutoBGRemoveType((otsdataconst.OTS_AUTOBGREMOVE_TYPE)enum_AUTOBGREMOVETYP.Value);
  700. //腐蚀膨胀系数
  701. m_cotsimgprocprm.SetErrodDilateParam(Convert.ToInt32(IDC_COMBO_CorrosionExpansionCoefficient.Text));
  702. }
  703. /// <summary>
  704. /// 保存X-Ray参数
  705. /// </summary>
  706. public void SaveXRayParam()
  707. {
  708. //搜索X-ray精度
  709. ComboBoxItem enum_searchxrayspeed = (ComboBoxItem)IDC_COMBO_SEARCHXRAYSPEED.SelectedItem;
  710. //m_cotsxrayprm.SetSearchSpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_searchxrayspeed.Value));
  711. //搜索X - ray精度对应的时间
  712. m_cotsxrayprm.SetMidSearchAQTime(Convert.ToInt32(IDC_TEXTBOX_SEARCHXRAYSPEED_TIME.Text.Trim()));
  713. //搜索X-ray最低计数
  714. //m_cotsxrayprm.SetXRaySearchCount(Convert.ToInt32(IDC_EDIT_SEARCHXRAYCOUNTLIMIT.Text));
  715. //X-ray扫描方式
  716. ComboBoxItem enum_xrayscanmode = (ComboBoxItem)IDC_COMBO_XRAYSCANMODE.SelectedItem;
  717. m_cotsxrayprm.SetScanMode((otsdataconst.OTS_X_RAY_SCAN_MODE)Convert.ToInt32(enum_xrayscanmode.Value));
  718. //是否使用X-ray
  719. m_cotsxrayprm.SetUsingXray(IDC_USINGXRAY_LIB.Checked);
  720. //分析X-ray精度
  721. //ComboBoxItem enum_analyxrayspeed = (ComboBoxItem)IDC_COMBO_ANALYXRAYSPEED.SelectedItem;
  722. //m_cotsxrayprm.SetAnalySpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_analyxrayspeed.Value));
  723. //分析X-ray精度对应的时间
  724. m_cotsxrayprm.SetMidAnalyAQTime(Convert.ToInt32(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()));
  725. //分析X-ray计数期望值
  726. m_cotsxrayprm.SetAnalyExpCount(Convert.ToInt32(IDC_EDIT_ANALYXRAYAIMVALUE.Text));
  727. m_cotsxrayprm.SetQuantifyMinSize(Convert.ToDouble(IDC_EDIT_QuantifyMinSize.Text));
  728. m_cotsxrayprm.SetFastXrayTime(Convert.ToInt32(IDC_EDIT_SmallPartAQTime.Text));
  729. m_cotsxrayprm.SetXrayLimit(Convert.ToInt32(IDC_EDIT_XrayLimit.Text));
  730. //m_cotsxrayprm.SetShowScanMode(IDC_XRAY_MODE_SWITCH.Checked);
  731. //m_cotsxrayprm.SetShowSpeed(IDC_XRAY_TIME_SWITCH.Checked);
  732. //m_cotsxrayprm.SetShowExpCount(IDC_XRAY_COUNT_SWITCH.Checked);
  733. }
  734. /// <summary>
  735. /// 将参数保存到文件
  736. /// </summary>
  737. /// <param name="a_nPackId"></param>
  738. /// <param name="a_pStageData"></param>
  739. /// <param name="a_pGenParam"></param>
  740. /// <param name="a_pImageScanParam"></param>
  741. /// <param name="a_pImageProcParam"></param>
  742. /// <param name="a_pXRayParam"></param>
  743. /// <returns></returns>
  744. public bool SaveInfoToProgMgrFile()
  745. {
  746. //SaveInfoToProgMgrFile()
  747. if (false == m_cotsprogmgrparamfile.SaveInfoToProgMgrFile())
  748. {
  749. log.Error("(OTSProgMgrInfoFun.SaveInfoToProgMgrFile) Failed to save parameters to file");
  750. return false;
  751. }
  752. return true;
  753. }
  754. /// <summary>
  755. /// 加载参数各个类
  756. /// </summary>
  757. public bool LoadParamFun()
  758. {
  759. bool result = m_cotsprogmgrparamfile.LoadInfoFromProgMgrFile();
  760. if (!result)
  761. {
  762. log.Error("(OTSProgMgrInfoFun.LoadParamFun) LoadInfoFromProgMgrFile Failed");
  763. return false;
  764. }
  765. m_csemstagedata = m_cotsprogmgrparamfile.GetStageDataParam();
  766. if (null == m_csemstagedata)
  767. {
  768. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetStageData Failed");
  769. return false;
  770. }
  771. m_cotsimgscanprm = m_cotsprogmgrparamfile.GetImageScanParam();
  772. if (null == m_cotsimgscanprm)
  773. {
  774. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageScanParam Failed");
  775. return false;
  776. }
  777. m_cgenparam = m_cotsprogmgrparamfile.GetGenParam();
  778. if (null == m_cgenparam)
  779. {
  780. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetGenParam Failed");
  781. return false;
  782. }
  783. m_cotsimgprocprm = m_cotsprogmgrparamfile.GetImageProcParam();
  784. if (null == m_cotsimgprocprm)
  785. {
  786. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageProcParam Failed");
  787. return false;
  788. }
  789. m_cotsxrayprm = m_cotsprogmgrparamfile.GetXRayParam();
  790. if (null == m_cotsxrayprm)
  791. {
  792. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetXRayParam Failed");
  793. return false;
  794. }
  795. return true;
  796. }
  797. #endregion
  798. #region 窗体加载
  799. private void ProgMgrInfoForm_Load(object sender, EventArgs e)
  800. {
  801. //加载各参数类
  802. LoadParamFun();
  803. //初始化combobox下拉框列表
  804. BindComboBox();
  805. //加载相关参数信息
  806. LoadDefaultParam();
  807. LoadSEMStageData();
  808. LoadImageScanPrm();
  809. LoadCGenParam();
  810. LoadImageProc();
  811. LoadXRayParam();
  812. if (m_b_checkstagefile == false)
  813. btnok.Enabled = true;
  814. else
  815. btnok.Enabled = false;
  816. //获取特殊颗粒信息
  817. //DataTable dt = XMLoperate.GetXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData").Tables[0];
  818. //if (dt.Rows.Count != 0)
  819. //{
  820. // if (XMLoperate.GetXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData").Tables[0].Rows[0]["ToRun"].ToString() == "true")
  821. // {
  822. // checkBox_Run.Checked = true;
  823. // }
  824. // else
  825. // {
  826. // checkBox_Run.Checked = false;
  827. // }
  828. //}
  829. //关于路径定位问题
  830. this.folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
  831. string strb = ".\\Config\\SysData\\";
  832. string strc = ".\\Config\\ProData\\";
  833. string m_STDPath = strb;
  834. m_ParameterPath = strc;
  835. this.folderBrowserDialog1.SelectedPath = m_ParameterPath;
  836. IDC_EDIT_MEASUREPARAMPATH.Text = m_ParameterPath;
  837. IDC_EDIT_ANALYSESTDLIBPATH.Text = m_STDPath;
  838. if(m_cotsprogmgrparamfile.GetSysType() == "IncA")
  839. {
  840. label42.Visible = true;
  841. IDC_COMBO_TECHNOLOGY.Visible = true;
  842. }
  843. else
  844. {
  845. label42.Visible = false;
  846. IDC_COMBO_TECHNOLOGY.Visible = false;
  847. }
  848. }
  849. #endregion
  850. #region 各按钮控件点击事件
  851. private void IDC_BUTTON_KLFX_Click(object sender, EventArgs e)
  852. {
  853. try
  854. {
  855. if (IDC_COMBO_STDSelect.Text != "NoSTDDB")
  856. {
  857. Process p = System.Diagnostics.Process.Start(".\\OTSPartA_STDEditor.exe", Application.StartupPath + "\\Config\\SysData\\" + IDC_COMBO_STDSelect.Text+".db");
  858. p.WaitForExit();
  859. }
  860. else
  861. {
  862. string message = table["message55"].ToString();
  863. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  864. }
  865. }
  866. catch (Exception ex)
  867. {
  868. log.Error("OTSPartA_STDEditor:" + ex.ToString());
  869. }
  870. }
  871. private void IDC_BUTTON_MEASPRAMPATHSET_Click(object sender, EventArgs e)
  872. {
  873. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  874. {
  875. IDC_EDIT_MEASUREPARAMPATH.Text = folderBrowserDialog1.SelectedPath;
  876. }
  877. else {
  878. folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
  879. }
  880. }
  881. private void IDC_BUTTON_PARTSTDLIBPATHSET_Click(object sender, EventArgs e)
  882. {
  883. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  884. {
  885. IDC_EDIT_ANALYSESTDLIBPATH.Text = folderBrowserDialog1.SelectedPath;
  886. }
  887. else {
  888. folderBrowserDialog1.SelectedPath = IDC_EDIT_ANALYSESTDLIBPATH.Text;
  889. }
  890. }
  891. /// <summary>
  892. /// 弹出样品台管理窗体
  893. /// </summary>
  894. /// <param name="a_nPackId"></param>
  895. /// <param name="a_pStageFile"></param>
  896. /// <returns></returns>
  897. public void ShowStageDialogExport()
  898. {
  899. DlgStageMgr dlgStageMgr = new DlgStageMgr(m_cstagefile);
  900. dlgStageMgr.ShowDialog();
  901. return;
  902. }
  903. /// <summary>
  904. /// 保存样品台信息
  905. /// </summary>
  906. /// <returns></returns>
  907. public bool CStageFileClrSave()
  908. {
  909. if (m_cstagefile == null)
  910. {
  911. //报错
  912. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) Error saving sample station information!");
  913. }
  914. else
  915. {
  916. bool b_ret = m_cstagefile.Save();
  917. if (false == b_ret)
  918. {
  919. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) Error saving sample table information!");
  920. }
  921. }
  922. return false;
  923. }
  924. private void IDC_BUTTON_STAGE_Click(object sender, EventArgs e)
  925. {
  926. //弹出管理样品台管理窗体
  927. ShowStageDialogExport();
  928. //弹出后再保存样品台信息
  929. CStageFileClrSave();
  930. //刷新绑定样品台列表
  931. BindStageCombobox();
  932. //检测是否已经有修改
  933. ThisSetIsModify();
  934. }
  935. /// <summary>
  936. /// 判断各控件值是否正确
  937. /// </summary>
  938. /// <returns></returns>
  939. private bool CheckSetupValues(int bz)
  940. {
  941. if ("" == IDC_COMBO_STAGE.Text)
  942. {
  943. string message = table["message1"].ToString();
  944. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  945. IDC_COMBO_STAGE.Focus();
  946. IDC_COMBO_STAGE.SelectAll();
  947. return false;
  948. }
  949. if ("" == IDC_EDIT_SCREENWIDTH.Text)
  950. {
  951. string message = table["message2"].ToString();
  952. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  953. IDC_EDIT_SCREENWIDTH.Focus();
  954. IDC_EDIT_SCREENWIDTH.SelectAll();
  955. return false;
  956. }
  957. if ("" == IDC_COMBO_XDIREC.Text)
  958. {
  959. string message = table["message3"].ToString();
  960. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  961. IDC_COMBO_XDIREC.Focus();
  962. IDC_COMBO_XDIREC.SelectAll();
  963. return false;
  964. }
  965. if ("" == IDC_EDIT_XSTART.Text)
  966. {
  967. string message = table["message4"].ToString();
  968. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  969. IDC_EDIT_XSTART.Focus();
  970. IDC_EDIT_XSTART.SelectAll();
  971. return false;
  972. }
  973. if ("" == IDC_EDIT_XEND.Text)
  974. {
  975. string message = table["message4"].ToString();
  976. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  977. IDC_EDIT_XEND.Focus();
  978. IDC_EDIT_XEND.SelectAll();
  979. return false;
  980. }
  981. if ("" == IDC_COMBO_YDIRECT.Text)
  982. {
  983. string message = table["message5"].ToString();
  984. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  985. IDC_COMBO_YDIRECT.Focus();
  986. IDC_COMBO_YDIRECT.SelectAll();
  987. return false;
  988. }
  989. if ("" == IDC_EDIT_YSTART.Text)
  990. {
  991. string message = table["message6"].ToString();
  992. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  993. IDC_EDIT_YSTART.Focus();
  994. IDC_EDIT_YSTART.SelectAll();
  995. return false;
  996. }
  997. if ("" == IDC_EDIT_YEND.Text)
  998. {
  999. string message = table["message6"].ToString();
  1000. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1001. IDC_EDIT_YEND.Focus();
  1002. IDC_EDIT_YEND.SelectAll();
  1003. return false;
  1004. }
  1005. if ("" == tB_StopMode.Text)
  1006. {
  1007. string message = table["message7"].ToString();
  1008. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1009. //IDC_EDIT_STOP_TIME.Focus();
  1010. //IDC_EDIT_STOP_TIME.SelectAll();
  1011. return false;
  1012. }
  1013. if ("" == IDC_COMBO_FETCHIMGMODE.Text)
  1014. {
  1015. string message = table["message10"].ToString();
  1016. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1017. IDC_COMBO_FETCHIMGMODE.Focus();
  1018. IDC_COMBO_FETCHIMGMODE.SelectAll();
  1019. return false;
  1020. }
  1021. if ("" == IDC_COMBO_IMGSCANSPEED.Text)
  1022. {
  1023. string message = table["message11"].ToString();
  1024. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1025. IDC_COMBO_IMGSCANSPEED.Focus();
  1026. IDC_COMBO_IMGSCANSPEED.SelectAll();
  1027. return false;
  1028. }
  1029. if ("" == IDC_COMBO_IMGSIZE.Text)
  1030. {
  1031. string message = table["message12"].ToString();
  1032. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1033. IDC_COMBO_IMGSIZE.Focus();
  1034. IDC_COMBO_IMGSIZE.SelectAll();
  1035. return false;
  1036. }
  1037. if ("" == IDC_EDIT_MINMAG.Text)
  1038. {
  1039. string message = table["message13"].ToString();
  1040. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1041. IDC_EDIT_MINMAG.Focus();
  1042. IDC_EDIT_MINMAG.SelectAll();
  1043. return false;
  1044. }
  1045. if ("" == IDC_EDIT_PARTAREAMIN.Text)
  1046. {
  1047. string message = table["message14"].ToString();
  1048. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1049. IDC_EDIT_PARTAREAMIN.Focus();
  1050. IDC_EDIT_PARTAREAMIN.SelectAll();
  1051. return false;
  1052. }
  1053. if ("" == IDC_EDIT_PARTAREAMAX.Text)
  1054. {
  1055. string message = table["message15"].ToString();
  1056. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1057. IDC_EDIT_PARTAREAMAX.Focus();
  1058. IDC_EDIT_PARTAREAMAX.SelectAll();
  1059. return false;
  1060. }
  1061. if ("" == IDC_EDIT_BACKMIN.Text)
  1062. {
  1063. string message = table["message16"].ToString();
  1064. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1065. IDC_EDIT_BACKMIN.Focus();
  1066. IDC_EDIT_BACKMIN.SelectAll();
  1067. return false;
  1068. }
  1069. if ("" == IDC_EDIT_BACKMAX.Text)
  1070. {
  1071. string message = table["message17"].ToString();
  1072. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1073. IDC_EDIT_BACKMAX.Focus();
  1074. IDC_EDIT_BACKMAX.SelectAll();
  1075. return false;
  1076. }
  1077. if ("" == IDC_EDIT_PARTMIN.Text)
  1078. {
  1079. string message = table["message18"].ToString();
  1080. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1081. IDC_EDIT_PARTMIN.Focus();
  1082. IDC_EDIT_PARTMIN.SelectAll();
  1083. return false;
  1084. }
  1085. if ("" == IDC_EDIT_PARTMAX.Text)
  1086. {
  1087. string message = table["message19"].ToString();
  1088. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1089. IDC_EDIT_PARTMAX.Focus();
  1090. IDC_EDIT_PARTMAX.SelectAll();
  1091. return false;
  1092. }
  1093. if ("" == IDC_COMBO_XRAYSCANMODE.Text)
  1094. {
  1095. string message = table["message20"].ToString();
  1096. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1097. IDC_COMBO_XRAYSCANMODE.Focus();
  1098. IDC_COMBO_XRAYSCANMODE.SelectAll();
  1099. return false;
  1100. }
  1101. if ("" == IDC_COMBO_ANALYXRAYSPEED.Text)
  1102. {
  1103. string message = table["message21"].ToString();
  1104. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1105. IDC_COMBO_ANALYXRAYSPEED.Focus();
  1106. IDC_COMBO_ANALYXRAYSPEED.SelectAll();
  1107. return false;
  1108. }
  1109. if ("" == IDC_EDIT_ANALYXRAYAIMVALUE.Text)
  1110. {
  1111. string message = table["message22"].ToString();
  1112. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1113. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1114. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1115. return false;
  1116. }
  1117. if ("" == tBMeasArea.Text)
  1118. {
  1119. string message = table["message62"].ToString();
  1120. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1121. tBMeasArea.Focus();
  1122. tBMeasArea.SelectAll();
  1123. return false;
  1124. }
  1125. if ("" == IDC_COMBO_CorrosionExpansionCoefficient.Text)
  1126. {
  1127. string message = table["message62"].ToString();
  1128. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1129. IDC_COMBO_CorrosionExpansionCoefficient.Focus();
  1130. IDC_COMBO_CorrosionExpansionCoefficient.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. string positiveInteger = @"^?[0-9]\d*$";//只能限定正整数,包含0
  1138. string positiveOddNumber = @"[^1,3,5,7,9]";//只能限定正奇数
  1139. Regex rg = new Regex(pat);
  1140. Regex rgScope = new Regex(scope);
  1141. Regex rgPositiveDecimals = new Regex(PositiveDecimals);
  1142. Regex rgpositiveInteger = new Regex(positiveInteger);
  1143. Regex rgpositiveOddNumber = new Regex(positiveOddNumber);
  1144. //是否是正确的数值格式类型判断
  1145. if(IDC_COMBO_CorrosionExpansionCoefficient.Text!="0")
  1146. {
  1147. if (rgpositiveOddNumber.Match(IDC_COMBO_CorrosionExpansionCoefficient.Text.Trim()).Success)
  1148. {
  1149. IDC_COMBO_CorrosionExpansionCoefficient.Focus();
  1150. IDC_COMBO_CorrosionExpansionCoefficient.SelectAll();
  1151. string message = table["message66"].ToString();
  1152. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1153. return false;
  1154. }
  1155. }
  1156. //100倍时屏幕尺寸
  1157. if (false == rg.Match(IDC_EDIT_SCREENWIDTH.Text.Trim()).Success)
  1158. {
  1159. IDC_EDIT_SCREENWIDTH.Focus();
  1160. IDC_EDIT_SCREENWIDTH.SelectAll();
  1161. string message = table["message23"].ToString();
  1162. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1163. return false;
  1164. }
  1165. //x轴行程/mm 起
  1166. if (false == rg.Match(IDC_EDIT_XSTART.Text.Trim()).Success)
  1167. {
  1168. IDC_EDIT_XSTART.Focus();
  1169. IDC_EDIT_XSTART.SelectAll();
  1170. string message = table["message24"].ToString();
  1171. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1172. return false;
  1173. }
  1174. //x轴行程/mm 止
  1175. if (false == rg.Match(IDC_EDIT_XEND.Text.Trim()).Success)
  1176. {
  1177. IDC_EDIT_XEND.Focus();
  1178. IDC_EDIT_XEND.SelectAll();
  1179. string message = table["message25"].ToString();
  1180. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1181. return false;
  1182. }
  1183. //y轴行程/mm 起
  1184. if (false == rg.Match(IDC_EDIT_YSTART.Text.Trim()).Success)
  1185. {
  1186. IDC_EDIT_YSTART.Focus();
  1187. IDC_EDIT_YSTART.SelectAll();
  1188. string message = table["message26"].ToString();
  1189. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1190. return false;
  1191. }
  1192. //y轴行程/mm 止
  1193. if (false == rg.Match(IDC_EDIT_YEND.Text.Trim()).Success)
  1194. {
  1195. IDC_EDIT_YEND.Focus();
  1196. IDC_EDIT_YEND.SelectAll();
  1197. string message = table["message27"].ToString();
  1198. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1199. return false;
  1200. }
  1201. //颗粒面积范围 最小
  1202. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMIN.Text.Trim()).Success)
  1203. {
  1204. IDC_EDIT_PARTAREAMIN.Focus();
  1205. IDC_EDIT_PARTAREAMIN.SelectAll();
  1206. string message = table["message31"].ToString();
  1207. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1208. return false;
  1209. }
  1210. //颗粒面积范围 最大
  1211. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMAX.Text.Trim()).Success)
  1212. {
  1213. IDC_EDIT_PARTAREAMAX.Focus();
  1214. IDC_EDIT_PARTAREAMAX.SelectAll();
  1215. string message = table["message32"].ToString();
  1216. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1217. return false;
  1218. }
  1219. //背景灰度范围 最小
  1220. if (false == rg.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1221. {
  1222. IDC_EDIT_BACKMIN.Focus();
  1223. IDC_EDIT_BACKMIN.SelectAll();
  1224. string message = table["message33"].ToString();
  1225. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1226. return false;
  1227. }
  1228. else
  1229. {
  1230. if (false == rgScope.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1231. {
  1232. IDC_EDIT_BACKMIN.Focus();
  1233. IDC_EDIT_BACKMIN.SelectAll();
  1234. string message = table["message34"].ToString();
  1235. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1236. return false;
  1237. }
  1238. }
  1239. //背景灰度范围 最大
  1240. if (false == rg.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1241. {
  1242. IDC_EDIT_BACKMAX.Focus();
  1243. IDC_EDIT_BACKMAX.SelectAll();
  1244. string message = table["message35"].ToString();
  1245. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1246. return false;
  1247. }
  1248. else
  1249. {
  1250. if (false == rgScope.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1251. {
  1252. IDC_EDIT_BACKMAX.Focus();
  1253. IDC_EDIT_BACKMAX.SelectAll();
  1254. string message = table["message36"].ToString();
  1255. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1256. return false;
  1257. }
  1258. }
  1259. //颗粒灰度范围 最小
  1260. if (false == rg.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1261. {
  1262. IDC_EDIT_PARTMIN.Focus();
  1263. IDC_EDIT_PARTMIN.SelectAll();
  1264. string message = table["message37"].ToString();
  1265. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1266. return false;
  1267. }
  1268. else
  1269. {
  1270. if (false == rgScope.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1271. {
  1272. IDC_EDIT_PARTMIN.Focus();
  1273. IDC_EDIT_PARTMIN.SelectAll();
  1274. string message = table["message38"].ToString();
  1275. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1276. return false;
  1277. }
  1278. }
  1279. //颗粒灰度范围 最大
  1280. if (false == rg.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1281. {
  1282. IDC_EDIT_PARTMAX.Focus();
  1283. IDC_EDIT_PARTMAX.SelectAll();
  1284. string message = table["message39"].ToString();
  1285. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1286. return false;
  1287. }
  1288. else
  1289. {
  1290. if (false == rgScope.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1291. {
  1292. IDC_EDIT_PARTMAX.Focus();
  1293. IDC_EDIT_PARTMAX.SelectAll();
  1294. string message = table["message40"].ToString();
  1295. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1296. return false;
  1297. }
  1298. }
  1299. //分析X-ray计数期望值 最大
  1300. if (false == rg.Match(IDC_EDIT_ANALYXRAYAIMVALUE.Text.Trim()).Success)
  1301. {
  1302. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1303. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1304. string message = table["message41"].ToString();
  1305. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1306. return false;
  1307. }
  1308. //分析X-ray精度对应的时间
  1309. if (false == rg.Match(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()).Success)
  1310. {
  1311. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Focus();
  1312. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.SelectAll();
  1313. string message = table["message42"].ToString();
  1314. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1315. return false;
  1316. }
  1317. if (false == rgPositiveDecimals.Match(IDC_EDIT_QuantifyMinSize.Text.Trim()).Success)
  1318. {
  1319. IDC_EDIT_QuantifyMinSize.Focus();
  1320. IDC_EDIT_QuantifyMinSize.SelectAll();
  1321. string message = table["message63"].ToString();
  1322. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1323. return false;
  1324. }
  1325. if (false == rg.Match(IDC_EDIT_SmallPartAQTime.Text.Trim()).Success)
  1326. {
  1327. IDC_EDIT_SmallPartAQTime.Focus();
  1328. IDC_EDIT_SmallPartAQTime.SelectAll();
  1329. string message = table["message64"].ToString();
  1330. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1331. return false;
  1332. }
  1333. pat = @"^[0-9]+(\.[0-9]{1,3})?$"; //只能输入,1到3位小数的正数
  1334. rg = new Regex(pat);
  1335. //最小放大倍数
  1336. if (false == rg.Match(IDC_EDIT_MINMAG.Text.Trim()).Success)
  1337. {
  1338. IDC_EDIT_MINMAG.Focus();
  1339. IDC_EDIT_MINMAG.SelectAll();
  1340. string message = table["message43"].ToString();
  1341. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1342. return false;
  1343. }
  1344. ////最小放大倍数不得小于45倍
  1345. //if (Convert.ToInt32(IDC_EDIT_MINMAG.Text.Trim()) < 45)
  1346. //{
  1347. // IDC_EDIT_MINMAG.Focus();
  1348. // IDC_EDIT_MINMAG.SelectAll();
  1349. // string message = "The minimum magnification cannot be less than 45 times";
  1350. // MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1351. // return false;
  1352. //}
  1353. //再限制,x轴,y轴,的起止的,输入长度,因为现在已经有在mm和um之间的转换,所以这里要限制一下
  1354. //x轴行程/mm 起
  1355. if (IDC_EDIT_XSTART.Text.Length > 4)
  1356. {
  1357. IDC_EDIT_XSTART.Focus();
  1358. IDC_EDIT_XSTART.SelectAll();
  1359. string message = table["message44"].ToString();
  1360. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1361. return false;
  1362. }
  1363. //x轴行程/mm 止
  1364. if (IDC_EDIT_XEND.Text.Length > 4)
  1365. {
  1366. IDC_EDIT_XEND.Focus();
  1367. IDC_EDIT_XEND.SelectAll();
  1368. string message = table["message45"].ToString();
  1369. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1370. return false;
  1371. }
  1372. //y轴行程/mm 起
  1373. if (IDC_EDIT_YSTART.Text.Length > 4)
  1374. {
  1375. IDC_EDIT_YSTART.Focus();
  1376. IDC_EDIT_YSTART.SelectAll();
  1377. string message = table["message46"].ToString();
  1378. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1379. return false;
  1380. }
  1381. //y轴行程/mm 止
  1382. if (IDC_EDIT_YEND.Text.Length > 4)
  1383. {
  1384. IDC_EDIT_YEND.Focus();
  1385. IDC_EDIT_YEND.SelectAll();
  1386. string message = table["message47"].ToString();
  1387. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1388. return false;
  1389. }
  1390. if (Convert.ToInt32(IDC_EDIT_XSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_XEND.Text.Trim()))
  1391. {
  1392. IDC_EDIT_XEND.Focus();
  1393. IDC_EDIT_XEND.SelectAll();
  1394. string message = table["message50"].ToString();
  1395. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1396. return false;
  1397. }
  1398. if (Convert.ToInt32(IDC_EDIT_YSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_YEND.Text.Trim()))
  1399. {
  1400. IDC_EDIT_YEND.Focus();
  1401. IDC_EDIT_YEND.SelectAll();
  1402. string message = table["message53"].ToString();
  1403. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1404. return false;
  1405. }
  1406. //颗粒尺寸范围
  1407. if (Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text.Trim()) > Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text.Trim()))
  1408. {
  1409. IDC_EDIT_PARTAREAMIN.Focus();
  1410. IDC_EDIT_PARTAREAMIN.SelectAll();
  1411. string message = table["message56"].ToString();
  1412. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1413. return false;
  1414. }
  1415. //背景灰度范围
  1416. if (Convert.ToInt32(IDC_EDIT_BACKMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_BACKMAX.Text.Trim()))
  1417. {
  1418. IDC_EDIT_BACKMIN.Focus();
  1419. IDC_EDIT_BACKMIN.SelectAll();
  1420. string message = table["message57"].ToString();
  1421. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1422. return false;
  1423. }
  1424. //颗粒灰度范围
  1425. if (Convert.ToInt32(IDC_EDIT_PARTMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_PARTMAX.Text.Trim()))
  1426. {
  1427. IDC_EDIT_PARTMIN.Focus();
  1428. IDC_EDIT_PARTMIN.SelectAll();
  1429. string message = table["message58"].ToString();
  1430. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1431. return false;
  1432. }
  1433. //最小放大倍数
  1434. if (false == rgpositiveInteger.Match(IDC_EDIT_XrayLimit.Text.Trim()).Success)
  1435. {
  1436. IDC_EDIT_XrayLimit.Focus();
  1437. IDC_EDIT_XrayLimit.SelectAll();
  1438. string message = table["message64"].ToString();
  1439. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1440. return false;
  1441. }
  1442. return true;
  1443. }
  1444. /// <summary>
  1445. /// 判断当前样品台是否在被修改
  1446. /// </summary>
  1447. /// <returns></returns>
  1448. public bool IsModified()
  1449. {
  1450. return m_cstagefile.IsModified();
  1451. }
  1452. /// <summary>
  1453. /// 样品台保存
  1454. /// </summary>
  1455. /// <returns></returns>
  1456. public bool StageSave()
  1457. {
  1458. if (!m_cstagefile.Save())
  1459. {
  1460. log.Error("(OTSProgMgrInfoFun.StageLoad) Failed to save sample station information!");
  1461. return false;
  1462. }
  1463. return true;
  1464. }
  1465. private void btnok_Click(object sender, EventArgs e)
  1466. {
  1467. //先判断
  1468. if (false == CheckSetupValues(1))
  1469. {
  1470. return;
  1471. }
  1472. //先把各个值都保存到各类
  1473. m_cotsprogmgrparamfile.m_runmode = (RunMode)IDC_COMBO_Model.SelectedIndex;
  1474. SaveSEMStageData();
  1475. SaveImageScanPrm();
  1476. SaveCGenParam();
  1477. SaveImageProc();
  1478. SaveXRayParam();
  1479. //然后再把各类传入到SaveInfoToProgMgrFile函数中
  1480. if (false == SaveInfoToProgMgrFile())
  1481. {
  1482. return;
  1483. }
  1484. //保存样品台到文件,在被修改时进行保存
  1485. if (true == IsModified())
  1486. {
  1487. if (true == StageSave())
  1488. {
  1489. this.DialogResult = DialogResult.OK;
  1490. this.Close();
  1491. return;
  1492. }
  1493. else
  1494. {
  1495. string message = table["message54"].ToString();
  1496. log.Error("(ProgMgrInfoForm.btnok_Click) " + message);
  1497. this.Close();
  1498. return;
  1499. }
  1500. }
  1501. }
  1502. //关闭窗体
  1503. private void btncancel_Click(object sender, EventArgs e)
  1504. {
  1505. this.Close();
  1506. }
  1507. #endregion
  1508. #region 选择样品台事件
  1509. private void IDC_COMBO_STAGE_SelectedIndexChanged(object sender, EventArgs e)
  1510. {
  1511. //样品台
  1512. if (!StageLoad())
  1513. {
  1514. this.Close();
  1515. return;//加载失败返回
  1516. }
  1517. ThisSetIsModify();
  1518. //加载相关参数信息
  1519. //StageLoad();
  1520. //LoadSEMStageData();
  1521. //LoadImageScanPrm();
  1522. //LoadCGenParam();
  1523. //LoadImageProc();
  1524. //LoadXRayParam();
  1525. }
  1526. /// <summary>
  1527. /// 通过id设置当前正在工作的样品台
  1528. /// </summary>
  1529. /// <param name="id"></param>
  1530. public void SetWorkingStageId(int id)
  1531. {
  1532. m_cstagefile.SetWorkingStageId(id);
  1533. }
  1534. /// <summary>
  1535. /// 设置当前样品台正在被修改中
  1536. /// </summary>
  1537. /// <param name="yn"></param>
  1538. public void SetModify(bool yn)
  1539. {
  1540. m_cstagefile.SetModify(true);
  1541. }
  1542. /// <summary>
  1543. /// 设置当前窗体可以保存了
  1544. /// </summary>
  1545. private void ThisSetIsModify()
  1546. {
  1547. ComboBoxItem cbi = new ComboBoxItem();
  1548. if (IDC_COMBO_STAGE.Items.Count > 0)
  1549. if (null != IDC_COMBO_STAGE.SelectedItem)
  1550. {
  1551. cbi = (ComboBoxItem)IDC_COMBO_STAGE.SelectedItem;
  1552. SetWorkingStageId(Convert.ToInt32(cbi.Value));
  1553. SetModify(true);
  1554. btnok.Enabled = true;
  1555. }
  1556. }
  1557. #endregion
  1558. #region 监视控件改变状态事件
  1559. private void IDC_EDIT_SCREENWIDTH_TextChanged(object sender, EventArgs e)
  1560. {
  1561. ThisSetIsModify();
  1562. }
  1563. private void IDC_COMBO_XDIREC_SelectedIndexChanged(object sender, EventArgs e)
  1564. {
  1565. ThisSetIsModify();
  1566. }
  1567. private void IDC_EDIT_XSTART_TextChanged(object sender, EventArgs e)
  1568. {
  1569. ThisSetIsModify();
  1570. }
  1571. private void IDC_EDIT_XEND_TextChanged(object sender, EventArgs e)
  1572. {
  1573. ThisSetIsModify();
  1574. }
  1575. private void IDC_COMBO_YDIRECT_SelectedIndexChanged(object sender, EventArgs e)
  1576. {
  1577. ThisSetIsModify();
  1578. }
  1579. private void IDC_EDIT_YSTART_TextChanged(object sender, EventArgs e)
  1580. {
  1581. ThisSetIsModify();
  1582. }
  1583. private void IDC_EDIT_YEND_TextChanged(object sender, EventArgs e)
  1584. {
  1585. ThisSetIsModify();
  1586. }
  1587. private void IDC_EDIT_MINMAG_TextChanged(object sender, EventArgs e)
  1588. {
  1589. ThisSetIsModify();
  1590. }
  1591. private void IDC_COMBO_STOPMODE_SelectedIndexChanged(object sender, EventArgs e)
  1592. {
  1593. ThisSetIsModify();
  1594. }
  1595. private void IDC_EDIT_STOP_TIME_TextChanged(object sender, EventArgs e)
  1596. {
  1597. ThisSetIsModify();
  1598. }
  1599. private void IDC_EDIT_STOP_FIELD_NUM_TextChanged(object sender, EventArgs e)
  1600. {
  1601. ThisSetIsModify();
  1602. }
  1603. private void IDC_EDIT_STOP_INCA_NUM_TextChanged(object sender, EventArgs e)
  1604. {
  1605. ThisSetIsModify();
  1606. }
  1607. private void IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged(object sender, EventArgs e)
  1608. {
  1609. ThisSetIsModify();
  1610. }
  1611. private void IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1612. {
  1613. ThisSetIsModify();
  1614. }
  1615. private void IDC_COMBO_IMGSIZE_SelectedIndexChanged(object sender, EventArgs e)
  1616. {
  1617. ThisSetIsModify();
  1618. }
  1619. private void IDC_EDIT_SAMPLENAME_TextChanged(object sender, EventArgs e)
  1620. {
  1621. ThisSetIsModify();
  1622. }
  1623. private void IDC_MEAS_SWITCH_CheckedChanged(object sender, EventArgs e)
  1624. {
  1625. ThisSetIsModify();
  1626. }
  1627. private void IDC_EDIT_MEASUREPARAMPATH_TextChanged(object sender, EventArgs e)
  1628. {
  1629. ThisSetIsModify();
  1630. }
  1631. private void IDC_EDIT_ANALYSESTDLIBPATH_TextChanged(object sender, EventArgs e)
  1632. {
  1633. ThisSetIsModify();
  1634. }
  1635. private void IDC_EDIT_STDLIBNAME_TextChanged(object sender, EventArgs e)
  1636. {
  1637. ThisSetIsModify();
  1638. }
  1639. private void IDC_EDIT_PARTAREAMIN_TextChanged(object sender, EventArgs e)
  1640. {
  1641. ThisSetIsModify();
  1642. }
  1643. private void IDC_EDIT_PARTAREAMAX_TextChanged(object sender, EventArgs e)
  1644. {
  1645. ThisSetIsModify();
  1646. }
  1647. private void IDC_EDIT_BACKMIN_TextChanged(object sender, EventArgs e)
  1648. {
  1649. ThisSetIsModify();
  1650. }
  1651. private void IDC_EDIT_BACKMAX_TextChanged(object sender, EventArgs e)
  1652. {
  1653. ThisSetIsModify();
  1654. }
  1655. private void IDC_EDIT_PARTMIN_TextChanged(object sender, EventArgs e)
  1656. {
  1657. ThisSetIsModify();
  1658. }
  1659. private void IDC_EDIT_PARTMAX_TextChanged(object sender, EventArgs e)
  1660. {
  1661. ThisSetIsModify();
  1662. }
  1663. private void IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1664. {
  1665. ThisSetIsModify();
  1666. }
  1667. private void IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1668. {
  1669. ComboBox cbBGREMOVETYPE = (ComboBox)sender;
  1670. int selectValue=Convert.ToInt32(((OTSMeasureApp.ComboBoxItem)cbBGREMOVETYPE.Items[cbBGREMOVETYPE.SelectedIndex]).Value);
  1671. if (selectValue == (int)otsdataconst.OTS_AUTOBGREMOVETYPE.MANUAL)
  1672. {
  1673. IDC_COMBO_AUTOBGREMOVETYP.Enabled = false;
  1674. }
  1675. else
  1676. {
  1677. IDC_COMBO_AUTOBGREMOVETYP.Enabled = true;
  1678. }
  1679. ThisSetIsModify();
  1680. }
  1681. private void IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1682. {
  1683. ThisSetIsModify();
  1684. }
  1685. private void IDC_EDIT_SEARCHXRAYCOUNTLIMIT_TextChanged(object sender, EventArgs e)
  1686. {
  1687. ThisSetIsModify();
  1688. }
  1689. private void IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged(object sender, EventArgs e)
  1690. {
  1691. ThisSetIsModify();
  1692. }
  1693. private void IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1694. {
  1695. ThisSetIsModify();
  1696. }
  1697. private void IDC_EDIT_ANALYXRAYAIMVALUE_TextChanged(object sender, EventArgs e)
  1698. {
  1699. ThisSetIsModify();
  1700. }
  1701. //选择颗粒标准库下拉框
  1702. //private void IDC_COMBO_STDLIBSELECT_SelectedIndexChanged(object sender, EventArgs e)
  1703. //{
  1704. // ComboBoxItem cbi = new ComboBoxItem();
  1705. // cbi = (ComboBoxItem)IDC_COMBO_STDLIBSELECT.SelectedItem;
  1706. // ThisSetIsModify();
  1707. //}
  1708. private void IDC_COMBO_TECHNOLOGY_SelectedIndexChanged(object sender, EventArgs e)
  1709. {
  1710. ThisSetIsModify();
  1711. }
  1712. private void IDC_STOP_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1713. {
  1714. ThisSetIsModify();
  1715. }
  1716. private void IDC_STOP_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1717. {
  1718. ThisSetIsModify();
  1719. }
  1720. private void IDC_STOP_FIELD_SWITCH_CheckedChanged(object sender, EventArgs e)
  1721. {
  1722. ThisSetIsModify();
  1723. }
  1724. private void IDC_STOP_PARTICAL_SWITCH_CheckedChanged(object sender, EventArgs e)
  1725. {
  1726. ThisSetIsModify();
  1727. }
  1728. private void IDC_FETCH_IMAGE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1729. {
  1730. ThisSetIsModify();
  1731. }
  1732. private void IDC_SCAN_SPEED_SWITCH_CheckedChanged(object sender, EventArgs e)
  1733. {
  1734. ThisSetIsModify();
  1735. }
  1736. private void IDC_IMAGE_SIZE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1737. {
  1738. ThisSetIsModify();
  1739. }
  1740. private void IDC_PART_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1741. {
  1742. ThisSetIsModify();
  1743. }
  1744. private void IDC_PART_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1745. {
  1746. ThisSetIsModify();
  1747. }
  1748. private void IDC_BACK_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1749. {
  1750. ThisSetIsModify();
  1751. }
  1752. private void IDC_BACK_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1753. {
  1754. ThisSetIsModify();
  1755. }
  1756. private void IDC_PART_GRAY_SWITCH_CheckedChanged(object sender, EventArgs e)
  1757. {
  1758. ThisSetIsModify();
  1759. }
  1760. private void IDC_PART_GRAY_MAX_CheckedChanged(object sender, EventArgs e)
  1761. {
  1762. ThisSetIsModify();
  1763. }
  1764. private void IDC_XRAY_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1765. {
  1766. ThisSetIsModify();
  1767. }
  1768. private void IDC_XRAY_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1769. {
  1770. ThisSetIsModify();
  1771. }
  1772. private void IDC_XRAY_COUNT_SWITCH_CheckedChanged(object sender, EventArgs e)
  1773. {
  1774. ThisSetIsModify();
  1775. }
  1776. private void cBMeasShape_SelectedIndexChanged(object sender, EventArgs e)
  1777. {
  1778. ThisSetIsModify();
  1779. }
  1780. private void tBMeasArea_TextChanged(object sender, EventArgs e)
  1781. {
  1782. ThisSetIsModify();
  1783. }
  1784. private void IDC_SYS_LIB_CheckedChanged(object sender, EventArgs e)
  1785. {
  1786. ThisSetIsModify();
  1787. }
  1788. #endregion
  1789. private void IDC_COMBO_STDSelect_SelectedIndexChanged(object sender, EventArgs e)
  1790. {
  1791. ThisSetIsModify();
  1792. }
  1793. private void IDC_COMBO_USINGXRAYS_SelectedIndexChanged(object sender, EventArgs e)
  1794. {
  1795. ThisSetIsModify();
  1796. }
  1797. private void IDC_COMBO_Model_SelectedIndexChanged(object sender, EventArgs e)
  1798. {
  1799. ThisSetIsModify();
  1800. }
  1801. private void btn_StopMode_Click(object sender, EventArgs e)
  1802. {
  1803. if (StopModeDialog == null)
  1804. {
  1805. StopModeDialog = new frmMeasureStopMode();
  1806. StopModeDialog.FieldMode = m_cotsimgscanprm.GetStopParamFields();
  1807. StopModeDialog.TimeMode = m_cotsimgscanprm.GetStopParamMeasTime();
  1808. StopModeDialog.ParticleMode = m_cotsimgscanprm.GetStopParamParticles();
  1809. StopModeDialog.AreaMode = m_cotsimgscanprm.GetStopParamArea();
  1810. StopModeDialog.StopMode = tB_StopMode.Text;
  1811. }
  1812. DialogResult result = StopModeDialog.ShowDialog();
  1813. if (result == DialogResult.OK)
  1814. {
  1815. string[] rst = StopModeDialog.StopMode.Split(',');
  1816. string str = "";
  1817. for (int k = 0; k < rst.Length; k++)
  1818. {
  1819. str += rst[k].Split(':')[0] + " + ";
  1820. }
  1821. tB_StopMode.Text = str.Substring(0, str.Length - 3);
  1822. //IDC_EDIT_STOP_TIME.Text = StopModeDialog.TimeMode.ToString();
  1823. //IDC_EDIT_STOP_FIELD_NUM.Text = StopModeDialog.FieldMode.ToString();
  1824. //IDC_EDIT_STOP_INCA_NUM.Text = StopModeDialog.ParticleMode.ToString();
  1825. //IDC_EDIT_STOP_INCA_AREA.Text = StopModeDialog.AreaMode.ToString();
  1826. }
  1827. }
  1828. private void IDC_COMBO_CorrosionExpansionCoefficient_TextChanged(object sender, EventArgs e)
  1829. {
  1830. ThisSetIsModify();
  1831. }
  1832. private void button_SpPart_Click(object sender, EventArgs e)
  1833. {
  1834. //System.Diagnostics.Process.Start("notepad.exe", CSpecialGrayRangeParam.GetParamFileFullName());
  1835. //SpecialParticleForm specialParticleForm = new SpecialParticleForm(CSpecialGrayRangeParam.GetParamFileFullName());
  1836. //specialParticleForm.ShowDialog();
  1837. }
  1838. private void checkBox_Run_CheckedChanged(object sender, EventArgs e)
  1839. {
  1840. //if (checkBox_Run.Checked)
  1841. //{
  1842. // XMLoperate.UpdateXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData", "0", "ToRun", "true");
  1843. //}
  1844. //else
  1845. //{
  1846. // XMLoperate.UpdateXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData", "0", "ToRun", "false");
  1847. //}
  1848. }
  1849. }
  1850. public class ComboBoxItem
  1851. {
  1852. private string _text = null;
  1853. private object _value = null;
  1854. public string Text { get { return this._text; } set { this._text = value; } }
  1855. public object Value { get { return this._value; } set { this._value = value; } }
  1856. public override string ToString()
  1857. {
  1858. return this._text;
  1859. }
  1860. }
  1861. }