ProgMgrInfoForm.cs 79 KB

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