ProgMgrInfoForm.cs 80 KB

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