ProgMgrInfoForm.cs 80 KB

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