ProgMgrInfoForm.cs 80 KB

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