ProgMgrInfoForm.cs 80 KB

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