ProgMgrInfoForm.cs 80 KB

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