|
@@ -51,10 +51,9 @@ namespace OTSModelSharp
|
|
|
const String SMPL_MSR_RESULT_INCLUSION_FILE = "Inclusion.db";//put all the table in one db file so that report can make join query.
|
|
|
|
|
|
|
|
|
- public otsdataconst.OTS_SysType_ID m_systemTypeId;
|
|
|
-
|
|
|
-
|
|
|
+ private otsdataconst.OTS_SysType_ID systemTypeId;
|
|
|
|
|
|
+ public OTS_SysType_ID SystemTypeId { get => systemTypeId; set => systemTypeId = value; }
|
|
|
|
|
|
public COTSMsrPrjResultData()
|
|
|
{
|
|
@@ -1200,110 +1199,7 @@ namespace OTSModelSharp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- // get std file list, a_nPos = -1, current do not use any STD lib, a_nPos = 0, current use STD lib.
|
|
|
- //public bool GetSTDFileList(ref int a_nPos, ref List<String> a_listSTDLibName)
|
|
|
- //{
|
|
|
-
|
|
|
-
|
|
|
- // String a_strFolderName = m_GenParam.GetPartSTDLibFolderName();
|
|
|
- // if (a_strFolderName == "")
|
|
|
- // {
|
|
|
-
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- // // lib name list
|
|
|
- // a_listSTDLibName.Clear();
|
|
|
-
|
|
|
- // // file list
|
|
|
- // List<String> listSTDFile = new List<string>();
|
|
|
- // listSTDFile.Clear();
|
|
|
- // const String STD_LIB_EXT = ".db";
|
|
|
- // // get file list
|
|
|
- // if (!GetFileNameList(a_strFolderName, STD_LIB_EXT, listSTDFile))
|
|
|
- // {
|
|
|
-
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- // foreach (var file in listSTDFile)
|
|
|
- // {
|
|
|
- // //string fileName = file.Left(file.GetLength() - 3);
|
|
|
- // String fileName = file;
|
|
|
- // a_listSTDLibName.Add(fileName);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (a_listSTDLibName.Count > -1)
|
|
|
- // {
|
|
|
- // string m_NoSTDDB = "NoSTDDB";
|
|
|
- // a_listSTDLibName.Add(m_NoSTDDB);
|
|
|
- // }
|
|
|
-
|
|
|
- // //before the use choose one STD, always should be null.
|
|
|
- // a_nPos = -1;
|
|
|
-
|
|
|
- // String sCurrentSTD;
|
|
|
- // CMeasureParam pCurrentParam;
|
|
|
- // COTSSample pSample = GetWorkingSample();
|
|
|
- // if (pSample == null)
|
|
|
- // {
|
|
|
-
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // pCurrentParam = pSample.GetMsrParams();
|
|
|
- // if (pCurrentParam == null)
|
|
|
- // {
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // //将当前使用的数据库的名字与下拉菜单的名字对应起来
|
|
|
- // sCurrentSTD = pCurrentParam.GetSTDName();
|
|
|
- // for (int i = 0; i < (int)a_listSTDLibName.Count; i++)
|
|
|
- // {
|
|
|
- // a_nPos++;
|
|
|
- // if (a_listSTDLibName[i].CompareTo(sCurrentSTD) == 0)
|
|
|
- // break;
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // return true;
|
|
|
- //}
|
|
|
-
|
|
|
- // get file name list in a folder
|
|
|
- //public bool GetFileNameList(String a_strFolderName, String a_strFileType, List<String> a_listFileName)
|
|
|
- //{
|
|
|
-
|
|
|
- // try
|
|
|
- // {
|
|
|
-
|
|
|
- // string path = a_strFolderName;
|
|
|
- // List<string> lineStringList = new List<string>();//存储所有读取到的文件
|
|
|
- // DirectoryInfo[] dateDirArr = new DirectoryInfo(path).GetDirectories(); //取指定路径下的所有目录
|
|
|
-
|
|
|
- // string[] dir = Directory.GetDirectories(path); //文件夹列表
|
|
|
- // DirectoryInfo fdir = new DirectoryInfo(path);
|
|
|
- // FileInfo[] files = fdir.GetFiles();
|
|
|
- // foreach (FileInfo file in files)
|
|
|
- // {
|
|
|
- // string extensionName = Path.GetExtension(file.FullName);
|
|
|
- // if (extensionName == a_strFileType)
|
|
|
- // {
|
|
|
- // string FileNameWithoutExtension = Path.GetFileNameWithoutExtension(file.FullName);
|
|
|
- // a_listFileName.Add(FileNameWithoutExtension);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
- // catch (Exception pe)
|
|
|
- // {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- // return true;
|
|
|
-
|
|
|
- //}
|
|
|
+
|
|
|
|
|
|
static String FindFile(String filename, String path)
|
|
|
{
|
|
@@ -1322,59 +1218,7 @@ namespace OTSModelSharp
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- //// change STD
|
|
|
- //public bool ChangeSTDFromList(int a_nPos)
|
|
|
- //{
|
|
|
-
|
|
|
-
|
|
|
- // String a_strFolderName = m_GenParam.GetPartSTDLibFolderName();
|
|
|
- // if (a_strFolderName == "")
|
|
|
- // {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- // // file list
|
|
|
- // List<String> listSTDFile = new List<string>();
|
|
|
- // listSTDFile.Clear();
|
|
|
- // const String STD_LIB_EXT = ".db";
|
|
|
- // // get file list
|
|
|
- // if (!GetFileNameList(a_strFolderName, STD_LIB_EXT, listSTDFile))
|
|
|
- // {
|
|
|
-
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- // List<String> listSTDLibName = new List<string>();
|
|
|
- // listSTDLibName.Clear();
|
|
|
-
|
|
|
- // foreach (var file in listSTDFile)
|
|
|
- // {
|
|
|
- // //string fileName = file.Left(file.GetLength() - 3);
|
|
|
- // String fileName = file;
|
|
|
- // listSTDLibName.Add(fileName);
|
|
|
- // }
|
|
|
- // if (listSTDLibName.Count > 0)
|
|
|
- // {
|
|
|
- // listSTDLibName.Add("NoSTDDB");
|
|
|
- // }
|
|
|
- // if (a_nPos > (int)listSTDLibName.Count)
|
|
|
- // {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // String STDName = listSTDLibName[a_nPos];
|
|
|
-
|
|
|
- // // updata STD to working sample
|
|
|
- // COTSSample pSample = GetWorkingSample();
|
|
|
-
|
|
|
-
|
|
|
- // CMeasureParam pParam = pSample.GetMsrParams();
|
|
|
-
|
|
|
- // pParam.SetSTDName(STDName);
|
|
|
- // pSample.SetMsrParams(pParam);
|
|
|
-
|
|
|
- // return true;
|
|
|
-
|
|
|
- //}
|
|
|
+
|
|
|
|
|
|
// get measured sample list
|
|
|
public bool GetMsredSampleList(ref List<COTSSample> a_listMsredSample)
|
|
@@ -1488,9 +1332,6 @@ namespace OTSModelSharp
|
|
|
}
|
|
|
|
|
|
doc.Save(filename);
|
|
|
-
|
|
|
- //get the steel technology parameter
|
|
|
- STEEL_TECHNOLOGY steelTech = pMsrParam.GetSteelTechnology();
|
|
|
foreach (var fld in spl.GetFieldsData())
|
|
|
{
|
|
|
foreach (var part in fld.GetListAnalysisParticles())
|
|
@@ -1500,48 +1341,80 @@ namespace OTSModelSharp
|
|
|
part.SetTypeColor("#000000");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- var analysisparts = new List<COTSParticleClr>();
|
|
|
+ var analysisparts = new List<COTSParticleClr>();
|
|
|
var m_classifyEngine = new CClassifyEngine();
|
|
|
- foreach (var fld in spl.GetFieldsData())
|
|
|
+ if (SystemTypeId == OTS_SysType_ID.IncA)
|
|
|
{
|
|
|
- foreach (var part in fld.GetListAnalysisParticles())
|
|
|
+ //get the steel technology parameter
|
|
|
+ STEEL_TECHNOLOGY steelTech = pMsrParam.GetSteelTechnology();
|
|
|
+ if (spl.GetMsrParams().GetSysSTDSwitch())
|
|
|
{
|
|
|
- if (spl.GetMsrParams().GetSysSTDSwitch())
|
|
|
+ if (stdFileName != "NoSTDDB.db")
|
|
|
{
|
|
|
- if (stdFileName != "NoSTDDB.db")
|
|
|
- {
|
|
|
-
|
|
|
-
|
|
|
- IClassifyEngine partEngine = m_classifyEngine.GetParticleEngine(stdFileName);
|
|
|
|
|
|
- if (!partEngine.Classify(part))
|
|
|
+ foreach (var fld in spl.GetFieldsData())
|
|
|
+ {
|
|
|
+ foreach (var part in fld.GetListAnalysisParticles())
|
|
|
{
|
|
|
|
|
|
- NLog.LogManager.GetCurrentClassLogger().Error("1 failed to classify!"+ "Particle Engine");
|
|
|
+
|
|
|
+
|
|
|
+ IClassifyEngine partEngine = m_classifyEngine.GetParticleEngine(stdFileName);
|
|
|
+
|
|
|
+ if (!partEngine.Classify(part))
|
|
|
+ {
|
|
|
+
|
|
|
+ NLog.LogManager.GetCurrentClassLogger().Error("1 failed to classify!" + "Particle Engine");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (part.GetType() == (int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED)
|
|
|
+ {
|
|
|
+
|
|
|
+ IClassifyEngine incAEngine = m_classifyEngine.GetIncClassifyEngine();
|
|
|
+ if (!incAEngine.ClassifyIncA(part, (int)steelTech))
|
|
|
+ {
|
|
|
+
|
|
|
+ NLog.LogManager.GetCurrentClassLogger().Error("2 failed to classify!" + "IncA Engine");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ analysisparts.AddRange(fld.GetListAnalysisParticles());
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
|
|
|
- if (part.GetType() == (int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED)
|
|
|
+ if (stdFileName != "NoSTDDB.db")
|
|
|
+ {
|
|
|
+ foreach (var fld in spl.GetFieldsData())
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- IClassifyEngine incAEngine = m_classifyEngine.GetIncClassifyEngine();
|
|
|
- if (!incAEngine.ClassifyIncA(part, (int)steelTech))
|
|
|
+ foreach (var part in fld.GetListAnalysisParticles())
|
|
|
{
|
|
|
+ IClassifyEngine engine = m_classifyEngine.GetParticleEngine(stdFileName);
|
|
|
+ if (!engine.Classify(part))
|
|
|
+ {
|
|
|
|
|
|
- NLog.LogManager.GetCurrentClassLogger().Error("2 failed to classify!" + "IncA Engine");
|
|
|
+ NLog.LogManager.GetCurrentClassLogger().Error("3 failed to classify!" + "Particle Engine");
|
|
|
+ }
|
|
|
}
|
|
|
+ analysisparts.AddRange(fld.GetListAnalysisParticles());
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (SystemTypeId == OTS_SysType_ID.CleannessA)
|
|
|
+ {
|
|
|
+ if (stdFileName != "NoSTDDB.db")
|
|
|
+ {
|
|
|
+ foreach (var fld in spl.GetFieldsData())
|
|
|
{
|
|
|
-
|
|
|
- if (stdFileName != "NoSTDDB.db")
|
|
|
+ foreach (var part in fld.GetListAnalysisParticles())
|
|
|
{
|
|
|
-
|
|
|
IClassifyEngine engine = m_classifyEngine.GetParticleEngine(stdFileName);
|
|
|
if (!engine.Classify(part))
|
|
|
{
|
|
@@ -1549,15 +1422,11 @@ namespace OTSModelSharp
|
|
|
NLog.LogManager.GetCurrentClassLogger().Error("3 failed to classify!" + "Particle Engine");
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+ analysisparts.AddRange(fld.GetListAnalysisParticles());
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- analysisparts.AddRange(fld.GetListAnalysisParticles());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
string strFieldFileSubFolder = strFilePath + "\\" + spl.GetName() + "\\" + SMPL_MSR_RESULT_FIELDS_FILE_SUBFOLDER;
|
|
|
|
|
@@ -1620,7 +1489,7 @@ namespace OTSModelSharp
|
|
|
{
|
|
|
xProjMgrFileMark.AssignValue(0);
|
|
|
xProjMgrFileVersion.AssignValue("");
|
|
|
- xSystype.AssignValue(m_systemTypeId.ToString());
|
|
|
+ xSystype.AssignValue(systemTypeId.ToString());
|
|
|
xstrPathName.AssignValue(m_strPathName);
|
|
|
xholeBSEImgs.Clear();
|
|
|
|
|
@@ -1645,11 +1514,11 @@ namespace OTSModelSharp
|
|
|
}
|
|
|
if(xSystype.value()== "IncA")
|
|
|
{
|
|
|
- m_systemTypeId = otsdataconst.OTS_SysType_ID.IncA;
|
|
|
+ systemTypeId = otsdataconst.OTS_SysType_ID.IncA;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- m_systemTypeId = otsdataconst.OTS_SysType_ID.CleannessA;
|
|
|
+ systemTypeId = otsdataconst.OTS_SysType_ID.CleannessA;
|
|
|
}
|
|
|
}
|
|
|
|