CSmplMsrResult.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. using OTSCLRINTERFACE;
  2. using OTSDataType;
  3. using OTSModelSharp.DTLBase;
  4. using OTSModelSharp.ServiceCenter;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Drawing;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13. using System.Xml;
  14. namespace OTSModelSharp
  15. {
  16. public class CSmplMsrResult
  17. {
  18. //----------------定义----------------------
  19. protected static NLog.Logger logger = null;
  20. // working folder string
  21. string m_strWorkingFolder;
  22. string m_strSampleWorkingFolder;
  23. string m_strFieldFileSubFolder;
  24. private string m_strBSEImageFileFolder;
  25. private string m_strDBFileFolder;
  26. // pathname
  27. string m_strRstFileName;
  28. string m_strdbPathName;
  29. CIncAFileMgr m_DBFileMgr ;
  30. public string SMPL_MSR_RESULT_FILE_EXT = ".rst";
  31. // fields file sub-directory string
  32. public string SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER = "FIELD_FILES";
  33. public string DBFILE_NAME = "Inclusion.db";
  34. // BSE file name
  35. public string SMPL_MSR_RESULT_FIELDS_BSE = ("Field");
  36. public string SMPL_MSR_RESULT_FILE_FILTER = ("Sample Measure Result Files (*.rst)|*.rst||");
  37. //----------全局定义------------------
  38. // sample measure result file mark
  39. public int SMPL_MSR_RESULT_FILE_MARK = 'S' + 'M' + 'P' + 'L' + 'M' + 'S' + 'R' + 'R' + 'E' + 'S' + 'U' + 'L' + 'T';
  40. // sample measure result file version
  41. public string SMPL_MSR_RESULT_FILE_VERSION = ("2.0.0");
  42. // sample measure result file extension
  43. //----------定义----------------------
  44. // file version string
  45. string m_strFileVersion;
  46. // SEM sample stage
  47. CSEMStageData m_pSEMStageData;
  48. // sample stage
  49. CStage m_pStage;
  50. //CSEMStageDataPtr m_pSEMData;
  51. CSEMDataGnr m_pSEMData;
  52. // sample setting
  53. COTSSample m_pSample;
  54. // switch
  55. bool m_bSwitch;
  56. public CIncAFileMgr DBFileMgr { get => m_DBFileMgr; set => m_DBFileMgr = value; }
  57. //----------------public-----------------
  58. public CSmplMsrResult()
  59. {
  60. Init();
  61. m_pSample = new COTSSample();
  62. }
  63. public CSmplMsrResult(string measureWorkingFolder,COTSSample a_pSample)
  64. {
  65. Init();
  66. logger = NLog.LogManager.GetCurrentClassLogger();
  67. m_pSample = a_pSample;
  68. m_strWorkingFolder = measureWorkingFolder;
  69. m_strSampleWorkingFolder = measureWorkingFolder + "\\" + a_pSample.GetName();
  70. m_strFieldFileSubFolder = m_strSampleWorkingFolder + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER;
  71. m_strBSEImageFileFolder = m_strFieldFileSubFolder;
  72. m_strDBFileFolder = m_strFieldFileSubFolder;
  73. m_strRstFileName = m_strSampleWorkingFolder + "\\" + a_pSample.GetName() + SMPL_MSR_RESULT_FILE_EXT;
  74. m_strdbPathName = m_strFieldFileSubFolder + "\\" + DBFILE_NAME;
  75. m_DBFileMgr = new CIncAFileMgr(m_strdbPathName);
  76. }
  77. protected void Init()
  78. {
  79. m_strFileVersion = ("");
  80. m_pSEMStageData = new CSEMStageData();
  81. m_pStage = new CStage();
  82. m_pSEMData = new CSEMDataGnr();
  83. m_bSwitch = false;
  84. }
  85. protected void Cleanup()
  86. {
  87. m_pSample.GetFieldsData().Clear();
  88. }
  89. public string GetFileVersion()
  90. {
  91. return m_strFileVersion;
  92. }
  93. public void SetFileVersion(string a_strFileVersion)
  94. {
  95. m_strFileVersion = a_strFileVersion;
  96. }
  97. public COTSSample GetSample()
  98. {
  99. return m_pSample;
  100. }
  101. public void SetSample(COTSSample a_pSample)
  102. {
  103. if (a_pSample != null)
  104. {
  105. return;
  106. }
  107. m_pSample = a_pSample;
  108. }
  109. public CSEMStageData GetSEMStageData()
  110. {
  111. return m_pSEMStageData;
  112. }
  113. public void SetSEMStageData(CSEMStageData a_pSEMStageData)
  114. {
  115. m_pSEMStageData = a_pSEMStageData;
  116. }
  117. // sample stage
  118. public CStage GetStage()
  119. {
  120. return m_pStage;
  121. }
  122. public void SetStage(CStage a_pStage)
  123. {
  124. if (a_pStage != null)
  125. {
  126. return;
  127. }
  128. m_pStage = a_pStage;
  129. }
  130. // SEM condition
  131. public CSEMDataGnr GetSEMStage()
  132. {
  133. return m_pSEMData;
  134. }
  135. public void SetSEMStage(CSEMDataGnr a_pSEMData)
  136. {
  137. if (a_pSEMData != null)
  138. {
  139. return;
  140. }
  141. m_pSEMData = a_pSEMData;
  142. }
  143. public bool GetSwitch()
  144. {
  145. return m_bSwitch;
  146. }
  147. public void SetSwitch(bool a_bSwitch)
  148. {
  149. m_bSwitch = a_bSwitch;
  150. }
  151. public void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
  152. {
  153. xInt xnFileMark = new xInt();
  154. xString xnVersion = new xString();
  155. xBool xbSwitch = new xBool();
  156. Collection<Slo> xfields = new Collection<Slo>();
  157. Slo slo = new Slo();
  158. slo.Register("FileMark", xnFileMark);
  159. slo.Register("Version", xnVersion);
  160. slo.Register("Switch", xbSwitch);
  161. slo.Register("SEMStageData", m_pSEMStageData);
  162. slo.Register("Stage", m_pStage);
  163. slo.Register("SEMData", m_pSEMData);
  164. slo.Register("Sample", m_pSample);
  165. slo.Register("Fields", xfields);
  166. if (isStoring)
  167. {
  168. xnFileMark.AssignValue(SMPL_MSR_RESULT_FILE_MARK);
  169. xnVersion.AssignValue(SMPL_MSR_RESULT_FILE_VERSION);
  170. xbSwitch.AssignValue(m_bSwitch);
  171. slo.Serialize(true, classDoc, rootNode);
  172. }
  173. else
  174. {
  175. slo.Serialize(false, classDoc, rootNode);
  176. m_bSwitch = xbSwitch.value();
  177. m_strFileVersion = xnVersion.value();
  178. }
  179. }
  180. private bool InitFolders()
  181. {
  182. if (!Exists(m_strSampleWorkingFolder))
  183. {
  184. // the working directory is not exit, create it
  185. if (!CreateFolder(m_strSampleWorkingFolder))
  186. {
  187. return false;
  188. }
  189. }
  190. // check if the field files directory exists
  191. if (!Exists(m_strFieldFileSubFolder))
  192. {
  193. // field files directory exists not exists, creates it
  194. if (!CreateFolder(m_strFieldFileSubFolder))
  195. {
  196. // failed to create the field files directory
  197. return false;
  198. }
  199. }
  200. return true;
  201. }
  202. // creates a folder.
  203. private bool CreateFolder(string a_strFolder)
  204. {
  205. // make sure the folder name string are not empty
  206. string strFolder = a_strFolder;
  207. strFolder.Trim();
  208. if (strFolder=="")
  209. {
  210. return false;
  211. }
  212. // if the folder exist?
  213. if (Exists(strFolder))
  214. {
  215. return true;
  216. }
  217. Directory.CreateDirectory(strFolder);
  218. bool bRet = true;
  219. // return folder create result
  220. return bRet;
  221. }
  222. // check if the file exists or not
  223. private bool Exists(string a_sPath)
  224. {
  225. return Directory.Exists(a_sPath);
  226. }
  227. // Load
  228. public bool Load(String a_strPathname /*= _T("")*/)
  229. {
  230. a_strPathname.Trim();
  231. if (a_strPathname == "")
  232. {
  233. FolderBrowserDialog FileDialog = new FolderBrowserDialog();//创建一个文件对话框
  234. if (FileDialog.ShowDialog() != DialogResult.OK)
  235. {
  236. // user canceled loading
  237. logger.Info("Load: user canceled loading.");
  238. return false;
  239. }
  240. a_strPathname = FileDialog.SelectedPath;
  241. }
  242. // get path of the pathname
  243. String strFilePath =a_strPathname;
  244. // field file sub folder string
  245. m_strFieldFileSubFolder = strFilePath + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER + "\\";
  246. // check if the field file sub folder exists
  247. if (!Exists(m_strFieldFileSubFolder))
  248. {
  249. // field files folder doesn't exist
  250. return false;
  251. }
  252. // file version
  253. String strFileVersion = m_strFileVersion;
  254. uint nFileVersion = GetVersionFromString(strFileVersion);
  255. if (nFileVersion == 0)
  256. {// invalid file
  257. return false;
  258. }
  259. // sample measure result file
  260. SetPathFileName(a_strPathname);
  261. this.LoadFieldDataFromDB(a_strPathname);
  262. // ok, return TRUE
  263. return true;
  264. }
  265. // Get file versio
  266. // File Version should be format <Major version>.<Minor version>.<Build version>, like 1.2.3
  267. public uint GetVersionFromString(string a_sVersion)
  268. {
  269. int nMajorVersion = 0;
  270. int nMinorVersion = 0;
  271. int nBuildVersion = 0;
  272. uint nVersion = 0;
  273. if (GetMajorVersionFromString(a_sVersion, nMajorVersion) &&
  274. GetMinorVersionFromString(a_sVersion, nMinorVersion) &&
  275. GetBuildVersionFromString(a_sVersion, nBuildVersion))
  276. {
  277. nVersion = (uint)nMajorVersion * 10000 + (uint)nMinorVersion * 100 + (uint)nBuildVersion;
  278. }
  279. return nVersion;
  280. }
  281. public bool GetMinorVersionFromString(string a_sVersion, int a_nVersion)
  282. {
  283. // version string
  284. String strVersion = a_sVersion;
  285. // get major file version string position first
  286. int nPosFirst = strVersion.IndexOf('.');
  287. if (nPosFirst < 0)
  288. {
  289. // failed to find major file version string
  290. return false;
  291. }
  292. // get minor file version string position
  293. int nPosSecond = strVersion.IndexOf('.', nPosFirst + 1);
  294. int nStrLength = nPosSecond - nPosFirst - 1;
  295. if (nStrLength <= 0)
  296. {
  297. // failed to find minor file version string
  298. return false;
  299. }
  300. // get minor file version string
  301. String strMinorVersion = strVersion.Remove(nPosFirst + 1, nStrLength);
  302. // the minor file version string can't be empty
  303. strMinorVersion.Trim();
  304. if (strMinorVersion == "")
  305. {
  306. // failed to find minor file version string
  307. return false;
  308. }
  309. // convert the minor version string to minor version number
  310. if (!StringToInt(strMinorVersion, a_nVersion))
  311. {
  312. // failed to convert the major file version string to number
  313. return false;
  314. }
  315. // ok, return TRUE
  316. return true;
  317. }
  318. public bool GetMajorVersionFromString(string a_sVersion, int a_nVersion)
  319. {
  320. // version string
  321. String strVersion = a_sVersion;
  322. // get major file version string position
  323. int nPosFirst = strVersion.IndexOf('.');
  324. if (nPosFirst <= 0)
  325. {
  326. // failed to find major file version
  327. return false;
  328. }
  329. // get major file version string
  330. String strMajorVersion = strVersion.PadLeft(nPosFirst);
  331. // the major file version string can't be empty
  332. strMajorVersion.Trim();
  333. if (strMajorVersion == "")
  334. {
  335. // failed to find major file version
  336. return false;
  337. }
  338. // convert the major version string to major version number
  339. if (!StringToInt(strMajorVersion, a_nVersion))
  340. {
  341. // failed to convert the major file version string to number
  342. return false;
  343. }
  344. // ok, return TRUE
  345. return true;
  346. }
  347. public bool GetBuildVersionFromString(string a_sVersion, int a_nBuild)
  348. {
  349. // version string
  350. String strVersion = a_sVersion;
  351. // get major file version string position first
  352. int nPosFirst = strVersion.IndexOf('.');
  353. if (nPosFirst < 0)
  354. {
  355. // failed to find major file version string
  356. return false;
  357. }
  358. // get minor file version string position
  359. int nPosSecond = strVersion.IndexOf('.', nPosFirst + 1);
  360. if (nPosSecond < 0)
  361. {
  362. // failed to find minor file version string
  363. return false;
  364. }
  365. // get build string position
  366. int nStrLength = strVersion.Length - nPosSecond - 1;
  367. if (nStrLength <= 0)
  368. {
  369. // failed to find build string
  370. return false;
  371. }
  372. // get build string
  373. String strBuild = strVersion.PadRight(nStrLength);
  374. // build string can't be empty
  375. strBuild.Trim();
  376. if (strBuild == "")
  377. {
  378. // failed to convert the build string to number
  379. return false;
  380. }
  381. // convert the build string to build number
  382. if (!StringToInt(strBuild, a_nBuild))
  383. {
  384. // failed to convert the build string to number
  385. return false;
  386. }
  387. // ok, return TRUE
  388. return true;
  389. }
  390. // Strings to int.
  391. public bool StringToInt(string a_sValue, int a_nValue)
  392. {
  393. if (!IsDigitString(a_sValue))
  394. {
  395. return false;
  396. }
  397. a_nValue = Convert.ToInt32(a_sValue);
  398. return true;
  399. }
  400. // Determines whether is digit string.
  401. public bool IsDigitString(string a_sValue)
  402. {
  403. String strInt = a_sValue;
  404. strInt.Trim();
  405. if (strInt == "")
  406. {
  407. return false;
  408. }
  409. int nStart = 0;
  410. if (strInt[nStart] == '-')
  411. {
  412. ++nStart;
  413. }
  414. // cycle through string and check each character if it is a digit
  415. for (; nStart < strInt.Length; ++nStart)
  416. {
  417. if (strInt[nStart] != '-')
  418. {
  419. return false;
  420. }
  421. }
  422. return true;
  423. }
  424. // gets the name of the folder
  425. static String GetFolderName(String a_strPathName)
  426. {
  427. string str= FileHelper.GetFolderName(a_strPathName);
  428. return str.ToString();
  429. }
  430. private bool LoadFieldDataFromDB(string a_strPathname)
  431. {
  432. // check the pathname string
  433. a_strPathname.Trim();
  434. if (a_strPathname == null)
  435. {
  436. // open
  437. FolderBrowserDialog FileDialog = new FolderBrowserDialog();//创建一个文件对话框
  438. if (FileDialog.ShowDialog() != DialogResult.OK)
  439. {
  440. // user canceled loading
  441. logger.Info("Load: user canceled loading.");
  442. return false;
  443. }
  444. a_strPathname = FileDialog.SelectedPath;
  445. }
  446. // get path of the pathname
  447. string strFilePath = GetFolderName(a_strPathname);
  448. if (strFilePath == null)
  449. {
  450. // file path string is an empty string
  451. logger.Info("Load: file path string is an empty string.");
  452. return false;
  453. }
  454. // field file sub folder string
  455. string strFieldFileSubFolder = strFilePath + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER + "\\";
  456. // check if the field file sub folder exists
  457. if (!Exists(strFieldFileSubFolder))
  458. {// field files folder doesn't exist
  459. logger.Info("Load: field files folder doesn't exist (%s).");
  460. return false;
  461. }
  462. string strIncAFilename = strFieldFileSubFolder + "\\" +DBFILE_NAME;
  463. CIncAFileMgr pIncAFileMgr = new CIncAFileMgr(strIncAFilename);
  464. List<COTSFieldData> allFlds;
  465. allFlds = null;
  466. CMsrSampleStatus poMsrStatus = m_pSample.GetMsrStatus();
  467. CMsrResultItems poMsrResults = m_pSample.GetMsrResults();
  468. double aFldArea = m_pSample.CalculateAFieldArea();
  469. if (GetAllFieldsFromDB(allFlds, poMsrStatus, poMsrResults, aFldArea))
  470. {
  471. SetFieldData(allFlds);
  472. return true;
  473. }
  474. else
  475. {
  476. return false;
  477. }
  478. }
  479. public bool GetAllFieldsFromDB(List<COTSFieldData> allFlds, CMsrSampleStatus status, CMsrResultItems rst, double aFieldArea)
  480. {
  481. List<System.Drawing.PointF> completedfld = new List<System.Drawing.PointF>();
  482. m_DBFileMgr.GetIncADB().GetAllFieldsRecord(ref allFlds);
  483. var SegmentDB = m_DBFileMgr.GetSegmentDB();
  484. double msrFldsArea = 0;
  485. Dictionary<int, List<COTSParticleClr>> mapTypeParticles = new Dictionary<int, List<COTSParticleClr>>();
  486. Dictionary<string, List<COTSSegmentClr>> AllSegments = new Dictionary<string, List<COTSSegmentClr>>();
  487. if (SegmentDB.GetAllSegmentsRecord(AllSegments))
  488. {
  489. //int nCol;
  490. foreach (var fld in allFlds)
  491. {
  492. int fldId = fld.GetId();
  493. List<COTSParticleClr> parts = fld.GetListAnalysisParticles();
  494. List<COTSSegmentClr> cOTSSegment = new List<COTSSegmentClr>();
  495. foreach (var part in parts)
  496. {
  497. var itr = AllSegments.Values;
  498. if (itr != AllSegments.Values)
  499. {
  500. COTSFeatureClr f = new COTSFeatureClr();
  501. f.SetSegmentsList(cOTSSegment, true);
  502. part.SetFeature(f);
  503. }
  504. mapTypeParticles[part.GetClassifyId()].Add(part);
  505. }
  506. completedfld.Add(fld.GetOTSPosition());
  507. msrFldsArea += aFieldArea;
  508. }
  509. }
  510. // get MsrStatus info from DB.
  511. String strTimeStart = "";
  512. String strTimeEnd = "";
  513. String strRstStatus = "";
  514. var m_GenInfoDB = m_DBFileMgr.GetGeneralInfoDB();
  515. m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameTimeStart(), ref strTimeStart);
  516. m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameTimeEnd(),ref strTimeEnd);
  517. m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameResultStatus(),ref strRstStatus);
  518. status.SetCompletedFieldsCenter(completedfld);
  519. DateTime timeStart, timeEnd;
  520. timeStart = Convert.ToDateTime(strTimeStart);
  521. timeEnd = Convert.ToDateTime(strTimeEnd);
  522. status.SetStartTime(timeStart);
  523. status.SetEndTime(timeEnd);
  524. status.SetUsedTime(timeEnd - timeStart);
  525. status.SetStatus((OTS_MSR_SAMPLE_STATUS)Convert.ToInt32(strRstStatus));
  526. //get MsrResults data from map.
  527. List<CMsrResultItem> rstItms = new List<CMsrResultItem>();
  528. double allPartArea = 0;
  529. foreach (var typeParticles in mapTypeParticles)
  530. {
  531. CMsrResultItem rstItm = new CMsrResultItem();
  532. int typeNum = 0;
  533. double typeArea = 0;
  534. foreach (var p in mapTypeParticles)
  535. {
  536. typeNum += 1;
  537. typeArea += Convert.ToInt32(p);
  538. }
  539. rstItm.SetTypeId(Convert.ToInt32(typeParticles));
  540. rstItm.SetNumber((uint)typeNum);
  541. rstItm.SetArea((uint)typeArea);
  542. rstItms.Add(rstItm);
  543. allPartArea += typeArea;
  544. }
  545. rst.SetResultItems(rstItms);
  546. rst.SetMeasuredArea((uint)msrFldsArea * 1000000);
  547. rst.SetRatio(allPartArea / (msrFldsArea * 1000000));
  548. return true;
  549. }
  550. // Save
  551. public bool CreateResultFiles()
  552. {
  553. InitFolders();
  554. XmlDocument xmlDoc = new XmlDocument();
  555. XmlDeclaration xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);
  556. xmlDoc.AppendChild(xmlDeclaration);
  557. XmlElement rootNode = xmlDoc.CreateElement("XMLData");
  558. xmlDoc.AppendChild(rootNode);
  559. XmlNode root = xmlDoc.SelectSingleNode("XMLData");
  560. Serialize(true, xmlDoc, root);
  561. if (!File.Exists(m_strRstFileName))
  562. {
  563. xmlDoc.Save(m_strRstFileName);
  564. }
  565. m_DBFileMgr.InitFile();
  566. m_DBFileMgr.InitDataTable();
  567. return true;
  568. }
  569. public string GetFieldFileSubFolderStr()
  570. {
  571. // return field file sub folder string
  572. return m_strFieldFileSubFolder;
  573. }
  574. // sample measure result file
  575. // save a BSE file for a field
  576. public bool SaveBSEFileForAField(COTSFieldData a_pField)
  577. {
  578. if (a_pField == null)
  579. {
  580. logger.Info("SaveBSEFileForAField: invalid field data pointer.");
  581. return false;
  582. }
  583. string strBSEFilePathname = m_strSampleWorkingFolder + "\\" +SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER + "\\";
  584. // save BSE file for the field
  585. CBSEImgClr pBSEImage = a_pField.GetBSEImage();
  586. CBSEImageFileMgr pBSEImgFileMgr = new CBSEImageFileMgr();
  587. pBSEImgFileMgr.SetBSEImg(pBSEImage);
  588. pBSEImgFileMgr.SaveIntoBitmap(strBSEFilePathname);
  589. // ok, return TRUE
  590. return true;
  591. }
  592. // save a x-ray file for a field
  593. public bool SaveXRayFileForAField(List<CPosXrayClr> a_pFieldXray)
  594. {
  595. string strIncAFilename = m_strDBFileFolder + "\\" + DBFILE_NAME;
  596. // save x-ray file for the field
  597. CPosXrayDBMgr pPosXrayDBMgr = new CIncAFileMgr(strIncAFilename).GetPosXrayDBMgr();
  598. List<CPosXrayClr> listAnalysisXray = a_pFieldXray;
  599. if (!pPosXrayDBMgr.SaveXray(listAnalysisXray,true))
  600. {
  601. logger.Info("SaveXRayFileForAField: save analysis x-ray failed.");
  602. return false;
  603. }
  604. // ok, return TRUE
  605. return true;
  606. }
  607. public void SetFieldData(List<COTSFieldData> a_listFieldData)
  608. {
  609. m_pSample.SetFieldsData(a_listFieldData);
  610. }
  611. public string GetPathFileName()
  612. {
  613. return m_strRstFileName;
  614. }
  615. public string GetDBPathName()
  616. {
  617. return m_strdbPathName;
  618. }
  619. public void SetPathFileName(string PathName)
  620. {
  621. m_strRstFileName = PathName;
  622. }
  623. public void SetSEMGnr(CSEMDataGnr a_pSEMGnr)
  624. {
  625. if (a_pSEMGnr == null)
  626. {
  627. logger.Info("input a invalid SEM general data pointer.");
  628. return;
  629. }
  630. m_pSEMData= a_pSEMGnr;
  631. }
  632. public void SetSEMStage(CStage a_pStage)
  633. {
  634. //ASSERT(a_pStage);
  635. if (a_pStage == null)
  636. {
  637. logger.Info("input a invalid stage pointer.");
  638. return;
  639. }
  640. m_pStage= a_pStage;
  641. }
  642. }
  643. }