ProgMgrInfoForm.cs 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052
  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+".db");
  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. }