ProgMgrInfoForm.cs 81 KB

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