ProgMgrInfoForm.cs 81 KB

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