ProgMgrInfoForm.cs 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5. using System.Text.RegularExpressions;
  6. using System.Collections;
  7. using System.Diagnostics;
  8. using OTSDataType;
  9. using OTSModelSharp;
  10. using System.IO;
  11. using static OTSModelSharp.ResourceManage.ResourceData;
  12. using static OTSDataType.otsdataconst;
  13. using OTSModelSharp.Measure.GetStageInfo;
  14. using OTSMeasureApp._0_OTSModel.Measure.ParamData;
  15. using OTSMeasureApp._3_OTSDisplaySourceGridData;
  16. namespace OTSMeasureApp
  17. {
  18. public partial class ProgMgrInfoForm : Form
  19. {
  20. #region 定义变量
  21. //初始化函数功能类
  22. public CStage m_cstage; //样品台类
  23. public CStageParam m_cstagefile; //样品台文件类
  24. public COTSDefaultParam m_cotsprogmgrparamfile; //参数类
  25. public CSEMStageData m_csemstagedata; //SEM样品台处理类
  26. public COTSImgScanPrm m_cotsimgscanprm; //图像扫描类
  27. public COTSGeneralParam m_cgenparam; //一般参数类
  28. public COTSImageProcParam m_cotsimgprocprm; //图像处理类
  29. public COTSXRayParam m_cotsxrayprm;
  30. public bool m_b_checkstagefile = false;
  31. //定位程序管理路径用的变量
  32. public string m_ParameterPath;
  33. MeasureStopMode StopModeDialog;
  34. //国际化
  35. OTSSysMgrTools.Language lan;
  36. Hashtable table;
  37. NLog.Logger log ;
  38. #endregion
  39. /// <summary>
  40. /// 样品台加载
  41. /// </summary>
  42. /// <returns></returns>
  43. public bool StageLoad()
  44. {
  45. if (!m_cstagefile.Load( true, !m_b_checkstagefile))
  46. {
  47. log.Error("(OTSProgMgrInfoFun.StageLoad) 加载样品台信息失败");
  48. return false;
  49. }
  50. return true;
  51. }
  52. #region 构造函数
  53. /// <summary>
  54. /// 默认构造函数
  55. /// </summary>
  56. public ProgMgrInfoForm()
  57. {
  58. log = NLog.LogManager.GetCurrentClassLogger();
  59. m_cotsprogmgrparamfile = new COTSDefaultParam();
  60. m_cstagefile = new CStageParam();
  61. InitializeComponent();
  62. //国际化
  63. lan = new OTSSysMgrTools.Language(this);
  64. table = lan.GetNameTable(this.Name);
  65. }
  66. #endregion
  67. #region 绑定各combobox控件
  68. /// <summary>
  69. /// 绑定各combobox控件下拉列表
  70. /// </summary>
  71. public void BindComboBox()
  72. {
  73. //样品台
  74. if (!StageLoad())
  75. {
  76. this.Close();
  77. return;//加载失败返回
  78. }
  79. //绑定样品台列表信息
  80. BindStageCombobox();
  81. //初始化选项,下拉框---------------------------------------------
  82. //绑定标准库
  83. IDC_COMBO_STDSelect.Items.Clear();
  84. string STDLibFolderName = m_cgenparam.GetPartSTDLibFolderName();
  85. string[] files = System.IO.Directory.GetFiles(STDLibFolderName, "*.db");
  86. System.IO.DirectoryInfo folder = new System.IO.DirectoryInfo(STDLibFolderName);
  87. foreach (System.IO.FileInfo file in folder.GetFiles("*.db"))
  88. {
  89. ComboBoxItem cbi = new ComboBoxItem();
  90. string FileNameWithoutExtension = Path.GetFileNameWithoutExtension(file.FullName);
  91. cbi.Text = FileNameWithoutExtension;
  92. //cbi.Value = (int)enum_one;
  93. IDC_COMBO_STDSelect.Items.Add(cbi);
  94. }
  95. //添加下拉列表中null项
  96. ComboBoxItem cbiNull = new ComboBoxItem();
  97. cbiNull.Text = "NoSTDDB";
  98. //cbi.Value = (int)enum_one;
  99. IDC_COMBO_STDSelect.Items.Add(cbiNull);
  100. this.IDC_COMBO_STDSelect.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STDSelect_SelectedIndexChanged);
  101. if (IDC_COMBO_STDSelect.Items.Count > 0)
  102. IDC_COMBO_STDSelect.SelectedIndex = 0;
  103. //----------------------------------------------------------------------
  104. this.IDC_COMBO_STDSelect.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STDSelect_SelectedIndexChanged);
  105. //x轴方向
  106. IDC_COMBO_XDIREC.Items.Clear();
  107. foreach (otsdataconst.OTS_X_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(otsdataconst.OTS_X_AXIS_DIRECTION)))
  108. {
  109. ComboBoxItem cbi = new ComboBoxItem();
  110. cbi.Text = GetXAxisDirectionIdString(enum_one);
  111. cbi.Value = (int)enum_one;
  112. IDC_COMBO_XDIREC.Items.Add(cbi);
  113. }
  114. this.IDC_COMBO_XDIREC.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_XDIREC_SelectedIndexChanged);
  115. if (IDC_COMBO_XDIREC.Items.Count > 0)
  116. IDC_COMBO_XDIREC.SelectedIndex = 0;
  117. this.IDC_COMBO_XDIREC.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_XDIREC_SelectedIndexChanged);
  118. //y轴方向
  119. IDC_COMBO_YDIRECT.Items.Clear();
  120. foreach (otsdataconst.OTS_Y_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(otsdataconst.OTS_Y_AXIS_DIRECTION)))
  121. {
  122. ComboBoxItem cbi = new ComboBoxItem();
  123. cbi.Text = GetYAxisDirectionIdString(enum_one);
  124. cbi.Value = (int)enum_one;
  125. IDC_COMBO_YDIRECT.Items.Add(cbi);
  126. }
  127. this.IDC_COMBO_YDIRECT.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_YDIRECT_SelectedIndexChanged);
  128. if (IDC_COMBO_YDIRECT.Items.Count > 0)
  129. IDC_COMBO_YDIRECT.SelectedIndex = 0;
  130. this.IDC_COMBO_YDIRECT.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_YDIRECT_SelectedIndexChanged);
  131. ////测量终止方式
  132. //IDC_COMBO_STOPMODE.Items.Clear();
  133. //foreach (otsdataconst.OTS_MEASURE_STOP_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_MEASURE_STOP_MODE)))
  134. //{
  135. // ComboBoxItem cbi = new ComboBoxItem();
  136. // cbi.Text = GetStopModeIdString(enum_one);
  137. // cbi.Value = (int)enum_one;
  138. // IDC_COMBO_STOPMODE.Items.Add(cbi);
  139. //}
  140. //this.IDC_COMBO_STOPMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
  141. //if (IDC_COMBO_STOPMODE.Items.Count > 0)
  142. // IDC_COMBO_STOPMODE.SelectedIndex = 0;
  143. //this.IDC_COMBO_STOPMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
  144. //取图方式
  145. IDC_COMBO_FETCHIMGMODE.Items.Clear();
  146. foreach (otsdataconst.OTS_GET_IMAGE_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_GET_IMAGE_MODE)))
  147. {
  148. ComboBoxItem cbi = new ComboBoxItem();
  149. cbi.Text = GetGetImageIdString(enum_one);
  150. cbi.Value = (int)enum_one;
  151. IDC_COMBO_FETCHIMGMODE.Items.Add(cbi);
  152. }
  153. this.IDC_COMBO_FETCHIMGMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged);
  154. if (IDC_COMBO_FETCHIMGMODE.Items.Count > 0)
  155. IDC_COMBO_FETCHIMGMODE.SelectedIndex = 0;
  156. this.IDC_COMBO_FETCHIMGMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged);
  157. //扫描图精度
  158. IDC_COMBO_IMGSCANSPEED.Items.Clear();
  159. foreach (otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)))
  160. {
  161. ComboBoxItem cbi = new ComboBoxItem();
  162. cbi.Text = GetScanSpeedString(enum_one);
  163. cbi.Value = (int)enum_one;
  164. IDC_COMBO_IMGSCANSPEED.Items.Add(cbi);
  165. }
  166. this.IDC_COMBO_IMGSCANSPEED.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged);
  167. if (IDC_COMBO_IMGSCANSPEED.Items.Count > 0)
  168. IDC_COMBO_IMGSCANSPEED.SelectedIndex = 0;
  169. this.IDC_COMBO_IMGSCANSPEED.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged);
  170. //扫描图尺寸
  171. IDC_COMBO_IMGSIZE.Items.Clear();
  172. foreach (otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS)))
  173. {
  174. ComboBoxItem cbi = new ComboBoxItem();
  175. cbi.Text = GetImageSizeIdString(enum_one);
  176. cbi.Value = (int)enum_one;
  177. IDC_COMBO_IMGSIZE.Items.Add(cbi);
  178. }
  179. this.IDC_COMBO_IMGSIZE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_IMGSIZE_SelectedIndexChanged);
  180. if (IDC_COMBO_IMGSIZE.Items.Count > 0)
  181. IDC_COMBO_IMGSIZE.SelectedIndex = 0;
  182. this.IDC_COMBO_IMGSIZE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_IMGSIZE_SelectedIndexChanged);
  183. //搜索X-Ray精度
  184. IDC_COMBO_SEARCHXRAYSPEED.Items.Clear();
  185. foreach (otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)))
  186. {
  187. ComboBoxItem cbi = new ComboBoxItem();
  188. cbi.Text = GetXRaySearchSpeedIdString(enum_one);
  189. cbi.Value = (int)enum_one;
  190. IDC_COMBO_SEARCHXRAYSPEED.Items.Add(cbi);
  191. }
  192. this.IDC_COMBO_SEARCHXRAYSPEED.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged);
  193. if (IDC_COMBO_SEARCHXRAYSPEED.Items.Count > 0)
  194. IDC_COMBO_SEARCHXRAYSPEED.SelectedIndex = 0;
  195. this.IDC_COMBO_SEARCHXRAYSPEED.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged);
  196. //去背景方式
  197. IDC_COMBO_BGREMOVETYPE.Items.Clear();
  198. foreach (otsdataconst.OTS_AUTOBGREMOVETYPE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_AUTOBGREMOVETYPE)))
  199. {
  200. ComboBoxItem cbi = new ComboBoxItem();
  201. cbi.Text = GetBGREMOVETYPEString(enum_one);
  202. cbi.Value = (int)enum_one;
  203. IDC_COMBO_BGREMOVETYPE.Items.Add(cbi);
  204. }
  205. this.IDC_COMBO_BGREMOVETYPE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged);
  206. if (IDC_COMBO_BGREMOVETYPE.Items.Count > 0)
  207. IDC_COMBO_BGREMOVETYPE.SelectedIndex = 0;
  208. this.IDC_COMBO_BGREMOVETYPE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged);
  209. //自动去背景方式
  210. IDC_COMBO_AUTOBGREMOVETYP.Items.Clear();
  211. foreach (otsdataconst.OTS_IMAGE_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_MODE)))
  212. {
  213. ComboBoxItem cbi = new ComboBoxItem();
  214. cbi.Text = GetAUTOBGREMOVETYPEString(enum_one);
  215. cbi.Value = (int)enum_one;
  216. IDC_COMBO_AUTOBGREMOVETYP.Items.Add(cbi);
  217. }
  218. this.IDC_COMBO_AUTOBGREMOVETYP.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged);
  219. if (IDC_COMBO_AUTOBGREMOVETYP.Items.Count > 0)
  220. IDC_COMBO_AUTOBGREMOVETYP.SelectedIndex = 0;
  221. this.IDC_COMBO_AUTOBGREMOVETYP.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged);
  222. //腐蚀膨胀系数
  223. IDC_COMBO_CorrosionExpansionCoefficient.Items.Clear();
  224. ComboBoxItem ci = new ComboBoxItem();
  225. ci.Text = "0";
  226. ci.Value = 0;
  227. IDC_COMBO_CorrosionExpansionCoefficient.Items.Add(ci);
  228. for (int i=1;i<6;i++)
  229. {
  230. ComboBoxItem cbi = new ComboBoxItem();
  231. cbi.Text = (i*2+1).ToString();
  232. cbi.Value = i;
  233. IDC_COMBO_CorrosionExpansionCoefficient.Items.Add(cbi);
  234. }
  235. //this.IDC_COMBO_CorrosionExpansionCoefficient.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_CorrosionExpansionCoefficient_SelectedIndexChanged);
  236. //if (IDC_COMBO_CorrosionExpansionCoefficient.Items.Count > 0)
  237. // IDC_COMBO_CorrosionExpansionCoefficient.SelectedIndex = 0;
  238. //this.IDC_COMBO_CorrosionExpansionCoefficient.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_CorrosionExpansionCoefficient_SelectedIndexChanged);
  239. //X-Ray扫描方式
  240. IDC_COMBO_XRAYSCANMODE.Items.Clear();
  241. foreach (otsdataconst.OTS_X_RAY_SCAN_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_X_RAY_SCAN_MODE)))
  242. {
  243. ComboBoxItem cbi = new ComboBoxItem();
  244. cbi.Text = GetXRayScanModeIdString(enum_one);
  245. cbi.Value = (int)enum_one;
  246. //只添加点扫描
  247. IDC_COMBO_XRAYSCANMODE.Items.Add(cbi);
  248. }
  249. this.IDC_COMBO_XRAYSCANMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged);
  250. if (IDC_COMBO_XRAYSCANMODE.Items.Count > 0)
  251. IDC_COMBO_XRAYSCANMODE.SelectedIndex = 0;
  252. this.IDC_COMBO_XRAYSCANMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged);
  253. //分析X-Ray精度
  254. IDC_COMBO_ANALYXRAYSPEED.Items.Clear();
  255. foreach (otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)))
  256. {
  257. ComboBoxItem cbi = new ComboBoxItem();
  258. cbi.Text = GetXRayAnalySpeedIdString(enum_one);
  259. cbi.Value = (int)enum_one;
  260. IDC_COMBO_ANALYXRAYSPEED.Items.Add(cbi);
  261. }
  262. this.IDC_COMBO_ANALYXRAYSPEED.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged);
  263. if (IDC_COMBO_ANALYXRAYSPEED.Items.Count > 0)
  264. IDC_COMBO_ANALYXRAYSPEED.SelectedIndex = 0;
  265. this.IDC_COMBO_ANALYXRAYSPEED.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged);
  266. //精炼工艺下拉框选项
  267. IDC_COMBO_TECHNOLOGY.Items.Clear();
  268. foreach (STEEL_TECHNOLOGY enum_one in Enum.GetValues(typeof(STEEL_TECHNOLOGY)))
  269. {
  270. ComboBoxItem cbi = new ComboBoxItem();
  271. cbi.Text = GetSteelTechIdString((otsdataconst.STEEL_TECHNOLOGY)enum_one);
  272. cbi.Value = (int)enum_one;
  273. IDC_COMBO_TECHNOLOGY.Items.Add(cbi);
  274. }
  275. this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
  276. if (IDC_COMBO_TECHNOLOGY.Items.Count > 0)
  277. IDC_COMBO_TECHNOLOGY.SelectedIndex = 0;
  278. this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
  279. //测量区域形状
  280. cBMeasShape.Items.Clear();
  281. foreach (otsdataconst.MEASURE_SHAPE enum_one in Enum.GetValues(typeof(otsdataconst.MEASURE_SHAPE)))
  282. {
  283. ComboBoxItem cbi = new ComboBoxItem();
  284. cbi.Text = GetAreaShapeString(enum_one);
  285. cbi.Value = (int)enum_one;
  286. cBMeasShape.Items.Add(cbi);
  287. }
  288. this.cBMeasShape.SelectedIndexChanged -= new System.EventHandler(this.cBMeasShape_SelectedIndexChanged);
  289. if (cBMeasShape.Items.Count > 0)
  290. cBMeasShape.SelectedIndex = 0;
  291. this.cBMeasShape.SelectedIndexChanged += new System.EventHandler(this.cBMeasShape_SelectedIndexChanged);
  292. //模式选择
  293. IDC_COMBO_Model.Items.Clear();
  294. foreach (otsdataconst.RunMode enum_one in Enum.GetValues(typeof(otsdataconst.RunMode)))
  295. {
  296. OTSPeriodicTable.ComboBoxItem cbi = new OTSPeriodicTable.ComboBoxItem();
  297. cbi.Text = GetRunModeString(enum_one);
  298. cbi.Value = (int)enum_one;
  299. IDC_COMBO_Model.Items.Add(cbi);
  300. }
  301. this.IDC_COMBO_Model.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_Model_SelectedIndexChanged);
  302. if (IDC_COMBO_Model.Items.Count > 0)
  303. IDC_COMBO_Model.SelectedIndex = 0;
  304. this.IDC_COMBO_Model.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_Model_SelectedIndexChanged);
  305. }
  306. public CStage GetWorkingStage()
  307. {
  308. CStage ls_cstageclr = m_cstagefile.GetWorkingStage();
  309. if (null == ls_cstageclr)
  310. {
  311. log.Error("(OTSProgMgrInfoFun.GetWorkingStage) 获取正在工作的样品台类失败");
  312. return ls_cstageclr;
  313. }
  314. return ls_cstageclr;
  315. }
  316. /// <summary>
  317. /// 获取正在工作的样品台ID
  318. /// </summary>
  319. /// <returns></returns>
  320. public int GetWorkingStageId()
  321. {
  322. int stageid = m_cstagefile.GetWorkingStageId();
  323. return stageid;
  324. }
  325. /// <summary>
  326. /// 获取样品台信息列表
  327. /// </summary>
  328. /// <returns></returns>
  329. public List<CStage> GetStageList()
  330. {
  331. List<CStage> l_cstageclr = m_cstagefile.GetStagesList();
  332. if (null == l_cstageclr)
  333. {
  334. log.Error("(OTSProgMgrInfoFun.GetStageList) 获取样品台信息列表失败");
  335. return l_cstageclr;
  336. }
  337. return l_cstageclr;
  338. }
  339. /// <summary>
  340. /// 绑定样品台列表信息
  341. /// </summary>
  342. private void BindStageCombobox()
  343. {
  344. //先插入正在工作的样品台
  345. int ls_workingstageid = 0;
  346. IDC_COMBO_STAGE.Items.Clear();
  347. CStage ls_cstageclr = GetWorkingStage();
  348. ComboBoxItem ls_cbi = new ComboBoxItem();
  349. ls_cbi.Text = ls_cstageclr.GetName();
  350. ls_workingstageid = GetWorkingStageId();
  351. ls_cbi.Value = ls_workingstageid;
  352. IDC_COMBO_STAGE.Items.Add(ls_cbi);
  353. //添加其它的样品台信息
  354. List<CStage> l_cstageclr = GetStageList();
  355. for (int i = 0; i < l_cstageclr.Count(); i++)
  356. {
  357. if (ls_workingstageid != i)//将已经插入过的正在工作样品台信息跳过去
  358. {
  359. ComboBoxItem cbi = new ComboBoxItem();
  360. cbi.Text = l_cstageclr[i].GetName().ToString();
  361. cbi.Value = i.ToString();
  362. IDC_COMBO_STAGE.Items.Add(cbi);
  363. }
  364. }
  365. //防止进入窗体后,马上进入下拉项选择事件,先把事件去掉,一会再注册上
  366. this.IDC_COMBO_STAGE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STAGE_SelectedIndexChanged);
  367. //默认选择上
  368. if (IDC_COMBO_STAGE.Items.Count > 0)
  369. {
  370. IDC_COMBO_STAGE.SelectedIndex = 0;
  371. }
  372. this.IDC_COMBO_STAGE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STAGE_SelectedIndexChanged);
  373. }
  374. #endregion
  375. #region 参数相关方法封装
  376. /// <summary>
  377. /// 读取SEM样品台参数信息
  378. /// </summary>
  379. public void LoadSEMStageData()
  380. {
  381. //100倍时屏幕尺寸/mm
  382. IDC_EDIT_SCREENWIDTH.Text = m_csemstagedata.GetScanFieldSize100().ToString();
  383. //x轴方向
  384. foreach (ComboBoxItem cbi in IDC_COMBO_XDIREC.Items)
  385. {
  386. if (cbi.Value.ToString() != "")
  387. if (Convert.ToInt32(cbi.Value) == (int)m_csemstagedata.GetXAxisDir())
  388. {
  389. IDC_COMBO_XDIREC.SelectedItem = cbi;
  390. }
  391. }
  392. //x轴行程/mm 起,取值时,乘1000
  393. IDC_EDIT_XSTART.Text = (m_csemstagedata.GetXAxis().GetStart() / 1000).ToString();
  394. //x轴行程/mm 始
  395. IDC_EDIT_XEND.Text = (m_csemstagedata.GetXAxis().GetEnd() / 1000).ToString();
  396. //y轴方向
  397. foreach (ComboBoxItem cbi in IDC_COMBO_YDIRECT.Items)
  398. {
  399. if (cbi.Value.ToString() != "")
  400. if (Convert.ToInt32(cbi.Value) == (int)m_csemstagedata.GetYAxisDir())
  401. {
  402. IDC_COMBO_YDIRECT.SelectedItem = cbi;
  403. }
  404. }
  405. //y轴行程/mm 起
  406. IDC_EDIT_YSTART.Text = (m_csemstagedata.GetYAxis().GetStart() / 1000).ToString();
  407. //y轴行程/mm 始
  408. IDC_EDIT_YEND.Text = (m_csemstagedata.GetYAxis().GetEnd() / 1000).ToString();
  409. //最小放大倍数
  410. IDC_EDIT_MINMAG.Text = m_csemstagedata.GetMinMag().ToString();
  411. }
  412. /// <summary>
  413. /// 加载图像扫描参数
  414. /// </summary>
  415. public void LoadImageScanPrm()
  416. {
  417. //测量终止方式
  418. tB_StopMode.Text = m_cotsimgscanprm.GetStopMode().ToString();
  419. //终止时间
  420. IDC_EDIT_STOP_TIME.Text = m_cotsimgscanprm.GetStopParamMeasTime().ToString();
  421. //终止帧图数
  422. IDC_EDIT_STOP_FIELD_NUM.Text = m_cotsimgscanprm.GetStopParamFields().ToString();
  423. //终止夹杂物数
  424. IDC_EDIT_STOP_INCA_NUM.Text = m_cotsimgscanprm.GetStopParamParticles().ToString();
  425. //终止面积
  426. IDC_EDIT_STOP_INCA_AREA.Text = m_cotsimgscanprm.GetStopParamArea().ToString();
  427. //取图方式
  428. foreach (ComboBoxItem cbi in IDC_COMBO_FETCHIMGMODE.Items)
  429. {
  430. if (cbi.Value.ToString() != "")
  431. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetFieldStartMode())
  432. {
  433. IDC_COMBO_FETCHIMGMODE.SelectedItem = cbi;
  434. }
  435. }
  436. //扫描图精度
  437. foreach (ComboBoxItem cbi in IDC_COMBO_IMGSCANSPEED.Items)
  438. {
  439. if (cbi.Value.ToString() != "")
  440. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetScanImageSpeed())
  441. {
  442. IDC_COMBO_IMGSCANSPEED.SelectedItem = cbi;
  443. }
  444. }
  445. //扫描图尺寸
  446. foreach (ComboBoxItem cbi in IDC_COMBO_IMGSIZE.Items)
  447. {
  448. if (cbi.Value.ToString() != "")
  449. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetImageResulotion())
  450. {
  451. IDC_COMBO_IMGSIZE.SelectedItem = cbi;
  452. }
  453. }
  454. }
  455. /// <summary>
  456. /// 加载一般常规参数
  457. /// </summary>
  458. public void LoadCGenParam()
  459. {
  460. //样品名
  461. IDC_EDIT_SAMPLENAME.Text = m_cgenparam.GetSampleName().ToString();
  462. //执行开关
  463. IDC_MEAS_SWITCH.Checked = m_cgenparam.GetMeasurementSwitch();
  464. //是否使用系统库开关
  465. IDC_SYS_LIB.Checked = m_cgenparam.GetSysSTD();
  466. //测量参数文件夹
  467. IDC_EDIT_MEASUREPARAMPATH.Text = m_cgenparam.GetMsrParamFileFolderName().ToString();
  468. //颗粒分析标准库文件夹
  469. IDC_EDIT_ANALYSESTDLIBPATH.Text = m_cgenparam.GetPartSTDLibFolderName().ToString();
  470. //选择颗粒分析标准库
  471. foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
  472. {
  473. if (cbi.Value.ToString() != "")
  474. if (Convert.ToInt32(cbi.Value) == m_cgenparam.GetPartStdLibTypeIndex())
  475. {
  476. //IDC_COMBO_TECHNOLOGY.SelectedItem = cbi;
  477. }
  478. }
  479. //精炼工艺选项
  480. foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
  481. {
  482. if (cbi.Value.ToString() != "")
  483. if (Convert.ToInt32(cbi.Value) == m_cgenparam.GetSteelTechnology())
  484. {
  485. IDC_COMBO_TECHNOLOGY.SelectedItem = cbi;
  486. }
  487. }
  488. //测量区域形状
  489. foreach (ComboBoxItem cbi in cBMeasShape.Items)
  490. {
  491. if (cbi.Value.ToString() != "")
  492. if (Convert.ToInt32(cbi.Value) == (int)m_cgenparam.GetShape())
  493. {
  494. cBMeasShape.SelectedItem = cbi;
  495. }
  496. }
  497. //测量区域面积
  498. tBMeasArea.Text = m_cgenparam.GetArea().ToString();
  499. //标准库选择
  500. foreach (ComboBoxItem cbi in IDC_COMBO_STDSelect.Items)
  501. {
  502. if (cbi.Text.ToString() != "")
  503. if (cbi.Text.ToString() == m_cgenparam.GetSTDSelect())
  504. {
  505. IDC_COMBO_STDSelect.SelectedItem = cbi;
  506. }
  507. }
  508. }
  509. /// <summary>
  510. /// 加载默认参数
  511. /// </summary>
  512. public void LoadDefaultParam()
  513. {
  514. //模式
  515. foreach (OTSPeriodicTable.ComboBoxItem cbi in IDC_COMBO_Model.Items)
  516. {
  517. if (cbi.Value.ToString() != "")
  518. if (Convert.ToInt32(cbi.Value) == (int)m_cotsprogmgrparamfile.GetRunMode())
  519. {
  520. IDC_COMBO_Model.SelectedItem = cbi;
  521. }
  522. }
  523. }
  524. /// <summary>
  525. /// 加载图像处理参数
  526. /// </summary>
  527. public void LoadImageProc()
  528. {
  529. //颗粒面积范围 最小
  530. IDC_EDIT_PARTAREAMIN.Text = m_cotsimgprocprm.GetIncAreaRange().GetStart().ToString();
  531. //颗粒面积范围 最大
  532. IDC_EDIT_PARTAREAMAX.Text = m_cotsimgprocprm.GetIncAreaRange().GetEnd().ToString();
  533. //背景灰度范围 最小
  534. IDC_EDIT_BACKMIN.Text = m_cotsimgprocprm.GetBGGray().GetStart().ToString();
  535. //背景灰度范围 最大
  536. IDC_EDIT_BACKMAX.Text = m_cotsimgprocprm.GetBGGray().GetEnd().ToString();
  537. //颗粒灰度范围 最小
  538. IDC_EDIT_PARTMIN.Text = m_cotsimgprocprm.GetParticleGray().GetStart().ToString();
  539. //颗粒灰度范围 最大
  540. IDC_EDIT_PARTMAX.Text = m_cotsimgprocprm.GetParticleGray().GetEnd().ToString();
  541. //腐蚀膨胀系数
  542. IDC_COMBO_CorrosionExpansionCoefficient.Text=m_cotsimgprocprm.GetCorrosionExpansionCoefficient().ToString();
  543. //去背景方式
  544. foreach (ComboBoxItem cbi in IDC_COMBO_BGREMOVETYPE.Items)
  545. {
  546. if (cbi.Value.ToString() != "")
  547. {
  548. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgprocprm.GetBGRemoveType())
  549. {
  550. IDC_COMBO_BGREMOVETYPE.SelectedItem = cbi;
  551. break;
  552. }
  553. }
  554. }
  555. foreach (ComboBoxItem cbi in IDC_COMBO_AUTOBGREMOVETYP.Items)
  556. {
  557. if (cbi.Value.ToString() != "")
  558. {
  559. if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgprocprm.GetAutoBGRemoveType())
  560. {
  561. IDC_COMBO_AUTOBGREMOVETYP.SelectedItem = cbi;
  562. break;
  563. }
  564. }
  565. }
  566. }
  567. /// <summary>
  568. /// 加载X-Ray参数
  569. /// </summary>
  570. public void LoadXRayParam()
  571. {
  572. //搜索X-ray精度
  573. //foreach (ComboBoxItem cbi in IDC_COMBO_SEARCHXRAYSPEED.Items)
  574. //{
  575. // if (cbi.Value.ToString() != "")
  576. // if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetSearchSpeed())
  577. // {
  578. // IDC_COMBO_SEARCHXRAYSPEED.SelectedItem = cbi;
  579. // }
  580. //}
  581. //搜索X-ray精度对应的时间
  582. IDC_TEXTBOX_SEARCHXRAYSPEED_TIME.Text = m_cotsxrayprm.GetMidSearchAQTime().ToString();
  583. //搜索X-ray最低计数
  584. //IDC_EDIT_SEARCHXRAYCOUNTLIMIT.Text = m_cotsxrayprm.GetXRaySearchCount().ToString();
  585. //X-ray扫描方式
  586. foreach (ComboBoxItem cbi in IDC_COMBO_XRAYSCANMODE.Items)
  587. {
  588. if (cbi.Value.ToString() != "")
  589. if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetScanMode())
  590. {
  591. IDC_COMBO_XRAYSCANMODE.SelectedItem = cbi;
  592. }
  593. }
  594. //是否使用电镜
  595. IDC_USINGXRAY_LIB.Checked = m_cotsxrayprm.GetUsingXray();
  596. //分析X-ray精度
  597. foreach (ComboBoxItem cbi in IDC_COMBO_ANALYXRAYSPEED.Items)
  598. {
  599. if (cbi.Value.ToString() != "")
  600. if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetAnalySpeed())
  601. {
  602. IDC_COMBO_ANALYXRAYSPEED.SelectedItem = cbi;
  603. }
  604. }
  605. //分析X-ray精度对应的时间
  606. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text = m_cotsxrayprm.GetMidAnalyAQTime().ToString();
  607. //分析X-ray计数期望值
  608. IDC_EDIT_ANALYXRAYAIMVALUE.Text = m_cotsxrayprm.GetAnalyExpCount().ToString();
  609. IDC_EDIT_QuantifyMinSize.Text = m_cotsxrayprm.GetFeatureModeMinSize().ToString();
  610. IDC_EDIT_SmallPartAQTime.Text = m_cotsxrayprm.GetFastXrayTime().ToString();
  611. IDC_EDIT_XrayLimit.Text = m_cotsxrayprm.GetXrayLimit().ToString();
  612. //IDC_XRAY_MODE_SWITCH.Checked = m_cotsxrayprm.GetShowScanMode();
  613. //IDC_XRAY_TIME_SWITCH.Checked = m_cotsxrayprm.GetShowSpeed();
  614. //IDC_XRAY_COUNT_SWITCH.Checked = m_cotsxrayprm.GetShowExpCount();
  615. }
  616. /// <summary>
  617. /// 保存SEM样品台参数
  618. /// </summary>
  619. public void SaveSEMStageData()
  620. {
  621. //100倍时屏幕尺寸/mm
  622. m_csemstagedata.SetScanFieldSize100(Convert.ToInt32(IDC_EDIT_SCREENWIDTH.Text));
  623. //x轴方向
  624. ComboBoxItem cbi_x = (ComboBoxItem)IDC_COMBO_XDIREC.SelectedItem;
  625. m_csemstagedata.SetXAxisDir((otsdataconst.OTS_X_AXIS_DIRECTION)Convert.ToInt32(cbi_x.Value));
  626. //x轴行程/mm 起,始
  627. CIntRange crc_x = new CIntRange(Convert.ToInt32(IDC_EDIT_XSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_XEND.Text) * 1000);
  628. m_csemstagedata.SetXAxis(crc_x);
  629. //y轴方向
  630. ComboBoxItem cbi_y = (ComboBoxItem)IDC_COMBO_YDIRECT.SelectedItem;
  631. m_csemstagedata.SetYAxisDir((otsdataconst.OTS_Y_AXIS_DIRECTION)Convert.ToInt32(cbi_y.Value));
  632. //y轴行程/mm 起,始
  633. CIntRange crc_y = new CIntRange(Convert.ToInt32(IDC_EDIT_YSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_YEND.Text) * 1000);
  634. m_csemstagedata.SetYAxis(crc_y);
  635. //最小放大倍数
  636. m_csemstagedata.SetMinMag(Convert.ToDouble(IDC_EDIT_MINMAG.Text));
  637. }
  638. /// <summary>
  639. /// 保存图像扫描参数
  640. /// </summary>
  641. public void SaveImageScanPrm()
  642. {
  643. // 保存图像扫描参数");
  644. //测量终止方式
  645. m_cotsimgscanprm.SetStopMode(tB_StopMode.Text);
  646. //终止时间
  647. m_cotsimgscanprm.SetStopParamMeasTime(Convert.ToInt32(IDC_EDIT_STOP_TIME.Text));
  648. //终止帧图数
  649. m_cotsimgscanprm.SetStopParamFields(Convert.ToInt32(IDC_EDIT_STOP_FIELD_NUM.Text));
  650. //终止夹杂物数
  651. m_cotsimgscanprm.SetStopParamParticles(Convert.ToInt32(IDC_EDIT_STOP_INCA_NUM.Text));
  652. //终止面积
  653. m_cotsimgscanprm.SetStopParamArea(Convert.ToInt32(IDC_EDIT_STOP_INCA_AREA.Text));
  654. //取图方式
  655. ComboBoxItem enum_fetchimgmode = (ComboBoxItem)IDC_COMBO_FETCHIMGMODE.SelectedItem;
  656. m_cotsimgscanprm.SetStartImageMode((otsdataconst.OTS_GET_IMAGE_MODE)Convert.ToInt32(enum_fetchimgmode.Value));
  657. //扫描图精度
  658. ComboBoxItem enum_imgscanspeed = (ComboBoxItem)IDC_COMBO_IMGSCANSPEED.SelectedItem;
  659. m_cotsimgscanprm.SetScanImageSpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_imgscanspeed.Value));
  660. //扫描图尺寸
  661. ComboBoxItem enum_imgsize = (ComboBoxItem)IDC_COMBO_IMGSIZE.SelectedItem;
  662. m_cotsimgscanprm.SetImageResulotion((otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS)Convert.ToInt32(enum_imgsize.Value));
  663. }
  664. /// <summary>
  665. /// 保存一般常规参数
  666. /// </summary>
  667. public void SaveCGenParam()
  668. {
  669. //样品名
  670. m_cgenparam.SetSampleName(IDC_EDIT_SAMPLENAME.Text);
  671. //执行开关
  672. m_cgenparam.SetMeasurementSwitch(IDC_MEAS_SWITCH.Checked);
  673. //是否使用系统库
  674. m_cgenparam.SetSysSTD(IDC_SYS_LIB.Checked);
  675. //测量参数文件夹
  676. m_cgenparam.SetMsrParamFileFolderName(IDC_EDIT_MEASUREPARAMPATH.Text);
  677. //颗粒分析标准库文件夹
  678. m_cgenparam.SetPartSTDLibFolderName(IDC_EDIT_ANALYSESTDLIBPATH.Text);
  679. //获取精炼工艺索引
  680. ComboBoxItem cbiTECH = new ComboBoxItem();
  681. cbiTECH = (ComboBoxItem)IDC_COMBO_TECHNOLOGY.SelectedItem;
  682. //设置参数文件类中精炼工艺索引值
  683. m_cgenparam.SetSteelTechnology((int)cbiTECH.Value);
  684. //测量区域形状
  685. ComboBoxItem enum_Shape = (ComboBoxItem)cBMeasShape.SelectedItem;
  686. m_cgenparam.SetShape((otsdataconst.DOMAIN_SHAPE)Convert.ToInt32(enum_Shape.Value));
  687. //测量区域大小
  688. m_cgenparam.SetArea(Convert.ToDouble(tBMeasArea.Text));
  689. //标准库选择
  690. ComboBoxItem enum_STDLIBSELECT = (ComboBoxItem)IDC_COMBO_STDSelect.SelectedItem;
  691. m_cgenparam.SetSTDSelect(enum_STDLIBSELECT.Text.ToString());
  692. }
  693. /// <summary>
  694. /// 保存图像处理参数
  695. /// </summary>
  696. public void SaveImageProc()
  697. {
  698. //颗粒面积范围 最小 最大
  699. CDoubleRange crc_partareamin = new CDoubleRange(Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text), 2), Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text), 2));
  700. m_cotsimgprocprm.SetIncAreaRange(crc_partareamin);
  701. //背景灰度范围 最小 最大
  702. CIntRange crc_backmin = new CIntRange(Convert.ToInt32(IDC_EDIT_BACKMIN.Text), Convert.ToInt32(IDC_EDIT_BACKMAX.Text));
  703. m_cotsimgprocprm.SetBGGray(crc_backmin);
  704. //颗粒灰度范围 最小 最大
  705. CIntRange crc_partmin = new CIntRange(Convert.ToInt32(IDC_EDIT_PARTMIN.Text), Convert.ToInt32(IDC_EDIT_PARTMAX.Text));
  706. m_cotsimgprocprm.SetParticleGray(crc_partmin);
  707. //去背景方式
  708. ComboBoxItem enum_BGREMOVETYPE = (ComboBoxItem)IDC_COMBO_BGREMOVETYPE.SelectedItem;
  709. m_cotsimgprocprm.SetBGRemoveType((otsdataconst.OTS_BGREMOVE_TYPE)enum_BGREMOVETYPE.Value);
  710. //去背景方式
  711. ComboBoxItem enum_AUTOBGREMOVETYP = (ComboBoxItem)IDC_COMBO_AUTOBGREMOVETYP.SelectedItem;
  712. m_cotsimgprocprm.SetAutoBGRemoveType((otsdataconst.OTS_AUTOBGREMOVE_TYPE)enum_AUTOBGREMOVETYP.Value);
  713. //腐蚀膨胀系数
  714. m_cotsimgprocprm.SetCorrosionExpansionCoefficient(Convert.ToInt32(IDC_COMBO_CorrosionExpansionCoefficient.Text));
  715. }
  716. /// <summary>
  717. /// 保存X-Ray参数
  718. /// </summary>
  719. public void SaveXRayParam()
  720. {
  721. //搜索X-ray精度
  722. ComboBoxItem enum_searchxrayspeed = (ComboBoxItem)IDC_COMBO_SEARCHXRAYSPEED.SelectedItem;
  723. //m_cotsxrayprm.SetSearchSpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_searchxrayspeed.Value));
  724. //搜索X - ray精度对应的时间
  725. m_cotsxrayprm.SetMidSearchAQTime(Convert.ToInt32(IDC_TEXTBOX_SEARCHXRAYSPEED_TIME.Text.Trim()));
  726. //搜索X-ray最低计数
  727. //m_cotsxrayprm.SetXRaySearchCount(Convert.ToInt32(IDC_EDIT_SEARCHXRAYCOUNTLIMIT.Text));
  728. //X-ray扫描方式
  729. ComboBoxItem enum_xrayscanmode = (ComboBoxItem)IDC_COMBO_XRAYSCANMODE.SelectedItem;
  730. m_cotsxrayprm.SetScanMode((otsdataconst.OTS_X_RAY_SCAN_MODE)Convert.ToInt32(enum_xrayscanmode.Value));
  731. //是否使用X-ray
  732. m_cotsxrayprm.SetUsingXray(IDC_USINGXRAY_LIB.Checked);
  733. //分析X-ray精度
  734. ComboBoxItem enum_analyxrayspeed = (ComboBoxItem)IDC_COMBO_ANALYXRAYSPEED.SelectedItem;
  735. m_cotsxrayprm.SetAnalySpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_analyxrayspeed.Value));
  736. //分析X-ray精度对应的时间
  737. m_cotsxrayprm.SetMidAnalyAQTime(Convert.ToInt32(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()));
  738. //分析X-ray计数期望值
  739. m_cotsxrayprm.SetAnalyExpCount(Convert.ToInt32(IDC_EDIT_ANALYXRAYAIMVALUE.Text));
  740. m_cotsxrayprm.SetQuantifyMinSize(Convert.ToDouble(IDC_EDIT_QuantifyMinSize.Text));
  741. m_cotsxrayprm.SetFastXrayTime(Convert.ToInt32(IDC_EDIT_SmallPartAQTime.Text));
  742. m_cotsxrayprm.SetXrayLimit(Convert.ToInt32(IDC_EDIT_XrayLimit.Text));
  743. //m_cotsxrayprm.SetShowScanMode(IDC_XRAY_MODE_SWITCH.Checked);
  744. //m_cotsxrayprm.SetShowSpeed(IDC_XRAY_TIME_SWITCH.Checked);
  745. //m_cotsxrayprm.SetShowExpCount(IDC_XRAY_COUNT_SWITCH.Checked);
  746. }
  747. /// <summary>
  748. /// 将参数保存到文件
  749. /// </summary>
  750. /// <param name="a_nPackId"></param>
  751. /// <param name="a_pStageData"></param>
  752. /// <param name="a_pGenParam"></param>
  753. /// <param name="a_pImageScanParam"></param>
  754. /// <param name="a_pImageProcParam"></param>
  755. /// <param name="a_pXRayParam"></param>
  756. /// <returns></returns>
  757. public bool SaveInfoToProgMgrFile()
  758. {
  759. //SaveInfoToProgMgrFile()
  760. if (false == m_cotsprogmgrparamfile.SaveInfoToProgMgrFile())
  761. {
  762. log.Error("(OTSProgMgrInfoFun.SaveInfoToProgMgrFile) Failed to save parameters to file");
  763. return false;
  764. }
  765. return true;
  766. }
  767. /// <summary>
  768. /// 加载参数各个类
  769. /// </summary>
  770. public bool LoadParamFun()
  771. {
  772. bool result = m_cotsprogmgrparamfile.LoadInfoFromProgMgrFile();
  773. if (!result)
  774. {
  775. log.Error("(OTSProgMgrInfoFun.LoadParamFun) LoadInfoFromProgMgrFile Failed");
  776. return false;
  777. }
  778. m_csemstagedata = m_cotsprogmgrparamfile.GetStageDataParam();
  779. if (null == m_csemstagedata)
  780. {
  781. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetStageData Failed");
  782. return false;
  783. }
  784. m_cotsimgscanprm = m_cotsprogmgrparamfile.GetImageScanParam();
  785. if (null == m_cotsimgscanprm)
  786. {
  787. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageScanParam Failed");
  788. return false;
  789. }
  790. m_cgenparam = m_cotsprogmgrparamfile.GetGenParam();
  791. if (null == m_cgenparam)
  792. {
  793. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetGenParam Failed");
  794. return false;
  795. }
  796. m_cotsimgprocprm = m_cotsprogmgrparamfile.GetImageProcParam();
  797. if (null == m_cotsimgprocprm)
  798. {
  799. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageProcParam Failed");
  800. return false;
  801. }
  802. m_cotsxrayprm = m_cotsprogmgrparamfile.GetXRayParam();
  803. if (null == m_cotsxrayprm)
  804. {
  805. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetXRayParam Failed");
  806. return false;
  807. }
  808. return true;
  809. }
  810. #endregion
  811. #region 窗体加载
  812. private void ProgMgrInfoForm_Load(object sender, EventArgs e)
  813. {
  814. //加载各参数类
  815. LoadParamFun();
  816. //初始化combobox下拉框列表
  817. BindComboBox();
  818. //加载相关参数信息
  819. LoadDefaultParam();
  820. LoadSEMStageData();
  821. LoadImageScanPrm();
  822. LoadCGenParam();
  823. LoadImageProc();
  824. LoadXRayParam();
  825. if (m_b_checkstagefile == false)
  826. btnok.Enabled = true;
  827. else
  828. btnok.Enabled = false;
  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 button1_Click(object sender, EventArgs e)
  1802. {
  1803. System.Diagnostics.Process.Start("notepad.exe",CSpecialGrayRangeParam.GetParamFileFullName());
  1804. }
  1805. private void btn_StopMode_Click(object sender, EventArgs e)
  1806. {
  1807. if (StopModeDialog == null)
  1808. {
  1809. StopModeDialog = new MeasureStopMode();
  1810. StopModeDialog.FieldMode = m_cotsimgscanprm.GetStopParamFields();
  1811. StopModeDialog.TimeMode = m_cotsimgscanprm.GetStopParamMeasTime();
  1812. StopModeDialog.ParticleMode = m_cotsimgscanprm.GetStopParamParticles();
  1813. StopModeDialog.AreaMode = m_cotsimgscanprm.GetStopParamArea();
  1814. StopModeDialog.StopMode = tB_StopMode.Text;
  1815. }
  1816. DialogResult result = StopModeDialog.ShowDialog();
  1817. if (result == DialogResult.OK)
  1818. {
  1819. string[] rst = StopModeDialog.StopMode.Split(',');
  1820. string str = "";
  1821. for (int k = 0; k < rst.Length; k++)
  1822. {
  1823. str += rst[k].Split(':')[0] + " + ";
  1824. }
  1825. tB_StopMode.Text = str.Substring(0, str.Length - 3);
  1826. IDC_EDIT_STOP_TIME.Text = StopModeDialog.TimeMode.ToString();
  1827. IDC_EDIT_STOP_FIELD_NUM.Text = StopModeDialog.FieldMode.ToString();
  1828. IDC_EDIT_STOP_INCA_NUM.Text = StopModeDialog.ParticleMode.ToString();
  1829. IDC_EDIT_STOP_INCA_AREA.Text = StopModeDialog.AreaMode.ToString();
  1830. }
  1831. }
  1832. private void IDC_COMBO_CorrosionExpansionCoefficient_TextChanged(object sender, EventArgs e)
  1833. {
  1834. ThisSetIsModify();
  1835. }
  1836. }
  1837. public class ComboBoxItem
  1838. {
  1839. private string _text = null;
  1840. private object _value = null;
  1841. public string Text { get { return this._text; } set { this._text = value; } }
  1842. public object Value { get { return this._value; } set { this._value = value; } }
  1843. public override string ToString()
  1844. {
  1845. return this._text;
  1846. }
  1847. }
  1848. }