ProgMgrInfoForm.cs 82 KB

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