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