ProgMgrInfoForm.cs 80 KB

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