ProgMgrInfoForm.cs 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041
  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. }
  829. #endregion
  830. #region 各按钮控件点击事件
  831. private void IDC_BUTTON_KLFX_Click(object sender, EventArgs e)
  832. {
  833. try
  834. {
  835. if (IDC_COMBO_STDSelect.Text != "NoSTDDB")
  836. {
  837. Process p = System.Diagnostics.Process.Start(".\\OTSPartA_STDEditor.exe", Application.StartupPath + "\\Config\\SysData\\" + IDC_COMBO_STDSelect.Text);
  838. p.WaitForExit();
  839. }
  840. else
  841. {
  842. string message = table["message55"].ToString();
  843. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  844. }
  845. }
  846. catch (Exception ex)
  847. {
  848. log.Error("OTSPartA_STDEditor:" + ex.ToString());
  849. }
  850. }
  851. private void IDC_BUTTON_MEASPRAMPATHSET_Click(object sender, EventArgs e)
  852. {
  853. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  854. {
  855. IDC_EDIT_MEASUREPARAMPATH.Text = folderBrowserDialog1.SelectedPath;
  856. }
  857. else {
  858. folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
  859. }
  860. }
  861. private void IDC_BUTTON_PARTSTDLIBPATHSET_Click(object sender, EventArgs e)
  862. {
  863. if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  864. {
  865. IDC_EDIT_ANALYSESTDLIBPATH.Text = folderBrowserDialog1.SelectedPath;
  866. }
  867. else {
  868. folderBrowserDialog1.SelectedPath = IDC_EDIT_ANALYSESTDLIBPATH.Text;
  869. }
  870. }
  871. /// <summary>
  872. /// 弹出样品台管理窗体
  873. /// </summary>
  874. /// <param name="a_nPackId"></param>
  875. /// <param name="a_pStageFile"></param>
  876. /// <returns></returns>
  877. public void ShowStageDialogExport()
  878. {
  879. DlgStageMgr dlgStageMgr = new DlgStageMgr(m_cstagefile);
  880. dlgStageMgr.ShowDialog();
  881. return;
  882. }
  883. /// <summary>
  884. /// 保存样品台信息
  885. /// </summary>
  886. /// <returns></returns>
  887. public bool CStageFileClrSave()
  888. {
  889. if (m_cstagefile == null)
  890. {
  891. //报错
  892. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) 保存样品台信息出错!");
  893. }
  894. else
  895. {
  896. bool b_ret = m_cstagefile.Save();
  897. if (false == b_ret)
  898. {
  899. log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) 保存样品台信息出错!");
  900. }
  901. }
  902. return false;
  903. }
  904. private void IDC_BUTTON_STAGE_Click(object sender, EventArgs e)
  905. {
  906. //弹出管理样品台管理窗体
  907. ShowStageDialogExport();
  908. //弹出后再保存样品台信息
  909. CStageFileClrSave();
  910. //刷新绑定样品台列表
  911. BindStageCombobox();
  912. //检测是否已经有修改
  913. ThisSetIsModify();
  914. }
  915. /// <summary>
  916. /// 判断各控件值是否正确
  917. /// </summary>
  918. /// <returns></returns>
  919. private bool CheckSetupValues(int bz)
  920. {
  921. if ("" == IDC_COMBO_STAGE.Text)
  922. {
  923. string message = table["message1"].ToString();
  924. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  925. IDC_COMBO_STAGE.Focus();
  926. IDC_COMBO_STAGE.SelectAll();
  927. return false;
  928. }
  929. if ("" == IDC_EDIT_SCREENWIDTH.Text)
  930. {
  931. string message = table["message2"].ToString();
  932. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  933. IDC_EDIT_SCREENWIDTH.Focus();
  934. IDC_EDIT_SCREENWIDTH.SelectAll();
  935. return false;
  936. }
  937. if ("" == IDC_COMBO_XDIREC.Text)
  938. {
  939. string message = table["message3"].ToString();
  940. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  941. IDC_COMBO_XDIREC.Focus();
  942. IDC_COMBO_XDIREC.SelectAll();
  943. return false;
  944. }
  945. if ("" == IDC_EDIT_XSTART.Text)
  946. {
  947. string message = table["message4"].ToString();
  948. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  949. IDC_EDIT_XSTART.Focus();
  950. IDC_EDIT_XSTART.SelectAll();
  951. return false;
  952. }
  953. if ("" == IDC_EDIT_XEND.Text)
  954. {
  955. string message = table["message4"].ToString();
  956. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  957. IDC_EDIT_XEND.Focus();
  958. IDC_EDIT_XEND.SelectAll();
  959. return false;
  960. }
  961. if ("" == IDC_COMBO_YDIRECT.Text)
  962. {
  963. string message = table["message5"].ToString();
  964. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  965. IDC_COMBO_YDIRECT.Focus();
  966. IDC_COMBO_YDIRECT.SelectAll();
  967. return false;
  968. }
  969. if ("" == IDC_EDIT_YSTART.Text)
  970. {
  971. string message = table["message6"].ToString();
  972. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  973. IDC_EDIT_YSTART.Focus();
  974. IDC_EDIT_YSTART.SelectAll();
  975. return false;
  976. }
  977. if ("" == IDC_EDIT_YEND.Text)
  978. {
  979. string message = table["message6"].ToString();
  980. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  981. IDC_EDIT_YEND.Focus();
  982. IDC_EDIT_YEND.SelectAll();
  983. return false;
  984. }
  985. if ("" == IDC_EDIT_STOP_TIME.Text)
  986. {
  987. string message = table["message7"].ToString();
  988. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  989. IDC_EDIT_STOP_TIME.Focus();
  990. IDC_EDIT_STOP_TIME.SelectAll();
  991. return false;
  992. }
  993. if ("" == IDC_EDIT_STOP_FIELD_NUM.Text)
  994. {
  995. string message = table["message8"].ToString();
  996. MessageBox.Show("终止帧图数不能为空", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  997. IDC_EDIT_STOP_FIELD_NUM.Focus();
  998. IDC_EDIT_STOP_FIELD_NUM.SelectAll();
  999. return false;
  1000. }
  1001. if ("" == IDC_EDIT_STOP_INCA_NUM.Text)
  1002. {
  1003. string message = table["message9"].ToString();
  1004. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1005. IDC_EDIT_STOP_INCA_NUM.Focus();
  1006. IDC_EDIT_STOP_INCA_NUM.SelectAll();
  1007. return false;
  1008. }
  1009. if ("" == IDC_COMBO_FETCHIMGMODE.Text)
  1010. {
  1011. string message = table["message10"].ToString();
  1012. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1013. IDC_COMBO_FETCHIMGMODE.Focus();
  1014. IDC_COMBO_FETCHIMGMODE.SelectAll();
  1015. return false;
  1016. }
  1017. if ("" == IDC_COMBO_IMGSCANSPEED.Text)
  1018. {
  1019. string message = table["message11"].ToString();
  1020. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1021. IDC_COMBO_IMGSCANSPEED.Focus();
  1022. IDC_COMBO_IMGSCANSPEED.SelectAll();
  1023. return false;
  1024. }
  1025. if ("" == IDC_COMBO_IMGSIZE.Text)
  1026. {
  1027. string message = table["message12"].ToString();
  1028. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1029. IDC_COMBO_IMGSIZE.Focus();
  1030. IDC_COMBO_IMGSIZE.SelectAll();
  1031. return false;
  1032. }
  1033. if ("" == IDC_EDIT_MINMAG.Text)
  1034. {
  1035. string message = table["message13"].ToString();
  1036. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1037. IDC_EDIT_MINMAG.Focus();
  1038. IDC_EDIT_MINMAG.SelectAll();
  1039. return false;
  1040. }
  1041. if ("" == IDC_EDIT_PARTAREAMIN.Text)
  1042. {
  1043. string message = table["message14"].ToString();
  1044. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1045. IDC_EDIT_PARTAREAMIN.Focus();
  1046. IDC_EDIT_PARTAREAMIN.SelectAll();
  1047. return false;
  1048. }
  1049. if ("" == IDC_EDIT_PARTAREAMAX.Text)
  1050. {
  1051. string message = table["message15"].ToString();
  1052. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1053. IDC_EDIT_PARTAREAMAX.Focus();
  1054. IDC_EDIT_PARTAREAMAX.SelectAll();
  1055. return false;
  1056. }
  1057. if ("" == IDC_EDIT_BACKMIN.Text)
  1058. {
  1059. string message = table["message16"].ToString();
  1060. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1061. IDC_EDIT_BACKMIN.Focus();
  1062. IDC_EDIT_BACKMIN.SelectAll();
  1063. return false;
  1064. }
  1065. if ("" == IDC_EDIT_BACKMAX.Text)
  1066. {
  1067. string message = table["message17"].ToString();
  1068. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1069. IDC_EDIT_BACKMAX.Focus();
  1070. IDC_EDIT_BACKMAX.SelectAll();
  1071. return false;
  1072. }
  1073. if ("" == IDC_EDIT_PARTMIN.Text)
  1074. {
  1075. string message = table["message18"].ToString();
  1076. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1077. IDC_EDIT_PARTMIN.Focus();
  1078. IDC_EDIT_PARTMIN.SelectAll();
  1079. return false;
  1080. }
  1081. if ("" == IDC_EDIT_PARTMAX.Text)
  1082. {
  1083. string message = table["message19"].ToString();
  1084. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1085. IDC_EDIT_PARTMAX.Focus();
  1086. IDC_EDIT_PARTMAX.SelectAll();
  1087. return false;
  1088. }
  1089. if ("" == IDC_COMBO_XRAYSCANMODE.Text)
  1090. {
  1091. string message = table["message20"].ToString();
  1092. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1093. IDC_COMBO_XRAYSCANMODE.Focus();
  1094. IDC_COMBO_XRAYSCANMODE.SelectAll();
  1095. return false;
  1096. }
  1097. if ("" == IDC_COMBO_USINGXRAYS.Text)
  1098. {
  1099. string message = table["message61"].ToString();
  1100. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1101. IDC_COMBO_USINGXRAYS.Focus();
  1102. IDC_COMBO_USINGXRAYS.SelectAll();
  1103. return false;
  1104. }
  1105. if ("" == IDC_COMBO_ANALYXRAYSPEED.Text)
  1106. {
  1107. string message = table["message21"].ToString();
  1108. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1109. IDC_COMBO_ANALYXRAYSPEED.Focus();
  1110. IDC_COMBO_ANALYXRAYSPEED.SelectAll();
  1111. return false;
  1112. }
  1113. if ("" == IDC_EDIT_ANALYXRAYAIMVALUE.Text)
  1114. {
  1115. string message = table["message22"].ToString();
  1116. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1117. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1118. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1119. return false;
  1120. }
  1121. if ("" == tBMeasArea.Text)
  1122. {
  1123. MessageBox.Show("输入的测量区域面积不可以为空!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1124. tBMeasArea.Focus();
  1125. tBMeasArea.SelectAll();
  1126. return false;
  1127. }
  1128. //string pat = @"^(-|\+)?\d{1,8}$";//只能输入1到3位的正负整数
  1129. string pat = @"^-?[0-9]\d*$";//只能限定正负整数,包含0
  1130. string scope = @"^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$";
  1131. string PositiveDecimals = @"^(([1-9]\d*)(\.\d+)?)$|^0\.\d*[1-9]$"; //正浮点数
  1132. Regex rg = new Regex(pat);
  1133. Regex rgScope = new Regex(scope);
  1134. Regex rgPositiveDecimals = new Regex(PositiveDecimals);
  1135. //是否是正确的数值格式类型判断
  1136. //100倍时屏幕尺寸
  1137. if (false == rg.Match(IDC_EDIT_SCREENWIDTH.Text.Trim()).Success)
  1138. {
  1139. IDC_EDIT_SCREENWIDTH.Focus();
  1140. IDC_EDIT_SCREENWIDTH.SelectAll();
  1141. string message = table["message23"].ToString();
  1142. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1143. return false;
  1144. }
  1145. //x轴行程/mm 起
  1146. if (false == rg.Match(IDC_EDIT_XSTART.Text.Trim()).Success)
  1147. {
  1148. IDC_EDIT_XSTART.Focus();
  1149. IDC_EDIT_XSTART.SelectAll();
  1150. string message = table["message24"].ToString();
  1151. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1152. return false;
  1153. }
  1154. //x轴行程/mm 止
  1155. if (false == rg.Match(IDC_EDIT_XEND.Text.Trim()).Success)
  1156. {
  1157. IDC_EDIT_XEND.Focus();
  1158. IDC_EDIT_XEND.SelectAll();
  1159. string message = table["message25"].ToString();
  1160. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1161. return false;
  1162. }
  1163. //y轴行程/mm 起
  1164. if (false == rg.Match(IDC_EDIT_YSTART.Text.Trim()).Success)
  1165. {
  1166. IDC_EDIT_YSTART.Focus();
  1167. IDC_EDIT_YSTART.SelectAll();
  1168. string message = table["message26"].ToString();
  1169. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1170. return false;
  1171. }
  1172. //y轴行程/mm 止
  1173. if (false == rg.Match(IDC_EDIT_YEND.Text.Trim()).Success)
  1174. {
  1175. IDC_EDIT_YEND.Focus();
  1176. IDC_EDIT_YEND.SelectAll();
  1177. string message = table["message27"].ToString();
  1178. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1179. return false;
  1180. }
  1181. //终止时间
  1182. if (false == rg.Match(IDC_EDIT_STOP_TIME.Text.Trim()).Success)
  1183. {
  1184. IDC_EDIT_STOP_TIME.Focus();
  1185. IDC_EDIT_STOP_TIME.SelectAll();
  1186. string message = table["message28"].ToString();
  1187. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1188. return false;
  1189. }
  1190. //终止帧图数
  1191. if (false == rg.Match(IDC_EDIT_STOP_FIELD_NUM.Text.Trim()).Success)
  1192. {
  1193. IDC_EDIT_STOP_FIELD_NUM.Focus();
  1194. IDC_EDIT_STOP_FIELD_NUM.SelectAll();
  1195. string message = table["message29"].ToString();
  1196. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1197. return false;
  1198. }
  1199. //终止夹杂物数
  1200. if (false == rg.Match(IDC_EDIT_STOP_INCA_NUM.Text.Trim()).Success)
  1201. {
  1202. IDC_EDIT_STOP_INCA_NUM.Focus();
  1203. IDC_EDIT_STOP_INCA_NUM.SelectAll();
  1204. string message = table["message30"].ToString();
  1205. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1206. return false;
  1207. }
  1208. //颗粒面积范围 最小
  1209. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMIN.Text.Trim()).Success)
  1210. {
  1211. IDC_EDIT_PARTAREAMIN.Focus();
  1212. IDC_EDIT_PARTAREAMIN.SelectAll();
  1213. string message = table["message31"].ToString();
  1214. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1215. return false;
  1216. }
  1217. //颗粒面积范围 最大
  1218. if (false == rgPositiveDecimals.Match(IDC_EDIT_PARTAREAMAX.Text.Trim()).Success)
  1219. {
  1220. IDC_EDIT_PARTAREAMAX.Focus();
  1221. IDC_EDIT_PARTAREAMAX.SelectAll();
  1222. string message = table["message32"].ToString();
  1223. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1224. return false;
  1225. }
  1226. //背景灰度范围 最小
  1227. if (false == rg.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1228. {
  1229. IDC_EDIT_BACKMIN.Focus();
  1230. IDC_EDIT_BACKMIN.SelectAll();
  1231. string message = table["message33"].ToString();
  1232. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1233. return false;
  1234. }
  1235. else
  1236. {
  1237. if (false == rgScope.Match(IDC_EDIT_BACKMIN.Text.Trim()).Success)
  1238. {
  1239. IDC_EDIT_BACKMIN.Focus();
  1240. IDC_EDIT_BACKMIN.SelectAll();
  1241. string message = table["message34"].ToString();
  1242. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1243. return false;
  1244. }
  1245. }
  1246. //背景灰度范围 最大
  1247. if (false == rg.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1248. {
  1249. IDC_EDIT_BACKMAX.Focus();
  1250. IDC_EDIT_BACKMAX.SelectAll();
  1251. string message = table["message35"].ToString();
  1252. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1253. return false;
  1254. }
  1255. else
  1256. {
  1257. if (false == rgScope.Match(IDC_EDIT_BACKMAX.Text.Trim()).Success)
  1258. {
  1259. IDC_EDIT_BACKMAX.Focus();
  1260. IDC_EDIT_BACKMAX.SelectAll();
  1261. string message = table["message36"].ToString();
  1262. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1263. return false;
  1264. }
  1265. }
  1266. //颗粒灰度范围 最小
  1267. if (false == rg.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1268. {
  1269. IDC_EDIT_PARTMIN.Focus();
  1270. IDC_EDIT_PARTMIN.SelectAll();
  1271. string message = table["message37"].ToString();
  1272. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1273. return false;
  1274. }
  1275. else
  1276. {
  1277. if (false == rgScope.Match(IDC_EDIT_PARTMIN.Text.Trim()).Success)
  1278. {
  1279. IDC_EDIT_PARTMIN.Focus();
  1280. IDC_EDIT_PARTMIN.SelectAll();
  1281. string message = table["message38"].ToString();
  1282. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1283. return false;
  1284. }
  1285. }
  1286. //颗粒灰度范围 最大
  1287. if (false == rg.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1288. {
  1289. IDC_EDIT_PARTMAX.Focus();
  1290. IDC_EDIT_PARTMAX.SelectAll();
  1291. string message = table["message39"].ToString();
  1292. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1293. return false;
  1294. }
  1295. else
  1296. {
  1297. if (false == rgScope.Match(IDC_EDIT_PARTMAX.Text.Trim()).Success)
  1298. {
  1299. IDC_EDIT_PARTMAX.Focus();
  1300. IDC_EDIT_PARTMAX.SelectAll();
  1301. string message = table["message40"].ToString();
  1302. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1303. return false;
  1304. }
  1305. }
  1306. //分析X-ray计数期望值 最大
  1307. if (false == rg.Match(IDC_EDIT_ANALYXRAYAIMVALUE.Text.Trim()).Success)
  1308. {
  1309. IDC_EDIT_ANALYXRAYAIMVALUE.Focus();
  1310. IDC_EDIT_ANALYXRAYAIMVALUE.SelectAll();
  1311. string message = table["message41"].ToString();
  1312. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1313. return false;
  1314. }
  1315. //分析X-ray精度对应的时间
  1316. if (false == rg.Match(IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()).Success)
  1317. {
  1318. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Focus();
  1319. IDC_TEXTBOX_ANALYXRAYSPEED_TIME.SelectAll();
  1320. string message = table["message42"].ToString();
  1321. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1322. return false;
  1323. }
  1324. //测量区域面积mm2
  1325. if (false == rg.Match(tBMeasArea.Text.Trim()).Success)
  1326. {
  1327. tBMeasArea.Focus();
  1328. tBMeasArea.SelectAll();
  1329. MessageBox.Show("请输入正确的数值格式!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1330. return false;
  1331. }
  1332. pat = @"^[0-9]+(\.[0-9]{1,3})?$"; //只能输入,1到3位小数的正数
  1333. rg = new Regex(pat);
  1334. //最小放大倍数
  1335. if (false == rg.Match(IDC_EDIT_MINMAG.Text.Trim()).Success)
  1336. {
  1337. IDC_EDIT_MINMAG.Focus();
  1338. IDC_EDIT_MINMAG.SelectAll();
  1339. string message = table["message43"].ToString();
  1340. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1341. return false;
  1342. }
  1343. //最小放大倍数不得小于45倍
  1344. if (Convert.ToInt32(IDC_EDIT_MINMAG.Text.Trim()) < 45)
  1345. {
  1346. IDC_EDIT_MINMAG.Focus();
  1347. IDC_EDIT_MINMAG.SelectAll();
  1348. string message = "最小放大倍数不可以小于45倍";
  1349. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1350. return false;
  1351. }
  1352. //再限制,x轴,y轴,的起止的,输入长度,因为现在已经有在mm和um之间的转换,所以这里要限制一下
  1353. //x轴行程/mm 起
  1354. if (IDC_EDIT_XSTART.Text.Length > 4)
  1355. {
  1356. IDC_EDIT_XSTART.Focus();
  1357. IDC_EDIT_XSTART.SelectAll();
  1358. string message = table["message44"].ToString();
  1359. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1360. return false;
  1361. }
  1362. //x轴行程/mm 止
  1363. if (IDC_EDIT_XEND.Text.Length > 4)
  1364. {
  1365. IDC_EDIT_XEND.Focus();
  1366. IDC_EDIT_XEND.SelectAll();
  1367. string message = table["message45"].ToString();
  1368. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1369. return false;
  1370. }
  1371. //y轴行程/mm 起
  1372. if (IDC_EDIT_YSTART.Text.Length > 4)
  1373. {
  1374. IDC_EDIT_YSTART.Focus();
  1375. IDC_EDIT_YSTART.SelectAll();
  1376. string message = table["message46"].ToString();
  1377. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1378. return false;
  1379. }
  1380. //y轴行程/mm 止
  1381. if (IDC_EDIT_YEND.Text.Length > 4)
  1382. {
  1383. IDC_EDIT_YEND.Focus();
  1384. IDC_EDIT_YEND.SelectAll();
  1385. string message = table["message47"].ToString();
  1386. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1387. return false;
  1388. }
  1389. if (Convert.ToInt32(IDC_EDIT_XSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_XEND.Text.Trim()))
  1390. {
  1391. IDC_EDIT_XEND.Focus();
  1392. IDC_EDIT_XEND.SelectAll();
  1393. string message = table["message50"].ToString();
  1394. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1395. return false;
  1396. }
  1397. if (Convert.ToInt32(IDC_EDIT_YSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_YEND.Text.Trim()))
  1398. {
  1399. IDC_EDIT_YEND.Focus();
  1400. IDC_EDIT_YEND.SelectAll();
  1401. string message = table["message53"].ToString();
  1402. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1403. return false;
  1404. }
  1405. //颗粒尺寸范围
  1406. if (Convert.ToDouble(IDC_EDIT_PARTAREAMIN.Text.Trim()) > Convert.ToDouble(IDC_EDIT_PARTAREAMAX.Text.Trim()))
  1407. {
  1408. IDC_EDIT_PARTAREAMIN.Focus();
  1409. IDC_EDIT_PARTAREAMIN.SelectAll();
  1410. string message = table["message56"].ToString();
  1411. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1412. return false;
  1413. }
  1414. //背景灰度范围
  1415. if (Convert.ToInt32(IDC_EDIT_BACKMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_BACKMAX.Text.Trim()))
  1416. {
  1417. IDC_EDIT_BACKMIN.Focus();
  1418. IDC_EDIT_BACKMIN.SelectAll();
  1419. string message = table["message57"].ToString();
  1420. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1421. return false;
  1422. }
  1423. //颗粒灰度范围
  1424. if (Convert.ToInt32(IDC_EDIT_PARTMIN.Text.Trim()) > Convert.ToInt32(IDC_EDIT_PARTMAX.Text.Trim()))
  1425. {
  1426. IDC_EDIT_PARTMIN.Focus();
  1427. IDC_EDIT_PARTMIN.SelectAll();
  1428. string message = table["message58"].ToString();
  1429. MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1430. return false;
  1431. }
  1432. return true;
  1433. }
  1434. /// <summary>
  1435. /// 判断当前样品台是否在被修改
  1436. /// </summary>
  1437. /// <returns></returns>
  1438. public bool IsModified()
  1439. {
  1440. return m_cstagefile.IsModified();
  1441. }
  1442. /// <summary>
  1443. /// 样品台保存
  1444. /// </summary>
  1445. /// <returns></returns>
  1446. public bool StageSave()
  1447. {
  1448. if (!m_cstagefile.Save())
  1449. {
  1450. log.Error("(OTSProgMgrInfoFun.StageLoad) 保存样品台信息失败");
  1451. return false;
  1452. }
  1453. return true;
  1454. }
  1455. private void btnok_Click(object sender, EventArgs e)
  1456. {
  1457. //先判断
  1458. if (false == CheckSetupValues(1))
  1459. {
  1460. return;
  1461. }
  1462. //先把各个值都保存到各类
  1463. SaveSEMStageData();
  1464. SaveImageScanPrm();
  1465. SaveCGenParam();
  1466. SaveImageProc();
  1467. SaveXRayParam();
  1468. //然后再把各类传入到SaveInfoToProgMgrFile函数中
  1469. if (false == SaveInfoToProgMgrFile())
  1470. {
  1471. return;
  1472. }
  1473. //保存样品台到文件,在被修改时进行保存
  1474. if (true == IsModified())
  1475. {
  1476. if (true == StageSave())
  1477. {
  1478. this.DialogResult = DialogResult.OK;
  1479. this.Close();
  1480. return;
  1481. }
  1482. else
  1483. {
  1484. string message = table["message54"].ToString();
  1485. log.Error("(ProgMgrInfoForm.btnok_Click) " + message);
  1486. this.Close();
  1487. return;
  1488. }
  1489. }
  1490. }
  1491. //关闭窗体
  1492. private void btncancel_Click(object sender, EventArgs e)
  1493. {
  1494. this.Close();
  1495. }
  1496. #endregion
  1497. #region 选择样品台事件
  1498. private void IDC_COMBO_STAGE_SelectedIndexChanged(object sender, EventArgs e)
  1499. {
  1500. //样品台
  1501. if (!StageLoad())
  1502. {
  1503. this.Close();
  1504. return;//加载失败返回
  1505. }
  1506. ThisSetIsModify();
  1507. //加载相关参数信息
  1508. //StageLoad();
  1509. LoadSEMStageData();
  1510. LoadImageScanPrm();
  1511. LoadCGenParam();
  1512. LoadImageProc();
  1513. LoadXRayParam();
  1514. }
  1515. /// <summary>
  1516. /// 通过id设置当前正在工作的样品台
  1517. /// </summary>
  1518. /// <param name="id"></param>
  1519. public void SetWorkingStageId(int id)
  1520. {
  1521. m_cstagefile.SetWorkingStageId(id);
  1522. }
  1523. /// <summary>
  1524. /// 设置当前样品台正在被修改中
  1525. /// </summary>
  1526. /// <param name="yn"></param>
  1527. public void SetModify(bool yn)
  1528. {
  1529. m_cstagefile.SetModify(true);
  1530. }
  1531. /// <summary>
  1532. /// 设置当前窗体可以保存了
  1533. /// </summary>
  1534. private void ThisSetIsModify()
  1535. {
  1536. ComboBoxItem cbi = new ComboBoxItem();
  1537. if (IDC_COMBO_STAGE.Items.Count > 0)
  1538. if (null != IDC_COMBO_STAGE.SelectedItem)
  1539. {
  1540. cbi = (ComboBoxItem)IDC_COMBO_STAGE.SelectedItem;
  1541. SetWorkingStageId(Convert.ToInt32(cbi.Value));
  1542. SetModify(true);
  1543. btnok.Enabled = true;
  1544. }
  1545. }
  1546. #endregion
  1547. #region 监视控件改变状态事件
  1548. private void IDC_EDIT_SCREENWIDTH_TextChanged(object sender, EventArgs e)
  1549. {
  1550. ThisSetIsModify();
  1551. }
  1552. private void IDC_COMBO_XDIREC_SelectedIndexChanged(object sender, EventArgs e)
  1553. {
  1554. ThisSetIsModify();
  1555. }
  1556. private void IDC_EDIT_XSTART_TextChanged(object sender, EventArgs e)
  1557. {
  1558. ThisSetIsModify();
  1559. }
  1560. private void IDC_EDIT_XEND_TextChanged(object sender, EventArgs e)
  1561. {
  1562. ThisSetIsModify();
  1563. }
  1564. private void IDC_COMBO_YDIRECT_SelectedIndexChanged(object sender, EventArgs e)
  1565. {
  1566. ThisSetIsModify();
  1567. }
  1568. private void IDC_EDIT_YSTART_TextChanged(object sender, EventArgs e)
  1569. {
  1570. ThisSetIsModify();
  1571. }
  1572. private void IDC_EDIT_YEND_TextChanged(object sender, EventArgs e)
  1573. {
  1574. ThisSetIsModify();
  1575. }
  1576. private void IDC_EDIT_MINMAG_TextChanged(object sender, EventArgs e)
  1577. {
  1578. ThisSetIsModify();
  1579. }
  1580. private void IDC_COMBO_STOPMODE_SelectedIndexChanged(object sender, EventArgs e)
  1581. {
  1582. ThisSetIsModify();
  1583. }
  1584. private void IDC_EDIT_STOP_TIME_TextChanged(object sender, EventArgs e)
  1585. {
  1586. ThisSetIsModify();
  1587. }
  1588. private void IDC_EDIT_STOP_FIELD_NUM_TextChanged(object sender, EventArgs e)
  1589. {
  1590. ThisSetIsModify();
  1591. }
  1592. private void IDC_EDIT_STOP_INCA_NUM_TextChanged(object sender, EventArgs e)
  1593. {
  1594. ThisSetIsModify();
  1595. }
  1596. private void IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged(object sender, EventArgs e)
  1597. {
  1598. ThisSetIsModify();
  1599. }
  1600. private void IDC_COMBO_IMGSCANSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1601. {
  1602. ThisSetIsModify();
  1603. }
  1604. private void IDC_COMBO_IMGSIZE_SelectedIndexChanged(object sender, EventArgs e)
  1605. {
  1606. ThisSetIsModify();
  1607. }
  1608. private void IDC_EDIT_SAMPLENAME_TextChanged(object sender, EventArgs e)
  1609. {
  1610. ThisSetIsModify();
  1611. }
  1612. private void IDC_MEAS_SWITCH_CheckedChanged(object sender, EventArgs e)
  1613. {
  1614. ThisSetIsModify();
  1615. }
  1616. private void IDC_EDIT_MEASUREPARAMPATH_TextChanged(object sender, EventArgs e)
  1617. {
  1618. ThisSetIsModify();
  1619. }
  1620. private void IDC_EDIT_ANALYSESTDLIBPATH_TextChanged(object sender, EventArgs e)
  1621. {
  1622. ThisSetIsModify();
  1623. }
  1624. private void IDC_EDIT_STDLIBNAME_TextChanged(object sender, EventArgs e)
  1625. {
  1626. ThisSetIsModify();
  1627. }
  1628. private void IDC_EDIT_PARTAREAMIN_TextChanged(object sender, EventArgs e)
  1629. {
  1630. ThisSetIsModify();
  1631. }
  1632. private void IDC_EDIT_PARTAREAMAX_TextChanged(object sender, EventArgs e)
  1633. {
  1634. ThisSetIsModify();
  1635. }
  1636. private void IDC_EDIT_BACKMIN_TextChanged(object sender, EventArgs e)
  1637. {
  1638. ThisSetIsModify();
  1639. }
  1640. private void IDC_EDIT_BACKMAX_TextChanged(object sender, EventArgs e)
  1641. {
  1642. ThisSetIsModify();
  1643. }
  1644. private void IDC_EDIT_PARTMIN_TextChanged(object sender, EventArgs e)
  1645. {
  1646. ThisSetIsModify();
  1647. }
  1648. private void IDC_EDIT_PARTMAX_TextChanged(object sender, EventArgs e)
  1649. {
  1650. ThisSetIsModify();
  1651. }
  1652. private void IDC_COMBO_AUTOBGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1653. {
  1654. ThisSetIsModify();
  1655. }
  1656. private void IDC_COMBO_BGREMOVETYPE_SelectedIndexChanged(object sender, EventArgs e)
  1657. {
  1658. ComboBox cbBGREMOVETYPE = (ComboBox)sender;
  1659. int selectValue=Convert.ToInt32(((OTSMeasureApp.ComboBoxItem)cbBGREMOVETYPE.Items[cbBGREMOVETYPE.SelectedIndex]).Value);
  1660. if (selectValue == (int)otsdataconst.OTS_AUTOBGREMOVETYPE.MANUAL)
  1661. {
  1662. IDC_COMBO_AUTOBGREMOVETYP.Enabled = false;
  1663. }
  1664. else
  1665. {
  1666. IDC_COMBO_AUTOBGREMOVETYP.Enabled = true;
  1667. }
  1668. ThisSetIsModify();
  1669. }
  1670. private void IDC_COMBO_SEARCHXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1671. {
  1672. ThisSetIsModify();
  1673. }
  1674. private void IDC_EDIT_SEARCHXRAYCOUNTLIMIT_TextChanged(object sender, EventArgs e)
  1675. {
  1676. ThisSetIsModify();
  1677. }
  1678. private void IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged(object sender, EventArgs e)
  1679. {
  1680. ThisSetIsModify();
  1681. }
  1682. private void IDC_COMBO_ANALYXRAYSPEED_SelectedIndexChanged(object sender, EventArgs e)
  1683. {
  1684. ThisSetIsModify();
  1685. }
  1686. private void IDC_EDIT_ANALYXRAYAIMVALUE_TextChanged(object sender, EventArgs e)
  1687. {
  1688. ThisSetIsModify();
  1689. }
  1690. //选择颗粒标准库下拉框
  1691. //private void IDC_COMBO_STDLIBSELECT_SelectedIndexChanged(object sender, EventArgs e)
  1692. //{
  1693. // ComboBoxItem cbi = new ComboBoxItem();
  1694. // cbi = (ComboBoxItem)IDC_COMBO_STDLIBSELECT.SelectedItem;
  1695. // ThisSetIsModify();
  1696. //}
  1697. private void IDC_COMBO_TECHNOLOGY_SelectedIndexChanged(object sender, EventArgs e)
  1698. {
  1699. ThisSetIsModify();
  1700. }
  1701. private void IDC_STOP_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1702. {
  1703. ThisSetIsModify();
  1704. }
  1705. private void IDC_STOP_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1706. {
  1707. ThisSetIsModify();
  1708. }
  1709. private void IDC_STOP_FIELD_SWITCH_CheckedChanged(object sender, EventArgs e)
  1710. {
  1711. ThisSetIsModify();
  1712. }
  1713. private void IDC_STOP_PARTICAL_SWITCH_CheckedChanged(object sender, EventArgs e)
  1714. {
  1715. ThisSetIsModify();
  1716. }
  1717. private void IDC_FETCH_IMAGE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1718. {
  1719. ThisSetIsModify();
  1720. }
  1721. private void IDC_SCAN_SPEED_SWITCH_CheckedChanged(object sender, EventArgs e)
  1722. {
  1723. ThisSetIsModify();
  1724. }
  1725. private void IDC_IMAGE_SIZE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1726. {
  1727. ThisSetIsModify();
  1728. }
  1729. private void IDC_PART_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1730. {
  1731. ThisSetIsModify();
  1732. }
  1733. private void IDC_PART_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1734. {
  1735. ThisSetIsModify();
  1736. }
  1737. private void IDC_BACK_MIN_SWITCH_CheckedChanged(object sender, EventArgs e)
  1738. {
  1739. ThisSetIsModify();
  1740. }
  1741. private void IDC_BACK_MAX_SWITCH_CheckedChanged(object sender, EventArgs e)
  1742. {
  1743. ThisSetIsModify();
  1744. }
  1745. private void IDC_PART_GRAY_SWITCH_CheckedChanged(object sender, EventArgs e)
  1746. {
  1747. ThisSetIsModify();
  1748. }
  1749. private void IDC_PART_GRAY_MAX_CheckedChanged(object sender, EventArgs e)
  1750. {
  1751. ThisSetIsModify();
  1752. }
  1753. private void IDC_XRAY_MODE_SWITCH_CheckedChanged(object sender, EventArgs e)
  1754. {
  1755. ThisSetIsModify();
  1756. }
  1757. private void IDC_XRAY_TIME_SWITCH_CheckedChanged(object sender, EventArgs e)
  1758. {
  1759. ThisSetIsModify();
  1760. }
  1761. private void IDC_XRAY_COUNT_SWITCH_CheckedChanged(object sender, EventArgs e)
  1762. {
  1763. ThisSetIsModify();
  1764. }
  1765. private void cBMeasShape_SelectedIndexChanged(object sender, EventArgs e)
  1766. {
  1767. ThisSetIsModify();
  1768. }
  1769. private void tBMeasArea_TextChanged(object sender, EventArgs e)
  1770. {
  1771. ThisSetIsModify();
  1772. }
  1773. private void IDC_SYS_LIB_CheckedChanged(object sender, EventArgs e)
  1774. {
  1775. ThisSetIsModify();
  1776. }
  1777. #endregion
  1778. private void IDC_COMBO_STDSelect_SelectedIndexChanged(object sender, EventArgs e)
  1779. {
  1780. ThisSetIsModify();
  1781. }
  1782. private void IDC_COMBO_USINGXRAYS_SelectedIndexChanged(object sender, EventArgs e)
  1783. {
  1784. ThisSetIsModify();
  1785. }
  1786. private void IDC_COMBO_Model_SelectedIndexChanged(object sender, EventArgs e)
  1787. {
  1788. ThisSetIsModify();
  1789. }
  1790. }
  1791. public class ComboBoxItem
  1792. {
  1793. private string _text = null;
  1794. private object _value = null;
  1795. public string Text { get { return this._text; } set { this._text = value; } }
  1796. public object Value { get { return this._value; } set { this._value = value; } }
  1797. public override string ToString()
  1798. {
  1799. return this._text;
  1800. }
  1801. }
  1802. }