ProgMgrInfoForm.cs 82 KB

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