ProgMgrInfoForm.cs 79 KB

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