|
@@ -14,12 +14,10 @@ namespace OTSModelSharp
|
|
|
|
|
|
|
|
//----------------定义----------------------
|
|
//----------------定义----------------------
|
|
|
protected static NLog.Logger logger = null;
|
|
protected static NLog.Logger logger = null;
|
|
|
- // working folder string
|
|
|
|
|
- string m_strWorkingFolder;
|
|
|
|
|
|
|
+
|
|
|
string m_strSampleWorkingFolder;
|
|
string m_strSampleWorkingFolder;
|
|
|
string m_strFieldFileSubFolder;
|
|
string m_strFieldFileSubFolder;
|
|
|
- private string m_strBSEImageFileFolder;
|
|
|
|
|
- private string m_strDBFileFolder;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// pathname
|
|
// pathname
|
|
|
string m_strRstFileName;
|
|
string m_strRstFileName;
|
|
@@ -55,7 +53,7 @@ namespace OTSModelSharp
|
|
|
CSEMStageData m_pSEMStageData;
|
|
CSEMStageData m_pSEMStageData;
|
|
|
// sample stage
|
|
// sample stage
|
|
|
CStage m_pStage;
|
|
CStage m_pStage;
|
|
|
- //CSEMStageDataPtr m_pSEMData;
|
|
|
|
|
|
|
+
|
|
|
CSEMDataGnr m_pSEMData;
|
|
CSEMDataGnr m_pSEMData;
|
|
|
// sample setting
|
|
// sample setting
|
|
|
COTSSample m_pSample;
|
|
COTSSample m_pSample;
|
|
@@ -67,13 +65,6 @@ namespace OTSModelSharp
|
|
|
public CIncAFileMgr DBFileMgr { get => m_DBFileMgr; set => m_DBFileMgr = value; }
|
|
public CIncAFileMgr DBFileMgr { get => m_DBFileMgr; set => m_DBFileMgr = value; }
|
|
|
|
|
|
|
|
|
|
|
|
|
- //----------------public-----------------
|
|
|
|
|
- public CSmplMsrResult()
|
|
|
|
|
- {
|
|
|
|
|
- Init();
|
|
|
|
|
- m_pSample = new COTSSample();
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CSmplMsrResult(string measureWorkingFolder,COTSSample a_pSample)
|
|
public CSmplMsrResult(string measureWorkingFolder,COTSSample a_pSample)
|
|
@@ -85,11 +76,10 @@ namespace OTSModelSharp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- m_strWorkingFolder = measureWorkingFolder;
|
|
|
|
|
|
|
+
|
|
|
m_strSampleWorkingFolder = measureWorkingFolder + "\\" + a_pSample.GetName();
|
|
m_strSampleWorkingFolder = measureWorkingFolder + "\\" + a_pSample.GetName();
|
|
|
m_strFieldFileSubFolder = m_strSampleWorkingFolder + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER;
|
|
m_strFieldFileSubFolder = m_strSampleWorkingFolder + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER;
|
|
|
- m_strBSEImageFileFolder = m_strFieldFileSubFolder;
|
|
|
|
|
- m_strDBFileFolder = m_strFieldFileSubFolder;
|
|
|
|
|
|
|
+
|
|
|
m_strRstFileName = m_strSampleWorkingFolder + "\\" + a_pSample.GetName() + SMPL_MSR_RESULT_FILE_EXT;
|
|
m_strRstFileName = m_strSampleWorkingFolder + "\\" + a_pSample.GetName() + SMPL_MSR_RESULT_FILE_EXT;
|
|
|
m_strdbPathName = m_strFieldFileSubFolder + "\\" + DBFILE_NAME;
|
|
m_strdbPathName = m_strFieldFileSubFolder + "\\" + DBFILE_NAME;
|
|
|
|
|
|
|
@@ -172,15 +162,7 @@ namespace OTSModelSharp
|
|
|
m_pSEMData = a_pSEMData;
|
|
m_pSEMData = a_pSEMData;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public bool GetSwitch()
|
|
|
|
|
- {
|
|
|
|
|
- return m_bSwitch;
|
|
|
|
|
- }
|
|
|
|
|
- public void SetSwitch(bool a_bSwitch)
|
|
|
|
|
- {
|
|
|
|
|
- m_bSwitch = a_bSwitch;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
|
|
public void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
|
|
@@ -283,420 +265,7 @@ namespace OTSModelSharp
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- // Load
|
|
|
|
|
- public bool Load(String a_strPathname /*= _T("")*/)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- a_strPathname.Trim();
|
|
|
|
|
- if (a_strPathname == "")
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- FolderBrowserDialog FileDialog = new FolderBrowserDialog();//创建一个文件对话框
|
|
|
|
|
- if (FileDialog.ShowDialog() != DialogResult.OK)
|
|
|
|
|
- {
|
|
|
|
|
- // user canceled loading
|
|
|
|
|
- logger.Info("Load: user canceled loading.");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- a_strPathname = FileDialog.SelectedPath;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // get path of the pathname
|
|
|
|
|
- String strFilePath =a_strPathname;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // field file sub folder string
|
|
|
|
|
- m_strFieldFileSubFolder = strFilePath + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER + "\\";
|
|
|
|
|
-
|
|
|
|
|
- // check if the field file sub folder exists
|
|
|
|
|
- if (!Exists(m_strFieldFileSubFolder))
|
|
|
|
|
- {
|
|
|
|
|
- // field files folder doesn't exist
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // file version
|
|
|
|
|
- String strFileVersion = m_strFileVersion;
|
|
|
|
|
- uint nFileVersion = GetVersionFromString(strFileVersion);
|
|
|
|
|
- if (nFileVersion == 0)
|
|
|
|
|
- {// invalid file
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- // sample measure result file
|
|
|
|
|
-
|
|
|
|
|
- SetPathFileName(a_strPathname);
|
|
|
|
|
- this.LoadFieldDataFromDB(a_strPathname);
|
|
|
|
|
- // ok, return TRUE
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Get file versio
|
|
|
|
|
- // File Version should be format <Major version>.<Minor version>.<Build version>, like 1.2.3
|
|
|
|
|
- public uint GetVersionFromString(string a_sVersion)
|
|
|
|
|
- {
|
|
|
|
|
- int nMajorVersion = 0;
|
|
|
|
|
- int nMinorVersion = 0;
|
|
|
|
|
- int nBuildVersion = 0;
|
|
|
|
|
-
|
|
|
|
|
- uint nVersion = 0;
|
|
|
|
|
- if (GetMajorVersionFromString(a_sVersion, nMajorVersion) &&
|
|
|
|
|
- GetMinorVersionFromString(a_sVersion, nMinorVersion) &&
|
|
|
|
|
- GetBuildVersionFromString(a_sVersion, nBuildVersion))
|
|
|
|
|
- {
|
|
|
|
|
- nVersion = (uint)nMajorVersion * 10000 + (uint)nMinorVersion * 100 + (uint)nBuildVersion;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return nVersion;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public bool GetMinorVersionFromString(string a_sVersion, int a_nVersion)
|
|
|
|
|
- {
|
|
|
|
|
- // version string
|
|
|
|
|
- String strVersion = a_sVersion;
|
|
|
|
|
-
|
|
|
|
|
- // get major file version string position first
|
|
|
|
|
- int nPosFirst = strVersion.IndexOf('.');
|
|
|
|
|
- if (nPosFirst < 0)
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find major file version string
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // get minor file version string position
|
|
|
|
|
- int nPosSecond = strVersion.IndexOf('.', nPosFirst + 1);
|
|
|
|
|
- int nStrLength = nPosSecond - nPosFirst - 1;
|
|
|
|
|
- if (nStrLength <= 0)
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find minor file version string
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // get minor file version string
|
|
|
|
|
- String strMinorVersion = strVersion.Remove(nPosFirst + 1, nStrLength);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // the minor file version string can't be empty
|
|
|
|
|
- strMinorVersion.Trim();
|
|
|
|
|
- if (strMinorVersion == "")
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find minor file version string
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // convert the minor version string to minor version number
|
|
|
|
|
- if (!StringToInt(strMinorVersion, a_nVersion))
|
|
|
|
|
- {
|
|
|
|
|
- // failed to convert the major file version string to number
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // ok, return TRUE
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public bool GetMajorVersionFromString(string a_sVersion, int a_nVersion)
|
|
|
|
|
- {
|
|
|
|
|
- // version string
|
|
|
|
|
- String strVersion = a_sVersion;
|
|
|
|
|
-
|
|
|
|
|
- // get major file version string position
|
|
|
|
|
- int nPosFirst = strVersion.IndexOf('.');
|
|
|
|
|
- if (nPosFirst <= 0)
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find major file version
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // get major file version string
|
|
|
|
|
- String strMajorVersion = strVersion.PadLeft(nPosFirst);
|
|
|
|
|
-
|
|
|
|
|
- // the major file version string can't be empty
|
|
|
|
|
- strMajorVersion.Trim();
|
|
|
|
|
- if (strMajorVersion == "")
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find major file version
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // convert the major version string to major version number
|
|
|
|
|
- if (!StringToInt(strMajorVersion, a_nVersion))
|
|
|
|
|
- {
|
|
|
|
|
- // failed to convert the major file version string to number
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // ok, return TRUE
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public bool GetBuildVersionFromString(string a_sVersion, int a_nBuild)
|
|
|
|
|
- {
|
|
|
|
|
- // version string
|
|
|
|
|
- String strVersion = a_sVersion;
|
|
|
|
|
-
|
|
|
|
|
- // get major file version string position first
|
|
|
|
|
- int nPosFirst = strVersion.IndexOf('.');
|
|
|
|
|
- if (nPosFirst < 0)
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find major file version string
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // get minor file version string position
|
|
|
|
|
- int nPosSecond = strVersion.IndexOf('.', nPosFirst + 1);
|
|
|
|
|
-
|
|
|
|
|
- if (nPosSecond < 0)
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find minor file version string
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // get build string position
|
|
|
|
|
- int nStrLength = strVersion.Length - nPosSecond - 1;
|
|
|
|
|
- if (nStrLength <= 0)
|
|
|
|
|
- {
|
|
|
|
|
- // failed to find build string
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // get build string
|
|
|
|
|
- String strBuild = strVersion.PadRight(nStrLength);
|
|
|
|
|
-
|
|
|
|
|
- // build string can't be empty
|
|
|
|
|
- strBuild.Trim();
|
|
|
|
|
- if (strBuild == "")
|
|
|
|
|
- {
|
|
|
|
|
- // failed to convert the build string to number
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // convert the build string to build number
|
|
|
|
|
- if (!StringToInt(strBuild, a_nBuild))
|
|
|
|
|
- {
|
|
|
|
|
- // failed to convert the build string to number
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // ok, return TRUE
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Strings to int.
|
|
|
|
|
- public bool StringToInt(string a_sValue, int a_nValue)
|
|
|
|
|
- {
|
|
|
|
|
- if (!IsDigitString(a_sValue))
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- a_nValue = Convert.ToInt32(a_sValue);
|
|
|
|
|
-
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Determines whether is digit string.
|
|
|
|
|
- public bool IsDigitString(string a_sValue)
|
|
|
|
|
- {
|
|
|
|
|
- String strInt = a_sValue;
|
|
|
|
|
- strInt.Trim();
|
|
|
|
|
-
|
|
|
|
|
- if (strInt == "")
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- int nStart = 0;
|
|
|
|
|
-
|
|
|
|
|
- if (strInt[nStart] == '-')
|
|
|
|
|
- {
|
|
|
|
|
- ++nStart;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // cycle through string and check each character if it is a digit
|
|
|
|
|
- for (; nStart < strInt.Length; ++nStart)
|
|
|
|
|
- {
|
|
|
|
|
- if (strInt[nStart] != '-')
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // gets the name of the folder
|
|
|
|
|
- static String GetFolderName(String a_strPathName)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- string str= FileHelper.GetFolderName(a_strPathName);
|
|
|
|
|
- return str.ToString();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private bool LoadFieldDataFromDB(string a_strPathname)
|
|
|
|
|
- {
|
|
|
|
|
- // check the pathname string
|
|
|
|
|
- a_strPathname.Trim();
|
|
|
|
|
- if (a_strPathname == null)
|
|
|
|
|
- {
|
|
|
|
|
- // open
|
|
|
|
|
- FolderBrowserDialog FileDialog = new FolderBrowserDialog();//创建一个文件对话框
|
|
|
|
|
- if (FileDialog.ShowDialog() != DialogResult.OK)
|
|
|
|
|
- {
|
|
|
|
|
- // user canceled loading
|
|
|
|
|
- logger.Info("Load: user canceled loading.");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- a_strPathname = FileDialog.SelectedPath;
|
|
|
|
|
- }
|
|
|
|
|
- // get path of the pathname
|
|
|
|
|
-
|
|
|
|
|
- string strFilePath = GetFolderName(a_strPathname);
|
|
|
|
|
- if (strFilePath == null)
|
|
|
|
|
- {
|
|
|
|
|
- // file path string is an empty string
|
|
|
|
|
- logger.Info("Load: file path string is an empty string.");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- // field file sub folder string
|
|
|
|
|
-
|
|
|
|
|
- string strFieldFileSubFolder = strFilePath + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER + "\\";
|
|
|
|
|
- // check if the field file sub folder exists
|
|
|
|
|
|
|
|
|
|
- if (!Exists(strFieldFileSubFolder))
|
|
|
|
|
- {// field files folder doesn't exist
|
|
|
|
|
- logger.Info("Load: field files folder doesn't exist (%s).");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- string strIncAFilename = strFieldFileSubFolder + "\\" +DBFILE_NAME;
|
|
|
|
|
- CIncAFileMgr pIncAFileMgr = new CIncAFileMgr(strIncAFilename);
|
|
|
|
|
- List<COTSField> allFlds;
|
|
|
|
|
- allFlds = null;
|
|
|
|
|
- CMsrSampleStatus poMsrStatus = m_pSample.GetMsrStatus();
|
|
|
|
|
- CMsrResultItems poMsrResults = m_pSample.GetMsrResults();
|
|
|
|
|
- double aFldArea = m_pSample.CalculateAFieldArea();
|
|
|
|
|
- if (GetAllFieldsFromDB(allFlds, poMsrStatus, poMsrResults, aFldArea))
|
|
|
|
|
- {
|
|
|
|
|
- SetFieldData(allFlds);
|
|
|
|
|
-
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public bool GetAllFieldsFromDB(List<COTSField> allFlds, CMsrSampleStatus status, CMsrResultItems rst, double aFieldArea)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- List<System.Drawing.PointF> completedfld = new List<System.Drawing.PointF>();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- m_DBFileMgr.GetIncADB().GetAllFieldsRecord(ref allFlds);
|
|
|
|
|
- var SegmentDB = m_DBFileMgr.GetSegmentDB();
|
|
|
|
|
- double msrFldsArea = 0;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- Dictionary<int, List<COTSParticleClr>> mapTypeParticles = new Dictionary<int, List<COTSParticleClr>>();
|
|
|
|
|
-
|
|
|
|
|
- Dictionary<string, List<COTSSegmentClr>> AllSegments = new Dictionary<string, List<COTSSegmentClr>>();
|
|
|
|
|
- if (SegmentDB.GetAllSegmentsRecord(AllSegments))
|
|
|
|
|
- {
|
|
|
|
|
- //int nCol;
|
|
|
|
|
- foreach (var fld in allFlds)
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- int fldId = fld.GetId();
|
|
|
|
|
- List<COTSParticleClr> parts = fld.GetListAnalysisParticles();
|
|
|
|
|
- List<COTSSegmentClr> cOTSSegment = new List<COTSSegmentClr>();
|
|
|
|
|
- foreach (var part in parts)
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- var itr = AllSegments.Values;
|
|
|
|
|
-
|
|
|
|
|
- if (itr != AllSegments.Values)
|
|
|
|
|
- {
|
|
|
|
|
- COTSFeatureClr f = new COTSFeatureClr();
|
|
|
|
|
- f.SetSegmentsList(cOTSSegment, true);
|
|
|
|
|
- part.SetFeature(f);
|
|
|
|
|
- }
|
|
|
|
|
- mapTypeParticles[part.GetClassifyId()].Add(part);
|
|
|
|
|
- }
|
|
|
|
|
- completedfld.Add(fld.GetOTSPosition());
|
|
|
|
|
- msrFldsArea += aFieldArea;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- // get MsrStatus info from DB.
|
|
|
|
|
-
|
|
|
|
|
- String strTimeStart = "";
|
|
|
|
|
- String strTimeEnd = "";
|
|
|
|
|
- String strRstStatus = "";
|
|
|
|
|
- var m_GenInfoDB = m_DBFileMgr.GetGeneralInfoDB();
|
|
|
|
|
- m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameTimeStart(), ref strTimeStart);
|
|
|
|
|
- m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameTimeEnd(),ref strTimeEnd);
|
|
|
|
|
- m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameResultStatus(),ref strRstStatus);
|
|
|
|
|
- status.SetCompletedFieldsCenter(completedfld);
|
|
|
|
|
-
|
|
|
|
|
- DateTime timeStart, timeEnd;
|
|
|
|
|
-
|
|
|
|
|
- timeStart = Convert.ToDateTime(strTimeStart);
|
|
|
|
|
- timeEnd = Convert.ToDateTime(strTimeEnd);
|
|
|
|
|
- status.SetStartTime(timeStart);
|
|
|
|
|
- status.SetEndTime(timeEnd);
|
|
|
|
|
- status.SetUsedTime(timeEnd - timeStart);
|
|
|
|
|
- status.SetStatus((OTS_MSR_SAMPLE_STATUS)Convert.ToInt32(strRstStatus));
|
|
|
|
|
- //get MsrResults data from map.
|
|
|
|
|
- List<CMsrResultItem> rstItms = new List<CMsrResultItem>();
|
|
|
|
|
- double allPartArea = 0;
|
|
|
|
|
- foreach (var typeParticles in mapTypeParticles)
|
|
|
|
|
- {
|
|
|
|
|
- CMsrResultItem rstItm = new CMsrResultItem();
|
|
|
|
|
- int typeNum = 0;
|
|
|
|
|
- double typeArea = 0;
|
|
|
|
|
- foreach (var p in mapTypeParticles)
|
|
|
|
|
- {
|
|
|
|
|
- typeNum += 1;
|
|
|
|
|
- typeArea += Convert.ToInt32(p);
|
|
|
|
|
- }
|
|
|
|
|
- rstItm.SetTypeId(Convert.ToInt32(typeParticles));
|
|
|
|
|
- rstItm.SetNumber((uint)typeNum);
|
|
|
|
|
- rstItm.SetArea((uint)typeArea);
|
|
|
|
|
- rstItms.Add(rstItm);
|
|
|
|
|
- allPartArea += typeArea;
|
|
|
|
|
- }
|
|
|
|
|
- rst.SetResultItems(rstItms);
|
|
|
|
|
- rst.SetMeasuredArea((uint)msrFldsArea * 1000000);
|
|
|
|
|
- rst.SetRatio(allPartArea / (msrFldsArea * 1000000));
|
|
|
|
|
- return true;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
// Save
|
|
// Save
|
|
|
public bool CreateResultFiles()
|
|
public bool CreateResultFiles()
|
|
@@ -741,69 +310,7 @@ namespace OTSModelSharp
|
|
|
// return field file sub folder string
|
|
// return field file sub folder string
|
|
|
return m_strFieldFileSubFolder;
|
|
return m_strFieldFileSubFolder;
|
|
|
}
|
|
}
|
|
|
- // sample measure result file
|
|
|
|
|
-
|
|
|
|
|
- // save a BSE file for a field
|
|
|
|
|
- public bool SaveBSEFileForAField(COTSField a_pField)
|
|
|
|
|
- {
|
|
|
|
|
- if (a_pField == null)
|
|
|
|
|
- {
|
|
|
|
|
- logger.Info("SaveBSEFileForAField: invalid field data pointer.");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- string strBSEFilePathname = m_strSampleWorkingFolder + "\\" +SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER + "\\";
|
|
|
|
|
- // save BSE file for the field
|
|
|
|
|
- CBSEImgClr pBSEImage = a_pField.GetBSEImage();
|
|
|
|
|
- CBSEImageFileMgr pBSEImgFileMgr = new CBSEImageFileMgr();
|
|
|
|
|
- pBSEImgFileMgr.SetBSEImg(pBSEImage);
|
|
|
|
|
- pBSEImgFileMgr.SaveIntoBitmap(strBSEFilePathname);
|
|
|
|
|
- // ok, return TRUE
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- // save a x-ray file for a field
|
|
|
|
|
- public bool SaveXRayFileForAField(List<CPosXrayClr> a_pFieldXray)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- string strIncAFilename = m_strDBFileFolder + "\\" + DBFILE_NAME;
|
|
|
|
|
- // save x-ray file for the field
|
|
|
|
|
- CPosXrayDBMgr pPosXrayDBMgr = new CIncAFileMgr(strIncAFilename).GetPosXrayDBMgr();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- List<CPosXrayClr> listAnalysisXray = a_pFieldXray;
|
|
|
|
|
-
|
|
|
|
|
- if (!pPosXrayDBMgr.SaveXray(listAnalysisXray,true))
|
|
|
|
|
- {
|
|
|
|
|
- logger.Info("SaveXRayFileForAField: save analysis x-ray failed.");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- // ok, return TRUE
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- public void SetFieldData(List<COTSField> a_listFieldData)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- m_pSample.SetFieldsData(a_listFieldData);
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- public string GetPathFileName()
|
|
|
|
|
- {
|
|
|
|
|
- return m_strRstFileName;
|
|
|
|
|
- }
|
|
|
|
|
- public string GetDBPathName()
|
|
|
|
|
- {
|
|
|
|
|
- return m_strdbPathName;
|
|
|
|
|
- }
|
|
|
|
|
- public void SetPathFileName(string PathName)
|
|
|
|
|
- {
|
|
|
|
|
- m_strRstFileName = PathName;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
public void SetSEMGnr(CSEMDataGnr a_pSEMGnr)
|
|
public void SetSEMGnr(CSEMDataGnr a_pSEMGnr)
|
|
|
{
|
|
{
|