ProgMgrInfoForm.cs 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078
  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. //IDC_FILTER.Checked = m_cotsxrayprm.GetUseFilter();
  566. }
  567. /// <summary>
  568. /// 保存SEM样品台参数
  569. /// </summary>
  570. public void SaveSEMStageData()
  571. {
  572. //100倍时屏幕尺寸/mm
  573. m_csemstagedata.SetScanFieldSize100(Convert.ToInt32(IDC_EDIT_SCREENWIDTH.Text));
  574. //x轴方向
  575. ComboBoxItem cbi_x = (ComboBoxItem)IDC_COMBO_XDIREC.SelectedItem;
  576. m_csemstagedata.SetXAxisDir((otsdataconst.OTS_X_AXIS_DIRECTION)Convert.ToInt32(cbi_x.Value));
  577. //x轴行程/mm 起,始
  578. CIntRange crc_x = new CIntRange(Convert.ToInt32(IDC_EDIT_XSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_XEND.Text) * 1000);
  579. m_csemstagedata.SetXAxis(crc_x);
  580. //y轴方向
  581. ComboBoxItem cbi_y = (ComboBoxItem)IDC_COMBO_YDIRECT.SelectedItem;
  582. m_csemstagedata.SetYAxisDir((otsdataconst.OTS_Y_AXIS_DIRECTION)Convert.ToInt32(cbi_y.Value));
  583. //y轴行程/mm 起,始
  584. CIntRange crc_y = new CIntRange(Convert.ToInt32(IDC_EDIT_YSTART.Text) * 1000, Convert.ToInt32(IDC_EDIT_YEND.Text) * 1000);
  585. m_csemstagedata.SetYAxis(crc_y);
  586. //最小放大倍数
  587. m_csemstagedata.SetMinMag(Convert.ToDouble(IDC_EDIT_MINMAG.Text));
  588. }
  589. /// <summary>
  590. /// 保存图像扫描参数
  591. /// </summary>
  592. public void SaveImageScanPrm()
  593. {
  594. // 保存图像扫描参数");
  595. //测量终止方式
  596. m_cotsimgscanprm.SetStopMode(tB_StopMode.Text);
  597. //终止时间
  598. m_cotsimgscanprm.SetStopParamMeasTime(StopModeDialog.TimeMode);
  599. ////终止帧图数
  600. m_cotsimgscanprm.SetStopParamFields(StopModeDialog.FieldMode);
  601. ////终止夹杂物数
  602. m_cotsimgscanprm.SetStopParamParticles(StopModeDialog.ParticleMode);
  603. ////终止面积
  604. m_cotsimgscanprm.SetStopParamArea(StopModeDialog.AreaMode);
  605. //取图方式
  606. ComboBoxItem enum_fetchimgmode = (ComboBoxItem)IDC_COMBO_FETCHIMGMODE.SelectedItem;
  607. m_cotsimgscanprm.SetStartImageMode((otsdataconst.OTS_GET_IMAGE_MODE)Convert.ToInt32(enum_fetchimgmode.Value));
  608. //扫描图精度
  609. ComboBoxItem enum_imgscanspeed = (ComboBoxItem)IDC_COMBO_IMGSCANSPEED.SelectedItem;
  610. m_cotsimgscanprm.SetScanImageSpeed((otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(enum_imgscanspeed.Value));
  611. //扫描图尺寸
  612. ComboBoxItem enum_imgsize = (ComboBoxItem)IDC_COMBO_IMGSIZE.SelectedItem;
  613. m_cotsimgscanprm.SetImageResulotion((otsdataconst.OTS_IMAGE_RESULOTION_OPTIONS)Convert.ToInt32(enum_imgsize.Value));
  614. }
  615. /// <summary>
  616. /// 保存一般常规参数
  617. /// </summary>
  618. public void SaveCGenParam()
  619. {
  620. //样品名
  621. m_cgenparam.SetSampleName(IDC_EDIT_SAMPLENAME.Text);
  622. //执行开关
  623. m_cgenparam.SetMeasurementSwitch(IDC_MEAS_SWITCH.Checked);
  624. //是否使用系统库
  625. m_cgenparam.SetSysSTD(IDC_SYS_LIB.Checked);
  626. //测量参数文件夹
  627. m_cgenparam.SetMsrParamFileFolderName(IDC_EDIT_MEASUREPARAMPATH.Text);
  628. //颗粒分析标准库文件夹
  629. m_cgenparam.SetPartSTDLibFolderName(IDC_EDIT_ANALYSESTDLIBPATH.Text);
  630. //获取精炼工艺索引
  631. ComboBoxItem cbiTECH = new ComboBoxItem();
  632. cbiTECH = (ComboBoxItem)IDC_COMBO_TECHNOLOGY.SelectedItem;
  633. //设置参数文件类中精炼工艺索引值
  634. m_cgenparam.SetSteelTechnology((int)cbiTECH.Value);
  635. //测量区域形状
  636. ComboBoxItem enum_Shape = (ComboBoxItem)cBMeasShape.SelectedItem;
  637. m_cgenparam.SetShape((otsdataconst.DOMAIN_SHAPE)Convert.ToInt32(enum_Shape.Value));
  638. //测量区域大小
  639. m_cgenparam.SetArea(Convert.ToDouble(tBMeasArea.Text));
  640. //标准库选择
  641. ComboBoxItem enum_STDLIBSELECT = (ComboBoxItem)IDC_COMBO_STDSelect.SelectedItem;
  642. m_cgenparam.SetSTDSelect(enum_STDLIBSELECT.Text.ToString());
  643. }
  644. /// <summary>
  645. /// 保存图像处理参数
  646. /// </summary>
  647. public void SaveImageProc()
  648. {
  649. //颗粒面积范围 最小 最大
  650. CDoubleRange crc_partareamin = new CDoubleRange(Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text), 2), Math.Round(Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text), 2));
  651. m_cotsimgprocprm.SetIncAreaRange(crc_partareamin);
  652. //背景灰度范围 最小 最大
  653. CIntRange crc_backmin = new CIntRange(Convert.ToInt32(IDC_EDIT_BACKMIN.Text), Convert.ToInt32(IDC_EDIT_BACKMAX.Text));
  654. m_cotsimgprocprm.SetBGGray(crc_backmin);
  655. //颗粒灰度范围 最小 最大
  656. CIntRange crc_partmin = new CIntRange(Convert.ToInt32(IDC_EDIT_PARTMIN.Text), Convert.ToInt32(IDC_EDIT_PARTMAX.Text));
  657. m_cotsimgprocprm.SetParticleGray(crc_partmin);
  658. //去背景方式
  659. ComboBoxItem enum_BGREMOVETYPE = (ComboBoxItem)IDC_COMBO_BGREMOVETYPE.SelectedItem;
  660. m_cotsimgprocprm.SetBGRemoveType((otsdataconst.OTS_BGREMOVE_TYPE)enum_BGREMOVETYPE.Value);
  661. //去背景方式
  662. ComboBoxItem enum_AUTOBGREMOVETYP = (ComboBoxItem)IDC_COMBO_AUTOBGREMOVETYP.SelectedItem;
  663. m_cotsimgprocprm.SetAutoBGRemoveType((otsdataconst.OTS_AUTOBGREMOVE_TYPE)enum_AUTOBGREMOVETYP.Value);
  664. //腐蚀膨胀系数
  665. //m_cotsimgprocprm.SetErrodDilateParam(Convert.ToInt32(IDC_COMBO_CorrosionExpansionCoefficient.Text));
  666. //重叠像素
  667. m_cotsimgprocprm.SetOverlapParam(Convert.ToInt32(IDC_EDIT_Overlap.Text));
  668. if (IDC_EDIT_OTHERSELECTION.Text != "NoFilter")
  669. {
  670. m_cotsimgprocprm.SetParticleSelectCondition(IDC_EDIT_OTHERSELECTION.Text);
  671. }
  672. else
  673. {
  674. m_cotsimgprocprm.SetParticleSelectCondition("");
  675. }
  676. }
  677. /// <summary>
  678. /// 保存X-Ray参数
  679. /// </summary>
  680. public void SaveXRayParam()
  681. {
  682. //X-ray扫描方式
  683. ComboBoxItem enum_xrayscanmode = (ComboBoxItem)IDC_COMBO_XRAYSCANMODE.SelectedItem;
  684. m_cotsxrayprm.SetScanMode((otsdataconst.OTS_X_RAY_SCAN_MODE)Convert.ToInt32(enum_xrayscanmode.Value));
  685. //是否使用X-ray
  686. m_cotsxrayprm.SetUsingXray(IDC_USINGXRAY_LIB.Checked);
  687. //分析X-ray精度对应的时间
  688. m_cotsxrayprm.SetMidAnalyAQTime(Convert.ToInt32(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()));
  689. //分析X-ray计数期望值
  690. m_cotsxrayprm.SetAnalyExpCount(Convert.ToInt32(IDC_EDIT_ANALYXRAYAIMVALUE.Text));
  691. m_cotsxrayprm.SetFeatureModeMinSize(Convert.ToDouble(IDC_EDIT_QuantifyMinSize.Text));
  692. m_cotsxrayprm.SetSmallPartXrayTime(Convert.ToInt32(IDC_EDIT_SmallPartAQTime.Text));
  693. m_cotsxrayprm.SetXrayLimit(Convert.ToInt32(IDC_EDIT_XrayLimit.Text));
  694. //m_cotsxrayprm.SetUseFilter(IDC_FILTER.Checked);
  695. }
  696. /// <summary>
  697. /// 将参数保存到文件
  698. /// </summary>
  699. /// <param name="a_nPackId"></param>
  700. /// <param name="a_pStageData"></param>
  701. /// <param name="a_pGenParam"></param>
  702. /// <param name="a_pImageScanParam"></param>
  703. /// <param name="a_pImageProcParam"></param>
  704. /// <param name="a_pXRayParam"></param>
  705. /// <returns></returns>
  706. public bool SaveInfoToProgMgrFile()
  707. {
  708. //SaveInfoToProgMgrFile()
  709. if (false == m_cotsprogmgrparamfile.SaveInfoToProgMgrFile())
  710. {
  711. log.Error("(OTSProgMgrInfoFun.SaveInfoToProgMgrFile) Failed to save parameters to file");
  712. return false;
  713. }
  714. return true;
  715. }
  716. /// <summary>
  717. /// 加载参数各个类
  718. /// </summary>
  719. public bool LoadParamFun()
  720. {
  721. bool result = m_cotsprogmgrparamfile.LoadInfoFromProgMgrFile();
  722. if (!result)
  723. {
  724. log.Error("(OTSProgMgrInfoFun.LoadParamFun) LoadInfoFromProgMgrFile Failed");
  725. return false;
  726. }
  727. m_csemstagedata = m_cotsprogmgrparamfile.GetStageDataParam();
  728. if (null == m_csemstagedata)
  729. {
  730. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetStageData Failed");
  731. return false;
  732. }
  733. m_cotsimgscanprm = m_cotsprogmgrparamfile.GetImageScanParam();
  734. if (null == m_cotsimgscanprm)
  735. {
  736. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageScanParam Failed");
  737. return false;
  738. }
  739. m_cgenparam = m_cotsprogmgrparamfile.GetGenParam();
  740. if (null == m_cgenparam)
  741. {
  742. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetGenParam Failed");
  743. return false;
  744. }
  745. m_cotsimgprocprm = m_cotsprogmgrparamfile.GetImageProcParam();
  746. if (null == m_cotsimgprocprm)
  747. {
  748. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetImageProcParam Failed");
  749. return false;
  750. }
  751. m_cotsxrayprm = m_cotsprogmgrparamfile.GetXRayParam();
  752. if (null == m_cotsxrayprm)
  753. {
  754. log.Error("(OTSProgMgrInfoFun.LoadParamFun) GetXRayParam Failed");
  755. return false;
  756. }
  757. return true;
  758. }
  759. #endregion
  760. #region 窗体加载
  761. private void ProgMgrInfoForm_Load(object sender, EventArgs e)
  762. {
  763. //加载各参数类
  764. LoadParamFun();
  765. //初始化combobox下拉框列表
  766. BindComboBox();
  767. //加载相关参数信息
  768. LoadDefaultParam();
  769. LoadSEMStageData();
  770. LoadImageScanPrm();
  771. LoadCGenParam();
  772. LoadImageProc();
  773. LoadXRayParam();
  774. if (m_b_checkstagefile == false)
  775. btnok.Enabled = true;
  776. else
  777. btnok.Enabled = false;
  778. //获取特殊颗粒信息
  779. //DataTable dt = XMLoperate.GetXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData").Tables[0];
  780. //if (dt.Rows.Count != 0)
  781. //{
  782. // if (XMLoperate.GetXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData").Tables[0].Rows[0]["ToRun"].ToString() == "true")
  783. // {
  784. // checkBox_Run.Checked = true;
  785. // }
  786. // else
  787. // {
  788. // checkBox_Run.Checked = false;
  789. // }
  790. //}
  791. //关于路径定位问题
  792. this.folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
  793. string strb = ".\\Config\\SysData\\";
  794. string strc = ".\\Config\\ProData\\";
  795. string m_STDPath = strb;
  796. m_ParameterPath = strc;
  797. this.folderBrowserDialog1.SelectedPath = m_ParameterPath;
  798. IDC_EDIT_MEASUREPARAMPATH.Text = m_ParameterPath;
  799. IDC_EDIT_ANALYSESTDLIBPATH.Text = m_STDPath;
  800. if(m_cotsprogmgrparamfile.GetSysTypeName() == "IncA")
  801. {
  802. label42.Visible = true;
  803. IDC_COMBO_TECHNOLOGY.Visible = true;
  804. }
  805. else
  806. {
  807. label42.Visible = false;
  808. IDC_COMBO_TECHNOLOGY.Visible = false;
  809. }
  810. }
  811. #endregion
  812. #region 各按钮控件点击事件
  813. private void IDC_BUTTON_KLFX_Click(object sender, EventArgs e)
  814. {
  815. try
  816. {
  817. if (IDC_COMBO_STDSelect.Text != "NoSTDDB")
  818. {
  819. Process p = System.Diagnostics.Process.Start(".\\OTSPartA_STDEditor.exe", Application.StartupPath + "\\Config\\SysData\\" + IDC_COMBO_STDSelect.Text+".db");
  820. p.WaitForExit();
  821. }
  822. else
  823. {
  824. string message = table["message55"].ToString();
  825. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  826. }
  827. }
  828. catch (Exception ex)
  829. {
  830. log.Error("OTSPartA_STDEditor:" + ex.ToString());
  831. }
  832. }
  833. private void IDC_BUTTON_MEASPRAMPATHSET_Click(object sender, EventArgs e)
  834. {
  835. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  836. {
  837. IDC_EDIT_MEASUREPARAMPATH.Text = folderBrowserDialog1.SelectedPath;
  838. }
  839. else
  840. {
  841. folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
  842. }
  843. }
  844. private void IDC_BUTTON_PARTSTDLIBPATHSET_Click(object sender, EventArgs e)
  845. {
  846. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  847. {
  848. IDC_EDIT_ANALYSESTDLIBPATH.Text = folderBrowserDialog1.SelectedPath;
  849. }
  850. else {
  851. folderBrowserDialog1.SelectedPath = IDC_EDIT_ANALYSESTDLIBPATH.Text;
  852. }
  853. }
  854. /// <summary>
  855. /// 弹出样品台管理窗体
  856. /// </summary>
  857. /// <param name="a_nPackId"></param>
  858. /// <param name="a_pStageFile"></param>
  859. /// <returns></returns>
  860. public void ShowStageDialogExport()
  861. {
  862. DlgStageMgr dlgStageMgr = new DlgStageMgr(m_cstagefile);
  863. dlgStageMgr.ShowDialog();
  864. return;
  865. }
  866. /// <summary>
  867. /// 保存样品台信息
  868. /// </summary>
  869. /// <returns></returns>
  870. public bool CStageFileClrSave()
  871. {
  872. if (m_cstagefile == null)
  873. {
  874. //报错
  875. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) Error saving sample station information!");
  876. }
  877. else
  878. {
  879. bool b_ret = m_cstagefile.Save();
  880. if (false == b_ret)
  881. {
  882. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) Error saving sample table information!");
  883. }
  884. }
  885. return false;
  886. }
  887. private void IDC_BUTTON_STAGE_Click(object sender, EventArgs e)
  888. {
  889. //弹出管理样品台管理窗体
  890. ShowStageDialogExport();
  891. //弹出后再保存样品台信息
  892. CStageFileClrSave();
  893. //刷新绑定样品台列表
  894. BindStageCombobox();
  895. //检测是否已经有修改
  896. ThisSetIsModify();
  897. }
  898. /// <summary>
  899. /// 判断各控件值是否正确
  900. /// </summary>
  901. /// <returns></returns>
  902. private bool CheckSetupValues(int bz)
  903. {
  904. if ("" == IDC_COMBO_STAGE.Text)
  905. {
  906. string message = table["message1"].ToString();
  907. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  908. IDC_COMBO_STAGE.Focus();
  909. IDC_COMBO_STAGE.SelectAll();
  910. return false;
  911. }
  912. if ("" == IDC_EDIT_SCREENWIDTH.Text)
  913. {
  914. string message = table["message2"].ToString();
  915. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  916. IDC_EDIT_SCREENWIDTH.Focus();
  917. IDC_EDIT_SCREENWIDTH.SelectAll();
  918. return false;
  919. }
  920. if ("" == IDC_COMBO_XDIREC.Text)
  921. {
  922. string message = table["message3"].ToString();
  923. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  924. IDC_COMBO_XDIREC.Focus();
  925. IDC_COMBO_XDIREC.SelectAll();
  926. return false;
  927. }
  928. if ("" == IDC_EDIT_XSTART.Text)
  929. {
  930. string message = table["message4"].ToString();
  931. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  932. IDC_EDIT_XSTART.Focus();
  933. IDC_EDIT_XSTART.SelectAll();
  934. return false;
  935. }
  936. if ("" == IDC_EDIT_XEND.Text)
  937. {
  938. string message = table["message4"].ToString();
  939. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  940. IDC_EDIT_XEND.Focus();
  941. IDC_EDIT_XEND.SelectAll();
  942. return false;
  943. }
  944. if ("" == IDC_COMBO_YDIRECT.Text)
  945. {
  946. string message = table["message5"].ToString();
  947. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  948. IDC_COMBO_YDIRECT.Focus();
  949. IDC_COMBO_YDIRECT.SelectAll();
  950. return false;
  951. }
  952. if ("" == IDC_EDIT_YSTART.Text)
  953. {
  954. string message = table["message6"].ToString();
  955. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  956. IDC_EDIT_YSTART.Focus();
  957. IDC_EDIT_YSTART.SelectAll();
  958. return false;
  959. }
  960. if ("" == IDC_EDIT_YEND.Text)
  961. {
  962. string message = table["message6"].ToString();
  963. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  964. IDC_EDIT_YEND.Focus();
  965. IDC_EDIT_YEND.SelectAll();
  966. return false;
  967. }
  968. if ("" == tB_StopMode.Text)
  969. {
  970. string message = table["message7"].ToString();
  971. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  972. //IDC_EDIT_STOP_TIME.Focus();
  973. //IDC_EDIT_STOP_TIME.SelectAll();
  974. return false;
  975. }
  976. if ("" == IDC_COMBO_FETCHIMGMODE.Text)
  977. {
  978. string message = table["message10"].ToString();
  979. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  980. IDC_COMBO_FETCHIMGMODE.Focus();
  981. IDC_COMBO_FETCHIMGMODE.SelectAll();
  982. return false;
  983. }
  984. if ("" == IDC_COMBO_IMGSCANSPEED.Text)
  985. {
  986. string message = table["message11"].ToString();
  987. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  988. IDC_COMBO_IMGSCANSPEED.Focus();
  989. IDC_COMBO_IMGSCANSPEED.SelectAll();
  990. return false;
  991. }
  992. if ("" == IDC_COMBO_IMGSIZE.Text)
  993. {
  994. string message = table["message12"].ToString();
  995. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  996. IDC_COMBO_IMGSIZE.Focus();
  997. IDC_COMBO_IMGSIZE.SelectAll();
  998. return false;
  999. }
  1000. if ("" == IDC_EDIT_MINMAG.Text)
  1001. {
  1002. string message = table["message13"].ToString();
  1003. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1004. IDC_EDIT_MINMAG.Focus();
  1005. IDC_EDIT_MINMAG.SelectAll();
  1006. return false;
  1007. }
  1008. if ("" == IDC_EDIT_PARTAREAMIN.Text)
  1009. {
  1010. string message = table["message14"].ToString();
  1011. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1012. IDC_EDIT_PARTAREAMIN.Focus();
  1013. IDC_EDIT_PARTAREAMIN.SelectAll();
  1014. return false;
  1015. }
  1016. if ("" == IDC_EDIT_PARTAREAMAX.Text)
  1017. {
  1018. string message = table["message15"].ToString();
  1019. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1020. IDC_EDIT_PARTAREAMAX.Focus();
  1021. IDC_EDIT_PARTAREAMAX.SelectAll();
  1022. return false;
  1023. }
  1024. if ("" == IDC_EDIT_BACKMIN.Text)
  1025. {
  1026. string message = table["message16"].ToString();
  1027. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1028. IDC_EDIT_BACKMIN.Focus();
  1029. IDC_EDIT_BACKMIN.SelectAll();
  1030. return false;
  1031. }
  1032. if ("" == IDC_EDIT_BACKMAX.Text)
  1033. {
  1034. string message = table["message17"].ToString();
  1035. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1036. IDC_EDIT_BACKMAX.Focus();
  1037. IDC_EDIT_BACKMAX.SelectAll();
  1038. return false;
  1039. }
  1040. if ("" == IDC_EDIT_PARTMIN.Text)
  1041. {
  1042. string message = table["message18"].ToString();
  1043. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1044. IDC_EDIT_PARTMIN.Focus();
  1045. IDC_EDIT_PARTMIN.SelectAll();
  1046. return false;
  1047. }
  1048. if ("" == IDC_EDIT_PARTMAX.Text)
  1049. {
  1050. string message = table["message19"].ToString();
  1051. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1052. IDC_EDIT_PARTMAX.Focus();
  1053. IDC_EDIT_PARTMAX.SelectAll();
  1054. return false;
  1055. }
  1056. if ("" == IDC_COMBO_XRAYSCANMODE.Text)
  1057. {
  1058. string message = table["message20"].ToString();
  1059. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1060. IDC_COMBO_XRAYSCANMODE.Focus();
  1061. IDC_COMBO_XRAYSCANMODE.SelectAll();
  1062. return false;
  1063. }
  1064. //if ("" == IDC_COMBO_ANALYXRAYSPEED.Text)
  1065. //{
  1066. // string message = table["message21"].ToString();
  1067. // MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1068. // IDC_COMBO_ANALYXRAYSPEED.Focus();
  1069. // IDC_COMBO_ANALYXRAYSPEED.SelectAll();
  1070. // return false;
  1071. //}
  1072. if ("" == IDC_EDIT_ANALYXRAYAIMVALUE.Text)
  1073. {
  1074. string message = table["message22"].ToString();
  1075. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1076. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1077. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1078. return false;
  1079. }
  1080. if ("" == tBMeasArea.Text)
  1081. {
  1082. string message = table["message62"].ToString();
  1083. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1084. tBMeasArea.Focus();
  1085. tBMeasArea.SelectAll();
  1086. return false;
  1087. }
  1088. //if ("" == IDC_COMBO_CorrosionExpansionCoefficient.Text)
  1089. //{
  1090. // string message = table["message62"].ToString();
  1091. // MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1092. // IDC_COMBO_CorrosionExpansionCoefficient.Focus();
  1093. // IDC_COMBO_CorrosionExpansionCoefficient.SelectAll();
  1094. // return false;
  1095. //}
  1096. //string pat = @"^(-|\+)?\d{1,8}$";//只能输入1到3位的正负整数
  1097. string pat = @"^-?[0-9]\d*$";//只能限定正负整数,包含0
  1098. string scope = @"^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$";
  1099. string PositiveDecimals = @"^(([1-9]\d*)(\.\d+)?)$|^0\.\d*[1-9]$"; //正浮点数
  1100. string positiveInteger = @"^?[0-9]\d*$";//只能限定正整数,包含0
  1101. string positiveOddNumber = @"[^1,3,5,7,9]";//只能限定正奇数
  1102. Regex rg = new Regex(pat);
  1103. Regex rgScope = new Regex(scope);
  1104. Regex rgPositiveDecimals = new Regex(PositiveDecimals);
  1105. Regex rgpositiveInteger = new Regex(positiveInteger);
  1106. Regex rgpositiveOddNumber = new Regex(positiveOddNumber);
  1107. //是否是正确的数值格式类型判断
  1108. //if(IDC_COMBO_CorrosionExpansionCoefficient.Text!="0")
  1109. //{
  1110. // if (rgpositiveOddNumber.Match(IDC_COMBO_CorrosionExpansionCoefficient.Text.Trim()).Success)
  1111. // {
  1112. // IDC_COMBO_CorrosionExpansionCoefficient.Focus();
  1113. // IDC_COMBO_CorrosionExpansionCoefficient.SelectAll();
  1114. // string message = table["message66"].ToString();
  1115. // MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1116. // return false;
  1117. // }
  1118. //}
  1119. //100倍时屏幕尺寸
  1120. if (false == rg.Match(IDC_EDIT_SCREENWIDTH.Text.Trim()).Success)
  1121. {
  1122. IDC_EDIT_SCREENWIDTH.Focus();
  1123. IDC_EDIT_SCREENWIDTH.SelectAll();
  1124. string message = table["message23"].ToString();
  1125. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1126. return false;
  1127. }
  1128. //x轴行程/mm 起
  1129. if (false == rg.Match(IDC_EDIT_XSTART.Text.Trim()).Success)
  1130. {
  1131. IDC_EDIT_XSTART.Focus();
  1132. IDC_EDIT_XSTART.SelectAll();
  1133. string message = table["message24"].ToString();
  1134. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1135. return false;
  1136. }
  1137. //x轴行程/mm 止
  1138. if (false == rg.Match(IDC_EDIT_XEND.Text.Trim()).Success)
  1139. {
  1140. IDC_EDIT_XEND.Focus();
  1141. IDC_EDIT_XEND.SelectAll();
  1142. string message = table["message25"].ToString();
  1143. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1144. return false;
  1145. }
  1146. //y轴行程/mm 起
  1147. if (false == rg.Match(IDC_EDIT_YSTART.Text.Trim()).Success)
  1148. {
  1149. IDC_EDIT_YSTART.Focus();
  1150. IDC_EDIT_YSTART.SelectAll();
  1151. string message = table["message26"].ToString();
  1152. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1153. return false;
  1154. }
  1155. //y轴行程/mm 止
  1156. if (false == rg.Match(IDC_EDIT_YEND.Text.Trim()).Success)
  1157. {
  1158. IDC_EDIT_YEND.Focus();
  1159. IDC_EDIT_YEND.SelectAll();
  1160. string message = table["message27"].ToString();
  1161. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1162. return false;
  1163. }
  1164. //颗粒面积范围 最小
  1165. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMIN.Text.Trim()).Success)
  1166. {
  1167. IDC_EDIT_PARTAREAMIN.Focus();
  1168. IDC_EDIT_PARTAREAMIN.SelectAll();
  1169. string message = table["message31"].ToString();
  1170. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1171. return false;
  1172. }
  1173. //颗粒面积范围 最大
  1174. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMAX.Text.Trim()).Success)
  1175. {
  1176. IDC_EDIT_PARTAREAMAX.Focus();
  1177. IDC_EDIT_PARTAREAMAX.SelectAll();
  1178. string message = table["message32"].ToString();
  1179. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1180. return false;
  1181. }
  1182. //背景灰度范围 最小
  1183. if (false == rg.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1184. {
  1185. IDC_EDIT_BACKMIN.Focus();
  1186. IDC_EDIT_BACKMIN.SelectAll();
  1187. string message = table["message33"].ToString();
  1188. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1189. return false;
  1190. }
  1191. else
  1192. {
  1193. if (false == rgScope.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1194. {
  1195. IDC_EDIT_BACKMIN.Focus();
  1196. IDC_EDIT_BACKMIN.SelectAll();
  1197. string message = table["message34"].ToString();
  1198. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1199. return false;
  1200. }
  1201. }
  1202. //背景灰度范围 最大
  1203. if (false == rg.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1204. {
  1205. IDC_EDIT_BACKMAX.Focus();
  1206. IDC_EDIT_BACKMAX.SelectAll();
  1207. string message = table["message35"].ToString();
  1208. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1209. return false;
  1210. }
  1211. else
  1212. {
  1213. if (false == rgScope.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1214. {
  1215. IDC_EDIT_BACKMAX.Focus();
  1216. IDC_EDIT_BACKMAX.SelectAll();
  1217. string message = table["message36"].ToString();
  1218. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1219. return false;
  1220. }
  1221. }
  1222. //颗粒灰度范围 最小
  1223. if (false == rg.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1224. {
  1225. IDC_EDIT_PARTMIN.Focus();
  1226. IDC_EDIT_PARTMIN.SelectAll();
  1227. string message = table["message37"].ToString();
  1228. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1229. return false;
  1230. }
  1231. else
  1232. {
  1233. if (false == rgScope.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1234. {
  1235. IDC_EDIT_PARTMIN.Focus();
  1236. IDC_EDIT_PARTMIN.SelectAll();
  1237. string message = table["message38"].ToString();
  1238. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1239. return false;
  1240. }
  1241. }
  1242. //颗粒灰度范围 最大
  1243. if (false == rg.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1244. {
  1245. IDC_EDIT_PARTMAX.Focus();
  1246. IDC_EDIT_PARTMAX.SelectAll();
  1247. string message = table["message39"].ToString();
  1248. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1249. return false;
  1250. }
  1251. else
  1252. {
  1253. if (false == rgScope.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1254. {
  1255. IDC_EDIT_PARTMAX.Focus();
  1256. IDC_EDIT_PARTMAX.SelectAll();
  1257. string message = table["message40"].ToString();
  1258. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1259. return false;
  1260. }
  1261. }
  1262. //分析X-ray计数期望值 最大
  1263. if (false == rg.Match(IDC_EDIT_ANALYXRAYAIMVALUE.Text.Trim()).Success)
  1264. {
  1265. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1266. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1267. string message = table["message41"].ToString();
  1268. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1269. return false;
  1270. }
  1271. //分析X-ray精度对应的时间
  1272. if (false == rg.Match(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()).Success)
  1273. {
  1274. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Focus();
  1275. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.SelectAll();
  1276. string message = table["message42"].ToString();
  1277. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1278. return false;
  1279. }
  1280. //if (false == rgPositiveDecimals.Match(IDC_EDIT_QuantifyMinSize.Text.Trim()).Success)
  1281. //{
  1282. // IDC_EDIT_QuantifyMinSize.Focus();
  1283. // IDC_EDIT_QuantifyMinSize.SelectAll();
  1284. // string message = table["message63"].ToString();
  1285. // MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1286. // return false;
  1287. //}
  1288. pat = @"^[0-9]+(\.[0-9]{1,3})?$"; //只能输入,1到3位小数的正数
  1289. rg = new Regex(pat);
  1290. //最小放大倍数
  1291. if (false == rg.Match(IDC_EDIT_MINMAG.Text.Trim()).Success)
  1292. {
  1293. IDC_EDIT_MINMAG.Focus();
  1294. IDC_EDIT_MINMAG.SelectAll();
  1295. string message = table["message43"].ToString();
  1296. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1297. return false;
  1298. }
  1299. ////最小放大倍数不得小于45倍
  1300. //if (Convert.ToInt32(IDC_EDIT_MINMAG.Text.Trim()) < 45)
  1301. //{
  1302. // IDC_EDIT_MINMAG.Focus();
  1303. // IDC_EDIT_MINMAG.SelectAll();
  1304. // string message = "The minimum magnification cannot be less than 45 times";
  1305. // MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1306. // return false;
  1307. //}
  1308. //再限制,x轴,y轴,的起止的,输入长度,因为现在已经有在mm和um之间的转换,所以这里要限制一下
  1309. //x轴行程/mm 起
  1310. if (IDC_EDIT_XSTART.Text.Length > 4)
  1311. {
  1312. IDC_EDIT_XSTART.Focus();
  1313. IDC_EDIT_XSTART.SelectAll();
  1314. string message = table["message44"].ToString();
  1315. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1316. return false;
  1317. }
  1318. //x轴行程/mm 止
  1319. if (IDC_EDIT_XEND.Text.Length > 4)
  1320. {
  1321. IDC_EDIT_XEND.Focus();
  1322. IDC_EDIT_XEND.SelectAll();
  1323. string message = table["message45"].ToString();
  1324. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1325. return false;
  1326. }
  1327. //y轴行程/mm 起
  1328. if (IDC_EDIT_YSTART.Text.Length > 4)
  1329. {
  1330. IDC_EDIT_YSTART.Focus();
  1331. IDC_EDIT_YSTART.SelectAll();
  1332. string message = table["message46"].ToString();
  1333. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1334. return false;
  1335. }
  1336. //y轴行程/mm 止
  1337. if (IDC_EDIT_YEND.Text.Length > 4)
  1338. {
  1339. IDC_EDIT_YEND.Focus();
  1340. IDC_EDIT_YEND.SelectAll();
  1341. string message = table["message47"].ToString();
  1342. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1343. return false;
  1344. }
  1345. if (Convert.ToInt32(IDC_EDIT_XSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_XEND.Text.Trim()))
  1346. {
  1347. IDC_EDIT_XEND.Focus();
  1348. IDC_EDIT_XEND.SelectAll();
  1349. string message = table["message50"].ToString();
  1350. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1351. return false;
  1352. }
  1353. if (Convert.ToInt32(IDC_EDIT_YSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_YEND.Text.Trim()))
  1354. {
  1355. IDC_EDIT_YEND.Focus();
  1356. IDC_EDIT_YEND.SelectAll();
  1357. string message = table["message53"].ToString();
  1358. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1359. return false;
  1360. }
  1361. //颗粒尺寸范围
  1362. if (Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text.Trim()) > Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text.Trim()))
  1363. {
  1364. IDC_EDIT_PARTAREAMIN.Focus();
  1365. IDC_EDIT_PARTAREAMIN.SelectAll();
  1366. string message = table["message56"].ToString();
  1367. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1368. return false;
  1369. }
  1370. //背景灰度范围
  1371. if (Convert.ToInt32(IDC_EDIT_BACKMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_BACKMAX.Text.Trim()))
  1372. {
  1373. IDC_EDIT_BACKMIN.Focus();
  1374. IDC_EDIT_BACKMIN.SelectAll();
  1375. string message = table["message57"].ToString();
  1376. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1377. return false;
  1378. }
  1379. //颗粒灰度范围
  1380. if (Convert.ToInt32(IDC_EDIT_PARTMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_PARTMAX.Text.Trim()))
  1381. {
  1382. IDC_EDIT_PARTMIN.Focus();
  1383. IDC_EDIT_PARTMIN.SelectAll();
  1384. string message = table["message58"].ToString();
  1385. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1386. return false;
  1387. }
  1388. //最小放大倍数
  1389. if (false == rgpositiveInteger.Match(IDC_EDIT_XrayLimit.Text.Trim()).Success)
  1390. {
  1391. IDC_EDIT_XrayLimit.Focus();
  1392. IDC_EDIT_XrayLimit.SelectAll();
  1393. string message = table["message64"].ToString();
  1394. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1395. return false;
  1396. }
  1397. return true;
  1398. }
  1399. /// <summary>
  1400. /// 判断当前样品台是否在被修改
  1401. /// </summary>
  1402. /// <returns></returns>
  1403. public bool IsModified()
  1404. {
  1405. return m_cstagefile.IsModified();
  1406. }
  1407. /// <summary>
  1408. /// 样品台保存
  1409. /// </summary>
  1410. /// <returns></returns>
  1411. public bool StageSave()
  1412. {
  1413. if (!m_cstagefile.Save())
  1414. {
  1415. log.Error("(OTSProgMgrInfoFun.StageLoad) Failed to save sample station information!");
  1416. return false;
  1417. }
  1418. return true;
  1419. }
  1420. private void btnok_Click(object sender, EventArgs e)
  1421. {
  1422. //先判断
  1423. if (false == CheckSetupValues(1))
  1424. {
  1425. return;
  1426. }
  1427. //先把各个值都保存到各类
  1428. m_cotsprogmgrparamfile.m_runmode = (RunMode)IDC_COMBO_Model.SelectedIndex;
  1429. SaveSEMStageData();
  1430. SaveImageScanPrm();
  1431. SaveCGenParam();
  1432. SaveImageProc();
  1433. SaveXRayParam();
  1434. //然后再把各类传入到SaveInfoToProgMgrFile函数中
  1435. if (false == SaveInfoToProgMgrFile())
  1436. {
  1437. return;
  1438. }
  1439. //保存样品台到文件,在被修改时进行保存
  1440. if (true == IsModified())
  1441. {
  1442. if (true == StageSave())
  1443. {
  1444. this.DialogResult = DialogResult.OK;
  1445. this.Close();
  1446. return;
  1447. }
  1448. else
  1449. {
  1450. string message = table["message54"].ToString();
  1451. log.Error("(ProgMgrInfoForm.btnok_Click) " + message);
  1452. this.Close();
  1453. return;
  1454. }
  1455. }
  1456. }
  1457. //关闭窗体
  1458. private void btncancel_Click(object sender, EventArgs e)
  1459. {
  1460. this.Close();
  1461. }
  1462. #endregion
  1463. #region 选择样品台事件
  1464. private void IDC_COMBO_STAGE_SelectedIndexChanged(object sender, EventArgs e)
  1465. {
  1466. //样品台
  1467. if (!StageLoad())
  1468. {
  1469. this.Close();
  1470. return;//加载失败返回
  1471. }
  1472. ThisSetIsModify();
  1473. //加载相关参数信息
  1474. //StageLoad();
  1475. //LoadSEMStageData();
  1476. //LoadImageScanPrm();
  1477. //LoadCGenParam();
  1478. //LoadImageProc();
  1479. //LoadXRayParam();
  1480. }
  1481. /// <summary>
  1482. /// 通过id设置当前正在工作的样品台
  1483. /// </summary>
  1484. /// <param name="id"></param>
  1485. public void SetWorkingStageId(int id)
  1486. {
  1487. m_cstagefile.SetWorkingStageId(id);
  1488. }
  1489. /// <summary>
  1490. /// 设置当前样品台正在被修改中
  1491. /// </summary>
  1492. /// <param name="yn"></param>
  1493. public void SetModify(bool yn)
  1494. {
  1495. m_cstagefile.SetModify(true);
  1496. }
  1497. /// <summary>
  1498. /// 设置当前窗体可以保存了
  1499. /// </summary>
  1500. private void ThisSetIsModify()
  1501. {
  1502. ComboBoxItem cbi = new ComboBoxItem();
  1503. if (IDC_COMBO_STAGE.Items.Count > 0)
  1504. if (null != IDC_COMBO_STAGE.SelectedItem)
  1505. {
  1506. cbi = (ComboBoxItem)IDC_COMBO_STAGE.SelectedItem;
  1507. SetWorkingStageId(Convert.ToInt32(cbi.Value));
  1508. SetModify(true);
  1509. btnok.Enabled = true;
  1510. }
  1511. }
  1512. #endregion
  1513. #region 监视控件改变状态事件
  1514. private void IDC_EDIT_SCREENWIDTH_TextChanged(object sender, EventArgs e)
  1515. {
  1516. ThisSetIsModify();
  1517. }
  1518. private void IDC_COMBO_XDIREC_SelectedIndexChanged(object sender, EventArgs e)
  1519. {
  1520. ThisSetIsModify();
  1521. }
  1522. private void IDC_EDIT_XSTART_TextChanged(object sender, EventArgs e)
  1523. {
  1524. ThisSetIsModify();
  1525. }
  1526. private void IDC_EDIT_XEND_TextChanged(object sender, EventArgs e)
  1527. {
  1528. ThisSetIsModify();
  1529. }
  1530. private void IDC_COMBO_YDIRECT_SelectedIndexChanged(object sender, EventArgs e)
  1531. {
  1532. ThisSetIsModify();
  1533. }
  1534. private void IDC_EDIT_YSTART_TextChanged(object sender, EventArgs e)
  1535. {
  1536. ThisSetIsModify();
  1537. }
  1538. private void IDC_EDIT_YEND_TextChanged(object sender, EventArgs e)
  1539. {
  1540. ThisSetIsModify();
  1541. }
  1542. private void IDC_EDIT_MINMAG_TextChanged(object sender, EventArgs e)
  1543. {
  1544. ThisSetIsModify();
  1545. }
  1546. private void IDC_COMBO_STOPMODE_SelectedIndexChanged(object sender, EventArgs e)
  1547. {
  1548. ThisSetIsModify();
  1549. }
  1550. private void IDC_EDIT_STOP_TIME_TextChanged(object sender, EventArgs e)
  1551. {
  1552. ThisSetIsModify();
  1553. }
  1554. private void IDC_EDIT_STOP_FIELD_NUM_TextChanged(object sender, EventArgs e)
  1555. {
  1556. ThisSetIsModify();
  1557. }
  1558. private void IDC_EDIT_STOP_INCA_NUM_TextChanged(object sender, EventArgs e)
  1559. {
  1560. ThisSetIsModify();
  1561. }
  1562. private void IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged(object sender, EventArgs e)
  1563. {
  1564. ThisSetIsModify();
  1565. }
  1566. private void IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1567. {
  1568. ThisSetIsModify();
  1569. }
  1570. private void IDC_COMBO_IMGSIZE_SelectedIndexChanged(object sender, EventArgs e)
  1571. {
  1572. ThisSetIsModify();
  1573. }
  1574. private void IDC_EDIT_SAMPLENAME_TextChanged(object sender, EventArgs e)
  1575. {
  1576. ThisSetIsModify();
  1577. }
  1578. private void IDC_MEAS_SWITCH_CheckedChanged(object sender, EventArgs e)
  1579. {
  1580. ThisSetIsModify();
  1581. }
  1582. private void IDC_EDIT_MEASUREPARAMPATH_TextChanged(object sender, EventArgs e)
  1583. {
  1584. ThisSetIsModify();
  1585. }
  1586. private void IDC_EDIT_ANALYSESTDLIBPATH_TextChanged(object sender, EventArgs e)
  1587. {
  1588. ThisSetIsModify();
  1589. }
  1590. private void IDC_EDIT_STDLIBNAME_TextChanged(object sender, EventArgs e)
  1591. {
  1592. ThisSetIsModify();
  1593. }
  1594. private void IDC_EDIT_PARTAREAMIN_TextChanged(object sender, EventArgs e)
  1595. {
  1596. ThisSetIsModify();
  1597. }
  1598. private void IDC_EDIT_PARTAREAMAX_TextChanged(object sender, EventArgs e)
  1599. {
  1600. ThisSetIsModify();
  1601. }
  1602. private void IDC_EDIT_BACKMIN_TextChanged(object sender, EventArgs e)
  1603. {
  1604. ThisSetIsModify();
  1605. }
  1606. private void IDC_EDIT_BACKMAX_TextChanged(object sender, EventArgs e)
  1607. {
  1608. ThisSetIsModify();
  1609. }
  1610. private void IDC_EDIT_PARTMIN_TextChanged(object sender, EventArgs e)
  1611. {
  1612. ThisSetIsModify();
  1613. }
  1614. private void IDC_EDIT_PARTMAX_TextChanged(object sender, EventArgs e)
  1615. {
  1616. ThisSetIsModify();
  1617. }
  1618. private void IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1619. {
  1620. ThisSetIsModify();
  1621. }
  1622. private void IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1623. {
  1624. ComboBox cbBGREMOVETYPE = (ComboBox)sender;
  1625. int selectValue=Convert.ToInt32(((OTSMeasureApp.ComboBoxItem)cbBGREMOVETYPE.Items[cbBGREMOVETYPE.SelectedIndex]).Value);
  1626. if (selectValue == (int)otsdataconst.OTS_AUTOBGREMOVETYPE.MANUAL)
  1627. {
  1628. IDC_COMBO_AUTOBGREMOVETYP.Enabled = false;
  1629. }
  1630. else
  1631. {
  1632. IDC_COMBO_AUTOBGREMOVETYP.Enabled = true;
  1633. }
  1634. ThisSetIsModify();
  1635. }
  1636. private void IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1637. {
  1638. ThisSetIsModify();
  1639. }
  1640. private void IDC_EDIT_SEARCHXRAYCOUNTLIMIT_TextChanged(object sender, EventArgs e)
  1641. {
  1642. ThisSetIsModify();
  1643. }
  1644. private void IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged(object sender, EventArgs e)
  1645. {
  1646. ThisSetIsModify();
  1647. }
  1648. private void IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1649. {
  1650. ThisSetIsModify();
  1651. }
  1652. private void IDC_EDIT_ANALYXRAYAIMVALUE_TextChanged(object sender, EventArgs e)
  1653. {
  1654. ThisSetIsModify();
  1655. }
  1656. private void IDC_COMBO_TECHNOLOGY_SelectedIndexChanged(object sender, EventArgs e)
  1657. {
  1658. ThisSetIsModify();
  1659. }
  1660. private void IDC_STOP_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1661. {
  1662. ThisSetIsModify();
  1663. }
  1664. private void IDC_STOP_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1665. {
  1666. ThisSetIsModify();
  1667. }
  1668. private void IDC_STOP_FIELD_SWITCH_CheckedChanged(object sender, EventArgs e)
  1669. {
  1670. ThisSetIsModify();
  1671. }
  1672. private void IDC_STOP_PARTICAL_SWITCH_CheckedChanged(object sender, EventArgs e)
  1673. {
  1674. ThisSetIsModify();
  1675. }
  1676. private void IDC_FETCH_IMAGE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1677. {
  1678. ThisSetIsModify();
  1679. }
  1680. private void IDC_SCAN_SPEED_SWITCH_CheckedChanged(object sender, EventArgs e)
  1681. {
  1682. ThisSetIsModify();
  1683. }
  1684. private void IDC_IMAGE_SIZE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1685. {
  1686. ThisSetIsModify();
  1687. }
  1688. private void IDC_PART_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1689. {
  1690. ThisSetIsModify();
  1691. }
  1692. private void IDC_PART_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1693. {
  1694. ThisSetIsModify();
  1695. }
  1696. private void IDC_BACK_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1697. {
  1698. ThisSetIsModify();
  1699. }
  1700. private void IDC_BACK_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1701. {
  1702. ThisSetIsModify();
  1703. }
  1704. private void IDC_PART_GRAY_SWITCH_CheckedChanged(object sender, EventArgs e)
  1705. {
  1706. ThisSetIsModify();
  1707. }
  1708. private void IDC_PART_GRAY_MAX_CheckedChanged(object sender, EventArgs e)
  1709. {
  1710. ThisSetIsModify();
  1711. }
  1712. private void IDC_XRAY_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1713. {
  1714. ThisSetIsModify();
  1715. }
  1716. private void IDC_XRAY_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1717. {
  1718. ThisSetIsModify();
  1719. }
  1720. private void IDC_XRAY_COUNT_SWITCH_CheckedChanged(object sender, EventArgs e)
  1721. {
  1722. ThisSetIsModify();
  1723. }
  1724. private void cBMeasShape_SelectedIndexChanged(object sender, EventArgs e)
  1725. {
  1726. ThisSetIsModify();
  1727. }
  1728. private void tBMeasArea_TextChanged(object sender, EventArgs e)
  1729. {
  1730. ThisSetIsModify();
  1731. }
  1732. private void IDC_SYS_LIB_CheckedChanged(object sender, EventArgs e)
  1733. {
  1734. ThisSetIsModify();
  1735. }
  1736. #endregion
  1737. private void IDC_COMBO_STDSelect_SelectedIndexChanged(object sender, EventArgs e)
  1738. {
  1739. ThisSetIsModify();
  1740. }
  1741. private void IDC_COMBO_USINGXRAYS_SelectedIndexChanged(object sender, EventArgs e)
  1742. {
  1743. ThisSetIsModify();
  1744. }
  1745. private void IDC_COMBO_Model_SelectedIndexChanged(object sender, EventArgs e)
  1746. {
  1747. ThisSetIsModify();
  1748. }
  1749. private void btn_StopMode_Click(object sender, EventArgs e)
  1750. {
  1751. if (StopModeDialog == null)
  1752. {
  1753. StopModeDialog = new frmMeasureStopMode();
  1754. StopModeDialog.FieldMode = m_cotsimgscanprm.GetStopParamFields();
  1755. StopModeDialog.TimeMode = m_cotsimgscanprm.GetStopParamMeasTime();
  1756. StopModeDialog.ParticleMode = m_cotsimgscanprm.GetStopParamParticles();
  1757. StopModeDialog.AreaMode = m_cotsimgscanprm.GetStopParamArea();
  1758. StopModeDialog.StopMode = tB_StopMode.Text;
  1759. }
  1760. DialogResult result = StopModeDialog.ShowDialog();
  1761. if (result == DialogResult.OK)
  1762. {
  1763. string[] rst = StopModeDialog.StopMode.Split(',');
  1764. string str = "";
  1765. for (int k = 0; k < rst.Length; k++)
  1766. {
  1767. str += rst[k].Split(':')[0] + " + ";
  1768. }
  1769. tB_StopMode.Text = str.Substring(0, str.Length - 3);
  1770. }
  1771. }
  1772. private void IDC_COMBO_CorrosionExpansionCoefficient_TextChanged(object sender, EventArgs e)
  1773. {
  1774. ThisSetIsModify();
  1775. }
  1776. private void button_SpPart_Click(object sender, EventArgs e)
  1777. {
  1778. }
  1779. private void checkBox_Run_CheckedChanged(object sender, EventArgs e)
  1780. {
  1781. }
  1782. private void btn_otherselection_Click(object sender, EventArgs e)
  1783. {
  1784. if (otherSelectionForm == null)
  1785. {
  1786. otherSelectionForm = new _7_OTSProgMgrInfo.OtherSelectionForm();
  1787. otherSelectionForm.OtherSelection = m_cotsimgprocprm.GetParticleSelectCondition();
  1788. }
  1789. DialogResult result = otherSelectionForm.ShowDialog();
  1790. if (result == DialogResult.OK)
  1791. {
  1792. m_cotsimgprocprm.SetParticleSelectCondition(otherSelectionForm.OtherSelection);
  1793. if (otherSelectionForm.OtherSelection == "")
  1794. {
  1795. IDC_EDIT_OTHERSELECTION.Text = "NoFilter";
  1796. }
  1797. else
  1798. {
  1799. IDC_EDIT_OTHERSELECTION.Text = otherSelectionForm.OtherSelection;
  1800. }
  1801. }
  1802. }
  1803. }
  1804. public class ComboBoxItem
  1805. {
  1806. private string _text = null;
  1807. private object _value = null;
  1808. public string Text { get { return this._text; } set { this._text = value; } }
  1809. public object Value { get { return this._value; } set { this._value = value; } }
  1810. public override string ToString()
  1811. {
  1812. return this._text;
  1813. }
  1814. }
  1815. }