ProgMgrInfoForm.cs 80 KB

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