COTSMeasureParam.cs 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381
  1. using OTSModelSharp;
  2. using OTSDataType;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.IO;
  8. using OTSModelSharp.ResourceManage;
  9. using static OTSModelSharp.ResourceManage.ResourceID;
  10. using static OTSModelSharp.ResourceManage.ResourceData;
  11. using static OTSDataType.otsdataconst;
  12. using System.Windows.Forms;
  13. using OTSMeasureApp._0_OTSModel.OTSDataType;
  14. namespace OTSMeasureApp
  15. {
  16. //设置线程状态
  17. public enum MSR_RUN_TYPE
  18. {
  19. RUNMEASURE = 1, //normal
  20. RUNSampleHoleImage = 2 //take photo of the measure area.
  21. };
  22. enum SAMPLE_FAULT_WARN_CODE
  23. {
  24. INVALID = -1,
  25. MIN = 0,
  26. SEM_DATA_ERROR = 0,
  27. AREA_OUTSIDE_HOLE = 1,
  28. RESOLUTION_LOW = 2,
  29. FINISHED = 3,
  30. NO_ERROR_WARNING = 4,
  31. FILE_NOT_SAVED = 5,
  32. MAX = 5
  33. };
  34. enum SAMPLE_CHECK_RESULT_TYPE
  35. {
  36. INVALID = -1,
  37. MIN = 0,
  38. SWITCH_ON = 0,
  39. FINISHED = 1,
  40. SETTING_ERROR = 2,
  41. SETTING_WARNING = 3,
  42. MEASURABLE = 4,
  43. NO_ERROR_WARNING = 5,
  44. MAX = 5
  45. };
  46. public class COTSMeasureParam
  47. {
  48. OTSIncAMeasureAppForm m_MeasureAppFrom = null;
  49. /// <summary></summary>
  50. /// <remarks>创建</remarks>
  51. private COTSMsrPrjResultData resultData;
  52. //参数文件
  53. private COTSDefaultParam defaultParam = null;
  54. //样品台文件(读取样品台数据等)
  55. private CStageParam stageParam = null;
  56. private CSpecialGrayRangeParam specialRanges = null;
  57. //测量样品链表
  58. List<COTSSample> m_MeasureSampleList = new List<COTSSample>();
  59. NLog.Logger log ;
  60. public CSpecialGrayRangeParam SpecialRanges { get => specialRanges; set => specialRanges = value; }
  61. public List<COTSSample> MeasureSampleList { get => m_MeasureSampleList; set => m_MeasureSampleList = value; }
  62. public CStageParam GetStageParam()
  63. {
  64. return stageParam;
  65. }
  66. public void SetStageParam(CStageParam value)
  67. {
  68. stageParam = value;
  69. }
  70. public COTSDefaultParam GetDefaultParam()
  71. {
  72. return defaultParam;
  73. }
  74. public void SetDefaultParam(COTSDefaultParam value)
  75. {
  76. defaultParam = value;
  77. }
  78. public COTSMsrPrjResultData GetResultData()
  79. {
  80. return resultData;
  81. }
  82. public void SetResultData(COTSMsrPrjResultData value)
  83. {
  84. resultData = value;
  85. }
  86. public COTSMeasureParam(OTSIncAMeasureAppForm MeasureApp)
  87. {
  88. log = NLog.LogManager.GetCurrentClassLogger();
  89. m_MeasureAppFrom = MeasureApp;
  90. SetResultData(new COTSMsrPrjResultData());
  91. }
  92. //检查参数文件是否存在
  93. public bool LoadParamFile()
  94. {
  95. //加载样品参数文件: \Config\SysData\OTSProgMgrParam.pmf
  96. SetDefaultParam(new COTSDefaultParam());
  97. return GetDefaultParam().LoadInfoFromProgMgrFile();
  98. }
  99. //检查参数样品台文件是否存在
  100. public bool LoadStageParamFile()
  101. {
  102. SetStageParam(new CStageParam());
  103. // 加载样品台文件; \Config\SysData\OTSStage.stg
  104. if (!GetStageParam().Load(true, false))
  105. {
  106. return false;
  107. }
  108. return true;
  109. }
  110. public bool LoadSpecialGrayRangeParamFile()
  111. {
  112. SpecialRanges = new CSpecialGrayRangeParam();
  113. if (!SpecialRanges.LoadParam())
  114. {
  115. return false;
  116. }
  117. return true;
  118. }
  119. //获取系统文件是否存在和有效
  120. public bool InitResultData(bool bNewFileFlag = true)
  121. {
  122. //打开文件,则文件中保存有样品台信息,不需要使用系统样品名信息
  123. if (bNewFileFlag)
  124. {
  125. //设置样品台参数
  126. CStage Stage = GetStageParam().GetWorkingStage();
  127. if (null == Stage)
  128. {
  129. return false;
  130. }
  131. GetResultData().SetStage(Stage);
  132. // 设置 SEM stage data
  133. CSEMStageData SEMData = GetDefaultParam().GetStageDataParam();
  134. if (null == SEMData)
  135. {
  136. return false;
  137. }
  138. GetResultData().SetSEMStageData(SEMData);
  139. }
  140. //设置 general parameter
  141. COTSGeneralParam GenParam = GetDefaultParam().GetGenParam();
  142. if (null == GenParam)
  143. {
  144. return false;
  145. }
  146. GetResultData().SetGenParam(GenParam);
  147. if (GetResultData().GetPathName()=="")
  148. {
  149. GetResultData().SetPathName("Untitled");
  150. }
  151. GetResultData().SystemTypeId = GetDefaultParam().SystemTypeId;
  152. return true;
  153. }
  154. //新建样品工作文件 0:报错 1:正常 2:取消
  155. public int CreateNewFile()
  156. {
  157. if (GetResultData().IsModified()) // 文件被修改
  158. {
  159. int iRev = m_MeasureAppFrom.ShowSaveInfoMsgBox();
  160. if ((int)MessageBoxRev.DIALOG_YES == iRev)
  161. {
  162. if (!GetResultData().Save())
  163. {
  164. return 0;
  165. }
  166. }
  167. else if((int)MessageBoxRev.DIALOG_CANCEL == iRev)
  168. {
  169. return 2;
  170. }
  171. }
  172. //新建新的工作文件
  173. //重新生成一个工作文件对象
  174. COTSMsrPrjResultData ProjDataMgr = new COTSMsrPrjResultData();
  175. GetResultData().SetPathName("Untitled");
  176. SetResultData(ProjDataMgr);
  177. this.LoadStageParamFile();
  178. if (!this.InitResultData())
  179. {
  180. return 0;
  181. }
  182. return 1;
  183. }
  184. //将样品台坐标转换为Sem 坐标
  185. public PointF ConvertOTSToSemCoord(PointF POTSCoord)
  186. {
  187. System.Drawing.PointF VSemCoord = new System.Drawing.PointF();
  188. GetDefaultParam().GetStageDataParam().ConvertOTSToSEMCoord(POTSCoord, ref VSemCoord);
  189. return VSemCoord;
  190. }
  191. //将Sem 坐标转换为样品台坐标
  192. public PointF ConverSEMToOTSCoord(PointF PSEMCoord)
  193. {
  194. System.Drawing.PointF VOTSCoord = new System.Drawing.PointF();
  195. GetDefaultParam().GetStageDataParam().ConvertSEMToOTSCoord(PSEMCoord, ref VOTSCoord);
  196. return VOTSCoord;
  197. }
  198. public OTSSampleVisualPropertyInfo AddNewSampleMeasure(string a_strHoleName = "")
  199. {
  200. COTSSample NewSample = new COTSSample();
  201. SetSampleDefaultPara(ref NewSample, a_strHoleName);
  202. //NewSample.
  203. //添加样品
  204. GetResultData().AddSample(NewSample);
  205. // 获取样品的属性值
  206. OTSSampleVisualPropertyInfo MeasureInfo = new OTSSampleVisualPropertyInfo(NewSample, defaultParam.GetSysType());
  207. return MeasureInfo;
  208. }
  209. public void InitWorkingSampleData(int startfieldNo)
  210. {
  211. COTSSample Sample = GetWorkSample();
  212. if (Sample == null) return ;
  213. var sname= Sample.GetName();
  214. var pathname = resultData.GetFolderName(resultData.GetPathName());
  215. var sampleResultFolder = pathname + "\\" + sname;
  216. if (Directory.Exists(sampleResultFolder))
  217. {
  218. resultData.DeleteWorkingSampleFieldDataByFieldNo(startfieldNo);
  219. //Directory.Delete(sampleResultFolder, true);
  220. var flds = Sample.GetFieldsData();
  221. foreach (var f in flds)
  222. {
  223. if (f.GetMeasureSequence() >= startfieldNo)
  224. {
  225. f.ClearAllMeausredData();
  226. f.SetIsMeasureComplete(false);
  227. }
  228. }
  229. }
  230. var sta = Sample.GetMsrStatus();
  231. sta.ClearCompletedFieldsInfo();
  232. sta.SetStatus(OTS_MSR_SAMPLE_STATUS.UNMEASURED);
  233. var rsts = Sample.GetMsrResults();
  234. var itms = rsts.GetResultItems();
  235. itms.Clear();
  236. rsts.SetResultItems(itms);
  237. rsts.SetMeasuredArea(0);
  238. rsts.SetRatio(0);
  239. }
  240. public OTSSampleVisualPropertyInfo GetWorkingSampleVisualPropertyInfo()
  241. {
  242. COTSSample Sample = GetWorkSample();
  243. if (Sample == null) return null;
  244. OTSSampleVisualPropertyInfo MeasureInfo = new OTSSampleVisualPropertyInfo(Sample, defaultParam.GetSysType());
  245. return MeasureInfo;
  246. }
  247. protected COTSSample SetSampleDefaultPara(ref COTSSample pSample, String a_strHoleName)
  248. {
  249. // get new sample name
  250. String strNewSampleName = GetNewSampleName();
  251. // make sure the new sample name is not an empty string
  252. strNewSampleName.Trim();
  253. // get a suitable sample hole for the new sample
  254. CHole pHole = SelectASmpleHole(a_strHoleName);
  255. // check the sample hole
  256. if (pHole == null)
  257. {
  258. // failed to get sample hole for the new sample
  259. return null;
  260. }
  261. // measurement area
  262. CDomain pMsrArea = CalculateDefaultArea(pHole);
  263. // measure data parameters containing particle analysis std, image scan parameter, image process parameter and x-ray parameter
  264. CSampleParam poMsrParams = new CSampleParam();
  265. poMsrParams.m_nPackId = GetDefaultParam().SystemTypeId;
  266. poMsrParams.m_runmode = GetDefaultParam().m_runmode;
  267. var m_pParam = GetDefaultParam().GetGenParam();
  268. MEMBRANE_TYPE a_nVal = (MEMBRANE_TYPE)m_pParam.GetMembraneType();
  269. poMsrParams.SetImageScanParam(GetDefaultParam().GetImageScanParam ());
  270. poMsrParams.SetImageProcessParam(GetDefaultParam().GetImageProcParam());
  271. poMsrParams.SetXRayParam(GetDefaultParam().GetXRayParam());
  272. String sSTDName = m_pParam.GetSTDSelect();
  273. poMsrParams.SetSTDName(sSTDName);
  274. poMsrParams.SetSteelTechnology((STEEL_TECHNOLOGY)m_pParam.GetSteelTechnology());
  275. poMsrParams.SetSpecialGrayRangeParam(SpecialRanges);
  276. // set sample parameters
  277. pSample.SetName(strNewSampleName);
  278. pSample.SetSampleHoleName(pHole.GetName());
  279. pSample.SetSwitch(m_pParam.GetMeasurementSwitch());
  280. poMsrParams.SetSysSTDSwitch(m_pParam.GetSysSTD());
  281. pSample.SetMsrDomain(pMsrArea);
  282. //pSample.SetMembraneType(a_nVal);
  283. pSample.SetMsrParams(poMsrParams);
  284. CSEMDataMsr semData = new CSEMDataMsr();
  285. var m_pSEMStageData = GetDefaultParam().GetStageDataParam();
  286. var imageScanParam = GetDefaultParam().GetImageScanParam();
  287. string resol = imageScanParam.GetImageResulotion().ToString();
  288. double resWidth = Convert.ToDouble(resol.Split('_')[1]);
  289. double resHeight = Convert.ToDouble(resol.Split('_')[2]);
  290. double heightWidthRatio = resHeight / resWidth;
  291. semData.SetScanFieldSize100(m_pSEMStageData.GetScanFieldSize100());
  292. double fieldHeight = m_pSEMStageData.GetScanFieldSize100() * heightWidthRatio;
  293. semData.SetScanFieldHeight100((int)fieldHeight);
  294. pSample.SetSEMDataMsr(semData);
  295. return pSample;
  296. }
  297. public String GetNewSampleName()
  298. {
  299. // new sample name
  300. String strNewSmplName = "";
  301. // safety check
  302. var m_pParam = GetDefaultParam().GetGenParam();
  303. if (m_pParam == null)
  304. {
  305. // shouldn't happen, invalid general parameter pointer.
  306. return strNewSmplName;
  307. }
  308. // new sample name base
  309. String strNewSmplNameBase = m_pParam.GetSampleName() + @"{0}";
  310. int nIndex = 1;
  311. do
  312. {
  313. // new sample name is new sample name base + number string
  314. strNewSmplName = string.Format(strNewSmplNameBase, nIndex);
  315. ++nIndex;
  316. }
  317. // make sure that the new sample name is not same with any sample in the samples list
  318. while (SameNameInList(strNewSmplName));
  319. // new sample name
  320. return strNewSmplName;
  321. }
  322. public bool SameNameInList(String a_strSampleName, int a_nExclude = -1)
  323. {
  324. // make sure the input sample name is not empty
  325. a_strSampleName.Trim();
  326. if (a_strSampleName == "")
  327. {
  328. // shouldn't happen, input name is an empty string
  329. return false;
  330. }
  331. // go through sample list
  332. int nIndex = 0;
  333. var m_listSamples = GetResultData().GetSampleList();
  334. foreach (var pSample in m_listSamples)
  335. {
  336. // return TRUE if this is not an exclude sample and its name is same with input
  337. String strSampleName = pSample.GetName();
  338. if (nIndex != a_nExclude && strSampleName.CompareTo(a_strSampleName) == 0)
  339. {
  340. // find a same name sample
  341. return true;
  342. }
  343. ++nIndex;
  344. }
  345. // no, same name sample in the same list, return FALSE
  346. return false;
  347. }
  348. // select a suitable sample hole for a new sample
  349. public CHole SelectASmpleHole(String a_strHoleName /*= _T("")*/)
  350. {
  351. // get holes list of the stage
  352. var m_pStage = GetStageParam().GetWorkingStage();
  353. List<CHole> listHoles = m_pStage.GetHoleList();
  354. //返回样品孔对象
  355. CHole cReHole ;
  356. // make sure the holes list is not empty
  357. if (listHoles.Count == 0)
  358. {
  359. // shouldn't happen, stage have no hole.
  360. return null;
  361. }
  362. // check the input hole name
  363. a_strHoleName.Trim();
  364. if (a_strHoleName != "")
  365. {
  366. // try to find matched hole
  367. for (int i = 0; i < listHoles.Count; i++)
  368. {
  369. if (listHoles[i].GetName() == a_strHoleName)
  370. {
  371. cReHole = listHoles[i];
  372. return cReHole;
  373. }
  374. }
  375. }
  376. // can't find a matched hole, then pick the first empty hole
  377. // go through the holes list
  378. foreach (var pHole in listHoles)
  379. {
  380. // has this hole any sample in it?
  381. String strHoleName = pHole.GetName();
  382. bool IsChanged = false;
  383. var m_listSamples = GetResultData().GetSampleList();
  384. foreach (COTSSample sampleItem in m_listSamples)
  385. {
  386. if (strHoleName == sampleItem.GetSampleHoleName())
  387. {
  388. IsChanged = true;
  389. }
  390. }
  391. if (!IsChanged)
  392. {
  393. return pHole;
  394. }
  395. }
  396. // no empty hole, then the first hole will be the one
  397. return listHoles[0];
  398. }
  399. public CDomain CalculateDefaultArea(CHole a_pHole)
  400. {
  401. RectangleF rectHole = a_pHole.GetDomainRect();
  402. System.Drawing.PointF ptCenter = new System.Drawing.PointF((rectHole.Left + rectHole.Right) / 2, (rectHole.Top + rectHole.Bottom) / 2);
  403. var m_pParam = GetDefaultParam().GetGenParam();
  404. DOMAIN_SHAPE nShape = m_pParam.GetShape();
  405. double dArea = m_pParam.GetArea() * 1000000;
  406. System.Drawing.PointF ptLeftTop = new System.Drawing.Point();
  407. System.Drawing.SizeF ptSize = new System.Drawing.Size();
  408. int nEdge = 0;
  409. int nRadius = 0;
  410. switch ((int)nShape)
  411. {
  412. case (int)DOMAIN_SHAPE.RECTANGLE:
  413. nEdge = (int)Math.Sqrt(dArea) / 2;
  414. ptLeftTop.X = ptCenter.X - nEdge;
  415. ptLeftTop.Y = ptCenter.Y - nEdge;
  416. ptSize.Width = ptCenter.X + nEdge - ptLeftTop.X;
  417. ptSize.Height = ptCenter.Y + nEdge - ptLeftTop.Y;
  418. break;
  419. case (int)DOMAIN_SHAPE.ROUND:
  420. nRadius = (int)Math.Sqrt(dArea / 3.1415926);
  421. ptLeftTop.X = ptCenter.X - nRadius;
  422. ptLeftTop.Y = ptCenter.Y - nRadius;
  423. ptSize.Width = ptCenter.X + nRadius - ptLeftTop.X;
  424. ptSize.Height = ptCenter.Y + nRadius - ptLeftTop.Y;
  425. break;
  426. }
  427. RectangleF MsrRect = new RectangleF(ptLeftTop, ptSize);
  428. CDomain pMsrArea = new CDomain(nShape, MsrRect);
  429. return pMsrArea;
  430. }
  431. //设置工作样品的属性值
  432. public bool SetSampleParamVal(OTS_SAMPLE_PROP_GRID_ITEMS ItemId, OTS_ITEM_TYPES ValType, object objVal)
  433. {
  434. COTSSample WSample = GetResultData().GetWorkingSample();
  435. OTSSampleVisualPropertyInfo MeasureInfo = new OTSSampleVisualPropertyInfo(WSample, defaultParam.GetSysType());
  436. bool bSetFalg = false;
  437. bSetFalg = MeasureInfo.SetParamVal(ItemId, ValType, objVal);
  438. if (bSetFalg)
  439. {
  440. GetResultData().SetModify(true);
  441. }
  442. return bSetFalg;
  443. }
  444. //获取工作样品名称
  445. public string GetWorkSampleName()
  446. {
  447. COTSSample WSample = GetResultData().GetWorkingSample();
  448. if (null == WSample)
  449. {
  450. return "";
  451. }
  452. string sWorkSampleName = WSample.GetName();
  453. if ("" == sWorkSampleName)
  454. {
  455. return "";
  456. }
  457. return sWorkSampleName;
  458. }
  459. //设置工作样品
  460. //string sNewWorkSampleName: 新工作样品
  461. public bool SetWorkSample(string sNewWorkSampleName)
  462. {
  463. if ("" == sNewWorkSampleName)
  464. {
  465. return false;
  466. }
  467. if (!GetResultData().SetWorkingSampleByName(sNewWorkSampleName))
  468. {
  469. return false;
  470. }
  471. return true;
  472. }
  473. //获取工作样品
  474. // 返回工作样品对象
  475. public COTSSample GetWorkSample()
  476. {
  477. COTSSample WSample = GetResultData().GetWorkingSample();
  478. return WSample;
  479. }
  480. //删除工作样品
  481. //string sWorkSampleName : 删除工作样品名称
  482. public bool DeleteWorkSample(string sWorkSampleName)
  483. {
  484. return GetResultData().DeleteSampleByName(sWorkSampleName);
  485. }
  486. // 获取样品总数
  487. //返回样品总数
  488. public int GetSampleCount()
  489. {
  490. return GetResultData().GetSampleList().Count();
  491. }
  492. //改变工作样品名称
  493. //String sWSampleNewName
  494. public bool ChangeWorkSampleName(String sWSampleNewName)
  495. {
  496. if (!GetResultData().IsValidSampleName(sWSampleNewName))
  497. {
  498. return false;
  499. }
  500. COTSSample WorkSample = GetResultData().GetWorkingSample();
  501. if (null == WorkSample)
  502. {
  503. return false;
  504. }
  505. WorkSample.SetName(sWSampleNewName);
  506. GetResultData().SetModify(true);
  507. return true;
  508. }
  509. //移动工作样品到其他样品孔,样品孔名称和测量区域都要改变,重新设置工作样品参数
  510. public void SetWorkSampleHoleAndMeasureArea(SampleMeasurePara SMeasurePara)
  511. {
  512. COTSSample WSample = GetResultData().GetWorkingSample();
  513. if (null == WSample)
  514. {
  515. return ;
  516. }
  517. CDomain Domain = new CDomain();
  518. Domain.SetShape((otsdataconst.DOMAIN_SHAPE)SMeasurePara.iShape);
  519. Domain.SetRectDomain(SMeasurePara.MeasureRect);
  520. if (SMeasurePara.DrawPolygonPointList != null)
  521. {
  522. List<Point> PolygonPoint = new List<Point>();
  523. foreach (var item in SMeasurePara.DrawPolygonPointList)
  524. {
  525. PolygonPoint.Add(new Point((int)item.X, (int)item.Y));
  526. }
  527. Domain.SetPolygonPoint(PolygonPoint);
  528. }
  529. WSample.SetSampleHoleName(SMeasurePara.sampleHoleName);
  530. WSample.SetMsrDomain(Domain);
  531. return ;
  532. }
  533. //设置测量区域的形状 (通过RIBBON 上的画圆,画矩形 设置)
  534. //int iShape: 测量区域形状 0: 圆形; 1 :矩形
  535. public void SetMeasureAreaShape(ShapeType iShape)
  536. {
  537. COTSSample WSample = GetResultData().GetWorkingSample();
  538. if (null == WSample)
  539. {
  540. return;
  541. }
  542. CDomain Domain = new CDomain();
  543. Domain.SetShape((otsdataconst.DOMAIN_SHAPE)iShape);
  544. }
  545. //public bool SetWorkSampleParamLock(bool ParaLockFlag)
  546. //{
  547. // COTSSample WSample = GetResultData().GetWorkingSample();
  548. // if (null == WSample)
  549. // {
  550. // return false;
  551. // }
  552. // WSample.SetParamLock(ParaLockFlag);
  553. // GetResultData().SetModify(true);
  554. // return true;
  555. //}
  556. public bool CheckSampleParam(bool bCheckFlag)
  557. {
  558. m_MeasureSampleList.Clear();
  559. List<COTSSample> MSampleList = new List<COTSSample>();
  560. if (!CheckMeasureParam(GetResultData(), ref MSampleList, bCheckFlag))
  561. {
  562. return false;
  563. }
  564. if (MSampleList.Count > 0)
  565. {
  566. m_MeasureSampleList = MSampleList;
  567. return true;
  568. }
  569. return false;
  570. }
  571. public bool CheckMeasureParam(COTSMsrPrjResultData a_pProjMgrFile, ref List<COTSSample> a_listMeasuableSamples, bool a_bCheckSetting)
  572. {
  573. // go through the sample list to check setting parameters
  574. int nSwitchSmplNo = 0;
  575. int nCompletedSmplNo = 0;
  576. int nErrorSmplNo = 0;
  577. int nWarningSmplNo = 0;
  578. List<String> listSamplMessages = new List<string>();
  579. List<COTSSample> listSamples = a_pProjMgrFile.GetSampleList();
  580. List<COTSSample> listMeasurableSamples = new List<COTSSample>();
  581. List<COTSSample> listWithWarningMeasurableSamples = new List<COTSSample>();
  582. foreach (var pSample in listSamples)
  583. {
  584. // is the sample switch on
  585. if (pSample.GetSwitch())
  586. {
  587. ++nSwitchSmplNo;
  588. String strSmplMessage;
  589. strSmplMessage = pSample.GetName() + ":" + "\r\n";
  590. // is this a measurement completed sample
  591. if (IsMeasureCompletedSmpl(pSample))
  592. { // measurement completed sample
  593. ++nCompletedSmplNo;
  594. string str2 = GetSampleErrorWarnString(SAMPLE_FAULT_WARN_CODE.FINISHED);
  595. strSmplMessage += str2;
  596. strSmplMessage += "\r\n";
  597. }
  598. else
  599. {
  600. // errors
  601. List<SAMPLE_FAULT_WARN_CODE> a_listErrorCodes = new List<SAMPLE_FAULT_WARN_CODE>();
  602. GetSampleErrorCodes(a_pProjMgrFile, pSample, ref a_listErrorCodes);
  603. if (a_listErrorCodes.Count != 0)
  604. {
  605. // has error, this is not a measurable sample
  606. ++nErrorSmplNo;
  607. foreach (var nErrorCode in a_listErrorCodes)
  608. {
  609. String str3 = GetSampleErrorWarnString(nErrorCode);
  610. strSmplMessage += str3;
  611. strSmplMessage += "\r\n";
  612. }
  613. }
  614. else
  615. {
  616. // no error, this is a measurable sample
  617. listMeasurableSamples.Add(pSample);
  618. }
  619. // warnings
  620. List<SAMPLE_FAULT_WARN_CODE> a_listWarningCodes = new List<SAMPLE_FAULT_WARN_CODE>();
  621. GetSampleWarningCodes(a_pProjMgrFile, pSample, ref a_listWarningCodes);
  622. if (a_listWarningCodes.Count != 0)
  623. {
  624. ++nWarningSmplNo;
  625. foreach (var nWarningCode in a_listWarningCodes)
  626. {
  627. String str3 = GetSampleErrorWarnString(nWarningCode);
  628. strSmplMessage += str3;
  629. strSmplMessage += "\r\n";
  630. }
  631. // has no error?
  632. if (a_listErrorCodes.Count == 0)
  633. {
  634. // this is a measurable sample but with setting warnings
  635. listWithWarningMeasurableSamples.Add(pSample);
  636. }
  637. }
  638. // no error and warning
  639. if (a_listErrorCodes.Count == 0 && a_listWarningCodes.Count == 0)
  640. {
  641. String str3 = GetSampleErrorWarnString(SAMPLE_FAULT_WARN_CODE.NO_ERROR_WARNING);
  642. strSmplMessage += str3;
  643. strSmplMessage += "\r\n";
  644. }
  645. }
  646. // add
  647. listSamplMessages.Add(strSmplMessage);
  648. }
  649. }
  650. // dlg message string
  651. String strDlgMessage = "";
  652. String str;
  653. String str1;
  654. str1 = GetResourceByKey(GrpOtherParam, IDS_SAMPLE_CHECK_RESULT + (int)SAMPLE_CHECK_RESULT_TYPE.SWITCH_ON);
  655. str1 = str1.Replace("%d", "{0}");
  656. str = string.Format(str1, nSwitchSmplNo);
  657. strDlgMessage += str;
  658. strDlgMessage += "\r\n";
  659. // add more string if there switch on sample
  660. if (nSwitchSmplNo > 0)
  661. {
  662. // completed sample number (optional)
  663. if (nCompletedSmplNo > 0)
  664. {
  665. str1 = GetResourceByKey(GrpOtherParam, IDS_SAMPLE_CHECK_RESULT + (int)SAMPLE_CHECK_RESULT_TYPE.FINISHED);
  666. str1 = str1.Replace("%d", "{0}");
  667. str = string.Format(str1, nCompletedSmplNo);
  668. strDlgMessage += str;
  669. strDlgMessage += "\r\n";
  670. }
  671. // any unmeasured switch on samples?
  672. if (nSwitchSmplNo > nCompletedSmplNo)
  673. {
  674. // with setting error sample number
  675. str1 = GetResourceByKey(GrpOtherParam, IDS_SAMPLE_CHECK_RESULT + (int)SAMPLE_CHECK_RESULT_TYPE.SETTING_ERROR);
  676. str1 = str1.Replace("%d", "{0}");
  677. str = string.Format(str1, nErrorSmplNo);
  678. strDlgMessage += str;
  679. strDlgMessage += "\r\n";
  680. // with setting warning sample number
  681. str1 = GetResourceByKey(GrpOtherParam, IDS_SAMPLE_CHECK_RESULT + (int)SAMPLE_CHECK_RESULT_TYPE.SETTING_WARNING);
  682. str1 = str1.Replace("%d", "{0}");
  683. str = string.Format(str1, nWarningSmplNo);
  684. strDlgMessage += str;
  685. strDlgMessage += "\r\n";
  686. }
  687. }
  688. // add an empty line strDlgMessage
  689. strDlgMessage += "\r\n";
  690. // add sample messages
  691. foreach (var strSmplMessage in listSamplMessages)
  692. {
  693. strDlgMessage += strSmplMessage;
  694. strDlgMessage += "\r\n";
  695. }
  696. // do we need to show dialog box?
  697. if (nSwitchSmplNo == 0)
  698. {
  699. return false;
  700. }
  701. // measure button clicked?
  702. if (a_bCheckSetting)
  703. {
  704. // there are measurable samples but no setting warnings samples
  705. if (listMeasurableSamples.Count > 0 && listWithWarningMeasurableSamples.Count == 0)
  706. {
  707. // set output measurable samples list
  708. foreach (var pSample in listMeasurableSamples)
  709. {
  710. a_listMeasuableSamples.Add(pSample);
  711. }
  712. return true;
  713. }
  714. }
  715. //when there is sample setting error, and setting with no error and no warning samples, the dlg will not be show.??
  716. //show the result dlg
  717. DIALOG_CHECK_PARAM_RESULT dlg = new DIALOG_CHECK_PARAM_RESULT();
  718. int nTatolMeasuableSmplNo = listMeasurableSamples.Count;
  719. int nWithWarningMeasuableSmplNo = listWithWarningMeasurableSamples.Count;
  720. // set the dlg parameters
  721. dlg.SetCheckOnlyFlag(a_bCheckSetting);
  722. dlg.SetMessageBase(strDlgMessage);
  723. dlg.SetTatolMeasuableSmplNo(nTatolMeasuableSmplNo);
  724. dlg.SetWithWarningMeasuableSmplNo(nWithWarningMeasuableSmplNo);
  725. //no error not show dlg
  726. if (nTatolMeasuableSmplNo == nSwitchSmplNo - nCompletedSmplNo && listMeasurableSamples.Count != 0)
  727. {
  728. foreach (var pSample in listMeasurableSamples)
  729. {
  730. var itr = listWithWarningMeasurableSamples.Find(s => { return s.GetName() == pSample.GetName(); });
  731. if (itr == null)
  732. {
  733. a_listMeasuableSamples.Add(pSample);
  734. }
  735. }
  736. if (a_listMeasuableSamples.Count == listMeasurableSamples.Count)
  737. {
  738. return true;
  739. }
  740. }
  741. //show dlg
  742. DialogResult dResult = dlg.ShowDialog();
  743. if (!(dResult == System.Windows.Forms.DialogResult.OK))
  744. {
  745. // do something here
  746. return false;
  747. }
  748. else
  749. {
  750. //if warnDo, back the listMeasuableSample
  751. if (dlg.GetWarnDo())
  752. {
  753. foreach (var pSample in listMeasurableSamples)
  754. {
  755. a_listMeasuableSamples.Add(pSample);
  756. }
  757. }
  758. else // back with no warn sample
  759. {
  760. foreach (var pSample in listMeasurableSamples)
  761. {
  762. var itr = listWithWarningMeasurableSamples.Find(e => { return e.GetName() == pSample.GetName(); });
  763. if (itr == null)
  764. {
  765. a_listMeasuableSamples.Add(pSample);
  766. }
  767. }
  768. }
  769. }
  770. return true;
  771. }
  772. bool IsMeasureCompletedSmpl(COTSSample a_pSample)
  773. {
  774. // safety check
  775. if (a_pSample.GetMsrStatus().GetStatus() != OTSDataType.OTS_MSR_SAMPLE_STATUS.SUCCESSED)
  776. {
  777. return false;
  778. }
  779. return true;
  780. }
  781. string GetSampleErrorWarnString(SAMPLE_FAULT_WARN_CODE a_nSampleFaultWarn)
  782. {
  783. // check input
  784. if (a_nSampleFaultWarn < SAMPLE_FAULT_WARN_CODE.MIN && a_nSampleFaultWarn > SAMPLE_FAULT_WARN_CODE.MAX)
  785. {
  786. return "";
  787. }
  788. // error/waring string
  789. string strErrorWarn;
  790. strErrorWarn = GetResourceByKey(GrpOtherParam, IDS_ERROR_WARNING + (int)a_nSampleFaultWarn);
  791. return strErrorWarn;
  792. }
  793. // get error codes list of a sample
  794. void GetSampleErrorCodes(COTSMsrPrjResultData a_pProjMgrFile, COTSSample a_pSample, ref List<SAMPLE_FAULT_WARN_CODE> a_listErrorCodes)
  795. {
  796. const string UNTITLED_FILE_NAME = "Untitled";
  797. // file has not been saved
  798. String strPathName = a_pProjMgrFile.GetPathName();
  799. // is this a file no saved?
  800. strPathName.Trim();
  801. if (strPathName == UNTITLED_FILE_NAME || strPathName == "")
  802. {
  803. a_listErrorCodes.Add(SAMPLE_FAULT_WARN_CODE.FILE_NOT_SAVED);
  804. }
  805. }
  806. // get warning codes list of a sample
  807. void GetSampleWarningCodes(COTSMsrPrjResultData a_pProjMgrFile, COTSSample a_pSample, ref List<SAMPLE_FAULT_WARN_CODE> a_listWarningCodes)
  808. {
  809. // get the work stage
  810. CStage pStage = a_pProjMgrFile.GetStage();
  811. //get hole
  812. String sHoleName = a_pSample.GetSampleHoleName();
  813. //look for the hole Domain
  814. CHole pSampleHole = pStage.GetHoleByName(sHoleName);
  815. if (pSampleHole == null)
  816. {
  817. return;
  818. }
  819. if (a_pSample.GetSEMDataMsr() != null)
  820. {
  821. // compute pixel size
  822. double dPixleSize = a_pSample.CalculatePixelSize();
  823. // get min size
  824. COTSImageProcParam pImageProcParam = a_pSample.GetMsrParams().GetImageProcessParam();
  825. double dMinSize = pImageProcParam.GetIncAreaRange().GetStart();
  826. // if pixel size is bigger than 1/2 of the min size,than can't see the object clearly on current magnification
  827. if (dPixleSize >= dMinSize * 0.5)
  828. {
  829. // resolution low
  830. a_listWarningCodes.Add(SAMPLE_FAULT_WARN_CODE.RESOLUTION_LOW);
  831. }
  832. }
  833. if(a_pSample.GetSEMDataMsr().GetTotalFields()==0
  834. && a_pSample.GetSEMDataMsr().GetScanFieldSize() == 0
  835. && a_pSample.GetSEMDataMsr().GetWorkingDistance() == 0)
  836. {
  837. // SEM_DATA_ERROR
  838. a_listWarningCodes.Add(SAMPLE_FAULT_WARN_CODE.SEM_DATA_ERROR);
  839. }
  840. }
  841. //public bool SaveWorkMeasureFile()
  842. //{
  843. // CSampleParamMgr SMeasureParamData = new CSampleParamMgr();
  844. // COTSSample WSample = GetResultData().GetWorkingSample();
  845. // if (null == WSample)
  846. // {
  847. // return false;
  848. // }
  849. // if (!SMeasureParamData.SetMsrParamFile(WSample.GetMsrParams()))
  850. // {
  851. // return false;
  852. // }
  853. // // file open dialog
  854. // CSampleParamMgr cSampleParamMgr = new CSampleParamMgr();
  855. // SaveFileDialog saveFileDialog = new SaveFileDialog();
  856. // saveFileDialog.FileName = WSample.GetName() +"_Config"+ cSampleParamMgr.MESUREMENT_PARAM_FILE_EXT;
  857. // saveFileDialog.Filter = cSampleParamMgr.MESUREMENT_PARAM_FILE_FILTER;
  858. // if (saveFileDialog.ShowDialog() != DialogResult.OK)
  859. // {
  860. // return false;
  861. // }
  862. // // get file pathname
  863. // string strPathName = saveFileDialog.FileName;
  864. // SMeasureParamData.Save(strPathName);
  865. // return true;
  866. //}
  867. //打开工作样品的测量参数文件
  868. public bool LoadWorkMeasureFile()
  869. {
  870. CSampleParamMgr SMeasureParamData = new CSampleParamMgr();
  871. OpenFileDialog openFileDialog = new OpenFileDialog();
  872. openFileDialog.Filter = SMeasureParamData.MESUREMENT_PARAM_FILE_FILTER;
  873. if (openFileDialog.ShowDialog() != DialogResult.OK)
  874. {
  875. return false;
  876. }
  877. // get file pathname
  878. string strPathName = openFileDialog.FileName;
  879. if (!SMeasureParamData.Load(strPathName, true))
  880. {
  881. return false;
  882. }
  883. COTSSample WSample = GetResultData().GetWorkingSample();
  884. if (null == WSample)
  885. {
  886. return false;
  887. }
  888. WSample.SetMsrParams(SMeasureParamData.GetMsrParams());
  889. //更新样品GRID值测量文件名
  890. OTSSampleVisualPropertyInfo SMInfo = new OTSSampleVisualPropertyInfo(WSample,defaultParam.GetSysType());
  891. m_MeasureAppFrom.m_SPropertyWindows.DisplaySampleMeasureInfo(SMInfo);
  892. return true;
  893. }
  894. //判断是否允许修改样品名
  895. public bool CheckSampleNameIsValid(string sNewName)
  896. {
  897. return GetResultData().IsValidSampleName(sNewName);
  898. }
  899. //设置电镜参数
  900. //int iScanFieldSize: Field扫描参数
  901. //int iWDistance: 电镜工作距离
  902. //double dMagni: 放大倍数
  903. public void SetWorkingSampleSEMData(double iWDistance, double dMagni,double bri,double contra,double kv)
  904. {
  905. var semdata = GetResultData().GetWorkingSample().GetSEMDataMsr();
  906. semdata.SetWorkingDistance(iWDistance);
  907. semdata.SetMagnification(dMagni);
  908. semdata.Brightness = bri;
  909. semdata.Contrast = contra;
  910. semdata.KV = kv;
  911. }
  912. public bool GetWorkingSampleSEMData(ref double iWDistance, ref double dMagni, ref double bri, ref double contra, ref double kv)
  913. {
  914. COTSSample WSample = GetResultData().GetWorkingSample();
  915. if (null == WSample)
  916. {
  917. return false;
  918. }
  919. var semdata = GetResultData().GetWorkingSample().GetSEMDataMsr();
  920. iWDistance = semdata.GetWorkingDistance();
  921. dMagni = semdata.GetMagnification();
  922. bri = semdata.Brightness;
  923. contra = semdata.Contrast;
  924. kv = semdata.KV;
  925. return true;
  926. }
  927. //检查Samplelist中的sample的checkbox状态
  928. //当Samplelist中的链表有sample 的checkbox状态是选中状态,则返回TRUE. 说明可以测量
  929. public bool GetSampleCheckBoxStatus()
  930. {
  931. COTSSample WSample = GetResultData().GetWorkingSample();
  932. if (null == WSample)
  933. {
  934. return false;
  935. }
  936. List<COTSSample> SampleList = new List<COTSSample>();
  937. SampleList = GetResultData().GetSampleList();
  938. int iCount = SampleList.Count();
  939. if (0 == iCount)
  940. {
  941. return false;
  942. }
  943. for (int i = 0; i < iCount; i++)
  944. {
  945. if (SampleList[i].GetSwitch())
  946. {
  947. return true;
  948. }
  949. }
  950. return false;
  951. }
  952. //获取BSE图像数据
  953. public bool GetBSEImageSize(ref int iHeight, ref int iWidth)
  954. {
  955. COTSSample WSample = GetResultData().GetWorkingSample();
  956. if (null == WSample)
  957. {
  958. return false;
  959. }
  960. if (!WSample.GetBSESize(out iHeight, out iWidth))
  961. {
  962. return false;
  963. }
  964. return true;
  965. }
  966. //获取图像尺寸
  967. public string GetBSEImageResolutionStr()
  968. {
  969. try
  970. {
  971. COTSSample WSample = GetResultData().GetWorkingSample();
  972. var res= WSample.GetMsrParams().GetImageScanParam().GetImageResolutionSize();
  973. return res.cx+"X"+res.cy;
  974. }
  975. catch (Exception)
  976. {
  977. return "";
  978. }
  979. }
  980. //获取放大倍数和工作距离
  981. //public bool GetMagAndDistance(ref double SemMag, ref double dDistance)
  982. //{
  983. // COTSSample WSample = GetResultData().GetWorkingSample();
  984. // if (null == WSample)
  985. // {
  986. // return false;
  987. // }
  988. // GetWorkingSampleSEMData(ref dDistance, ref SemMag);
  989. // return true;
  990. //}
  991. //获取测量Sample的开始时间
  992. public bool GetMsrSampleStartTime(ref DateTime MsrFieldStartTime)
  993. {
  994. COTSSample WSample = GetResultData().GetWorkingSample();
  995. if (null == WSample)
  996. {
  997. return false;
  998. }
  999. MsrFieldStartTime = (DateTime)WSample.GetMsrStatus().GetStartTime();
  1000. return true;
  1001. }
  1002. //获取测量已用时间
  1003. public bool GetMsrSampleUsedTime(ref TimeSpan TUsedTime)
  1004. {
  1005. COTSSample WSample = GetResultData().GetWorkingSample();
  1006. if (null == WSample)
  1007. {
  1008. return false;
  1009. }
  1010. TUsedTime = (TimeSpan)WSample.GetMsrStatus().GetUsedTime();
  1011. return true;
  1012. }
  1013. // 获取测量样品中之前已经测量完成Field帧图,(上一次未测量完成继续测试)
  1014. public bool GetBeforeCompleteField(ref string MsrSampleName, ref List<PointF> FieldList)
  1015. {
  1016. COTSSample WSample = GetResultData().GetWorkingSample();
  1017. if (null == WSample)
  1018. {
  1019. return false;
  1020. }
  1021. MsrSampleName = WSample.GetName();
  1022. FieldList = WSample.GetMsrStatus().GetCompletedFieldsCenter();
  1023. return true;
  1024. }
  1025. /// <summary>
  1026. /// 通过样品孔信息 返回默认测量区域大小
  1027. /// </summary>
  1028. /// <param name="cHoleClr"></param>
  1029. /// <returns></returns>
  1030. public RectangleF CalculateMsrArea(string cHoleName)
  1031. {
  1032. CHole cHoleClr = null;
  1033. foreach (CHole item in GetResultData().GetStage().GetHoleList())
  1034. {
  1035. if (item.GetName() == cHoleName)
  1036. {
  1037. cHoleClr = item;
  1038. }
  1039. }
  1040. CDomain CDomain = GetResultData().CalculateMsrArea(cHoleClr);
  1041. return CDomain.GetRectDomain();
  1042. }
  1043. /// <summary>
  1044. /// 获取已完成测量的结果文件路径
  1045. /// </summary>
  1046. /// <param name="mrFilePathList">返回测量结果文件路径</param>
  1047. /// <returns></returns>
  1048. public bool GetCompletedMeasureFileName(ref List<string> mrFilePathList)
  1049. {
  1050. //测量文件路径
  1051. string proFilePath = GetResultData().GetPathName();
  1052. //样品列表
  1053. List<COTSSample> sampleList = GetResultData().GetSampleList();
  1054. //获取样品数量
  1055. int sampleCount = sampleList.Count;
  1056. string mrSuffix = ".rst";
  1057. int existsCount = 0;
  1058. //获取测量文件路径
  1059. if (proFilePath.Equals("Untitled"))
  1060. {
  1061. return false;
  1062. }
  1063. string mrFolderPath = string.Empty;
  1064. try
  1065. {
  1066. mrFolderPath = proFilePath.Substring(0, proFilePath.LastIndexOf("\\"));
  1067. }
  1068. catch (Exception)
  1069. {
  1070. mrFolderPath = string.Empty;
  1071. }
  1072. for (int sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++)
  1073. {
  1074. int CompleteFieldsCount = sampleList[sampleIndex].GetMsrStatus().GetCompletedFields();
  1075. //如果样品已测量成功后再加载至报告程序中
  1076. if (CompleteFieldsCount > 0)
  1077. {
  1078. string sampleName = sampleList[sampleIndex].GetName();
  1079. string mrFilePath = mrFolderPath + "\\" + sampleName + "\\" + sampleName + mrSuffix;
  1080. //判断文件是否存在
  1081. if (File.Exists(mrFilePath))
  1082. {
  1083. if (mrFilePathList != null)
  1084. {
  1085. mrFilePathList.Add(mrFilePath);
  1086. }
  1087. existsCount++;
  1088. }
  1089. }
  1090. }
  1091. if (existsCount > 0)
  1092. {
  1093. return true;
  1094. }
  1095. return false;
  1096. }
  1097. /// <summary>
  1098. /// 获取工作样品的测量状态
  1099. /// </summary>
  1100. /// <param name="workingSampleName"></param>
  1101. /// <returns></returns>
  1102. public bool GetWorkSampleMeasureStatus()
  1103. {
  1104. bool reuslt = false;
  1105. COTSSample COTSSample = GetResultData().GetWorkingSample();
  1106. if (COTSSample == null) return false;
  1107. int sampleStatus = COTSSample.GetMsrStatus().GetCompletedFields();
  1108. if (sampleStatus > 0)
  1109. {
  1110. reuslt = true;
  1111. }
  1112. return reuslt;
  1113. }
  1114. }
  1115. }