ProgMgrInfoForm.cs 79 KB

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