ProgMgrInfoForm.cs 80 KB

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