Explorar el Código

add lowcounts condition when do classification

gsp hace 1 año
padre
commit
966f2731a1

+ 1 - 1
OTSCPP/OTSClassifyEngine/ExpressionParseEngine/ParticleSTDTable.cpp

@@ -100,7 +100,7 @@ namespace OTSClassifyEngine
 		myTable->AddColumn(std::make_pair(_T("BSE"), ColumnType::ID::INT));
 		myTable->AddColumn(std::make_pair(_T("Formula"), ColumnType::ID::STRING));
 		myTable->AddColumn(std::make_pair(_T("Element"), ColumnType::ID::STRING));
-		myTable->AddColumn(std::make_pair(_T("IsElementAnalysis"), ColumnType::ID::INT));
+		myTable->AddColumn(std::make_pair(_T("IfElementAnalysis"), ColumnType::ID::INT));
 		myTable->AddColumn(std::make_pair(_T("ListNum"), ColumnType::ID::INT));
 		myTable->AddColumn(std::make_pair(_T("GroupId"), ColumnType::ID::INT));
 

+ 4 - 2
OTSCPP/OTSSQLiteDll/SQLiteDB.cpp

@@ -85,9 +85,11 @@ namespace OTSSQLITE
 		}
 
 		// do the table related valid checking
-		if (query->GetColCount() != tableInfoPtr->GetColumnCount())
+		auto cols1 = query->GetColCount();
+		auto cols2 = tableInfoPtr->GetColumnCount();
+		if (cols1!=cols2)
 		{
-			LogErrorTrace(__FILE__, __LINE__, _T("Invalid table columns(%d): should be %d"), query->GetColCount(), tableInfoPtr->GetColumnCount());
+			LogErrorTrace(__FILE__, __LINE__, _T(sTableName+":Invalid table columns(%d): should be %d"), query->GetColCount(), tableInfoPtr->GetColumnCount());
 		}
 
 		return query;

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -483,7 +483,7 @@ namespace OTSModelSharp
             if (pXRayParam.GetUsingXray() == true)
             {
                 var thecount = particle.GetXray().GetTotalCount();
-                var expect = m_EDSController.GetExpectCount();
+                var expect = pXRayParam.GetAnalyExpCount();
 
 
                 if (thecount < expect)

+ 38 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/ParamData/COTSMsrPrjResultData.cs

@@ -1336,6 +1336,7 @@ namespace OTSModelSharp
                 {
                     foreach (var part in fld.GetListAnalysisParticles())
                     {
+                        
                         part.SetType((int)OTS_PARTICLE_TYPE.NOT_IDENTIFIED);
                         part.SetTypeName("Not Identified");
                         part.SetTypeColor("#000000");
@@ -1360,7 +1361,11 @@ namespace OTSModelSharp
 
 
                                     IClassifyEngine partEngine = m_classifyEngine.GetExpressionClassifyEngine(stdFileName);
-
+                                    if (IsLowCounts(part))
+                                    {
+                                        continue;
+                                    
+                                    }
                                     if (!partEngine.ClassifyByExpression(part))
                                     {
 
@@ -1394,6 +1399,11 @@ namespace OTSModelSharp
                             {
                                 foreach (var part in fld.GetListAnalysisParticles())
                                 {
+                                    if (IsLowCounts(part))
+                                    {
+                                        continue;
+
+                                    }
                                     IClassifyEngine engine = m_classifyEngine.GetExpressionClassifyEngine(stdFileName);
                                     if (!engine.ClassifyByExpression(part))
                                     {
@@ -1415,6 +1425,11 @@ namespace OTSModelSharp
                         {
                             foreach (var part in fld.GetListAnalysisParticles())
                             {
+                                if (IsLowCounts(part))
+                                {
+                                    continue;
+
+                                }
                                 IClassifyEngine engine = m_classifyEngine.GetExpressionClassifyEngine(stdFileName);
                                 if (!engine.ClassifyByExpression(part))
                                 {
@@ -1446,6 +1461,28 @@ namespace OTSModelSharp
 
         }
 
+        private bool IsLowCounts(COTSParticleClr particle)
+        {
+            COTSXRayParam pXRayParam = this.GetWorkingSample().GetMsrParams().GetXRayParam();
+
+            if (pXRayParam.GetUsingXray() == true)
+            {
+                var thecount = particle.GetXray().GetTotalCount();
+                var expect = pXRayParam.GetAnalyExpCount();
+
+
+                if (thecount < expect)
+                {
+
+                    particle.SetType((int)OTS_PARTICLE_TYPE.LOW_COUNT);//4 represent "lowcount"
+                    particle.SetTypeColor("#000000");
+                    particle.SetTypeName("LowCounts");
+                    return true;
+                }
+            }
+            return false;
+        }
+
 
 
         /// <summary>