Browse Source

add engine type switch function

gsp 10 months ago
parent
commit
9e82224bdb

+ 2 - 2
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="IncA">
-  <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="fire-resistant_2" SteelTechnology="0" UseSysSTD="true" />
+  <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" EngineType="2:InclutionPlusExpressionParse" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="fire-resistant_2" SteelTechnology="0" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="3:WaterShed" MatrixStep="50" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="50" start="0" />
-    <Member RegName="IncArea" end="2000" start="15" />
+    <Member RegName="IncArea" end="2000" start="20" />
     <Member RegName="ParticleGray" end="255" start="0" />
   </Member>
   <Member RegName="ImageScanParam" ImageResolution="4:_1536_1024" SatrtImageMode="1:Snake" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="100" StopParamMeasTime="360" StopParamParticles="5000" />

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/ResourceForMeasureSourceGrid-ZH.xml

@@ -9,7 +9,7 @@
 			<member itemKey="20004" itemName="" itemText="分析标准库" description="选择颗粒分析标准库。"/>
 			<member itemKey="20005" itemName="" itemText="滤膜类型" comboContent="" description="选择滤膜类型"/>
 			<member itemKey="20006" itemName="" itemText="精炼工艺" comboContent="通用方法,钙处理,镁处理,稀土处理" />
-			<member itemKey="20008" itemName="" itemText="使用系统库开关"/>
+			<member itemKey="20008" itemName="" itemText="分类引擎" comboContent="系统分类,自定义分类,自定义+系统,谱峰匹配"/>
 			<member itemKey="20076" itemName="" itemText="spare"/>
 			<member itemKey="20077" itemName="" itemText="spare"/>
 			<member itemKey="20078" itemName="" itemText="spare"/>

+ 43 - 27
OTSCPP/OTSClassifyEngine/ExpressionClassifyEngine.cpp

@@ -61,10 +61,9 @@ bool ExpressionClassifyEngine::ClassifyExpression(COTSParticlePtr particle, CPos
 		}
 
 		PartSTDRuleItemList ruleItems = m_std->GetSTDRuleItems();
-
+		std::vector<PartSTDRuleItemPtr> matchedItems;
 		for (auto itm : ruleItems)
 		{
-			
 			//if the element quantity is not match the std item's keyelement num than they are unmatching.
 			if (partEles.size() < itm->GetKeyElementList().size())
 			{
@@ -103,38 +102,55 @@ bool ExpressionClassifyEngine::ClassifyExpression(COTSParticlePtr particle, CPos
 			if (rst)
 			{
 				
-				particle->SetType(OTS_PARTICLE_TYPE::IDENTIFIED);
-				particle->SetClassifyId(itm->GetID());
-				particle->SetColor(itm->GetColor());
-				particle->SetClassifyName(itm->GetName());
-				particle->SetHardness(itm->GetHardness());
-				particle->SetDensity(itm->GetDensity());
-				particle->SetConductivity(itm->GetElectrical_conductivity());
-
-				particle->SetGroupId(itm->GetGrpID());
-				particle->SetGroupColor(itm->GetGrpColor());
-				particle->SetGroupName(itm->GetGrpName());
-
-				//if this item is a spectrum compared item then we should memory these spectrum to be used when doing spectrum compare.
+				matchedItems.push_back(itm);
+			}
+			else
+			{
+				continue;
+			}
+			
+		}
+		if (matchedItems.size() > 0)
+		{
+			auto matchedItem = matchedItems[0];
+			for (auto itm : matchedItems)
+			{
 
-				if (itm->GetIsElementAnalysis() == false)
+				if (itm->GetExpressionStr().size() > matchedItem->GetExpressionStr().size())
 				{
-
-					itm->AddXraySpectrum(particle->GetXrayInfo());
+					matchedItem = itm;
 				}
-				return true;
+				
 			}
-			else
+			particle->SetType(OTS_PARTICLE_TYPE::IDENTIFIED);
+			particle->SetClassifyId(matchedItem->GetID());
+			particle->SetColor(matchedItem->GetColor());
+			particle->SetClassifyName(matchedItem->GetName());
+			particle->SetHardness(matchedItem->GetHardness());
+			particle->SetDensity(matchedItem->GetDensity());
+			particle->SetConductivity(matchedItem->GetElectrical_conductivity());
+			particle->SetGroupId(matchedItem->GetGrpID());
+			particle->SetGroupColor(matchedItem->GetGrpColor());
+			particle->SetGroupName(matchedItem->GetGrpName());
+			if (matchedItem->GetIsElementAnalysis() == false)
 			{
-				continue;
+
+				matchedItem->AddXraySpectrum(particle->GetXrayInfo());
 			}
+			
+			
 		}
-		particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
-		particle->SetClassifyName("Not Identified");
-		particle->SetColor("#000000");
-		particle->SetGroupId((int)OTS_PARTCLE_TYPE::NOT_IDENTIFIED);
-		particle->SetGroupName("Not Identified");
-		particle->SetGroupColor("#000000");
+		else
+		{
+			particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
+			particle->SetClassifyName("Not Identified");
+			particle->SetColor("#000000");
+			particle->SetGroupId((int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
+			particle->SetGroupName("Not Identified");
+			particle->SetGroupColor("#000000");
+		}
+
+		
 		return true;
 	}
 	else if(particle != nullptr && xray == nullptr)//process particle without xray data

+ 4 - 4
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSXRayParam.cs

@@ -36,9 +36,7 @@ namespace OTSDataType
         private int m_nSmallPartXrayTime;
 
         private bool m_nUsingXray;
-        //private bool m_UseFilter;
        
-        //private int m_nFastXrayTime;
         private int m_XrayLimit;
 
         private string m_analysisElements;
@@ -55,7 +53,7 @@ namespace OTSDataType
 
             m_nMidAnalyAQTime = DEFAULE_XRAY_ANALY_MID_TIME;
             m_nQutantifyMinSize = DEFAULE_XRAY_QUANTIFY_MINSIZE;
-            //m_nFastXrayTime = DEFAULE_FASTXRAYTIME;
+          
             m_XrayLimit = Default_Xray_Limit;
             m_nQutantifyMinSize = DEFAULE_XRAY_QUANTIFY_MINSIZE;
             m_nSmallPartXrayTime = DEFAULE_FASTXRAYTIME;
@@ -177,7 +175,7 @@ namespace OTSDataType
 
             xString xknownelements = new xString();
             
-            //xBool xZeroElementProcess = new xBool();
+          
 
             Slo slo = new Slo();
 
@@ -250,6 +248,8 @@ namespace OTSDataType
                 //m_UseFilter = xnUseFilter.value();
 
                 m_XrayLimit = xXrayLimit.value();
+               
+                    
 
                 m_IfAutoId = xIfautoid.value();
 

+ 14 - 11
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CSampleParam.cs

@@ -12,7 +12,7 @@ namespace OTSDataType
     public class CSampleParam : ISlo
     {
         private string m_strName;
-        private bool m_bSysSTDSwitch;
+        private OTS_CLASSIFY_ENGINE_TYPE m_engineType;
         private string m_strSTDName;
         private COTSImgScanPrm m_poImageScanParam;
         private COTSImageProcParam m_poImageProcessParam;
@@ -51,7 +51,7 @@ namespace OTSDataType
         {
             // initialization
             m_strName = "MsrParam";
-            m_bSysSTDSwitch = true;
+            m_engineType = OTS_CLASSIFY_ENGINE_TYPE.InclutionPlusExpressionParse;
             m_strSTDName = "";
             m_poImageScanParam = new COTSImgScanPrm();
             m_poImageProcessParam = new COTSImageProcParam();
@@ -65,7 +65,7 @@ namespace OTSDataType
 
             // copy data over
             m_strName = a_oSource.m_strName;
-            m_bSysSTDSwitch = a_oSource.m_bSysSTDSwitch;
+            m_engineType = a_oSource.m_engineType;
             m_strSTDName = a_oSource.m_strSTDName;
             m_SteelTech = a_oSource.m_SteelTech;
             m_poImageScanParam = new COTSImgScanPrm(a_oSource.m_poImageScanParam);
@@ -87,19 +87,19 @@ namespace OTSDataType
                 m_poImageScanParam.Equals(a_oSource.m_poImageScanParam) &&
                 m_poImageProcessParam.Equals(a_oSource.m_poImageProcessParam) &&
                 m_poXRayParam.Equals(a_oSource.m_poXRayParam) &&
-                m_bSysSTDSwitch.Equals(a_oSource.m_bSysSTDSwitch);
+                m_engineType.Equals(a_oSource.m_engineType);
         }
 
         public override void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
         {
-            xBool xSysSTDSwitch = new xBool();
+            xString xEngineType = new xString();
             xString xstrName = new xString();
             xString xstrSTDName = new xString();
             xString xSystype = new xString();
             xInt xSteelTech = new xInt();
             Slo slo = new Slo();
 
-            slo.Register("UseSysSTD", xSysSTDSwitch);
+            slo.Register("EngineType", xEngineType);
             slo.Register("STDName", xstrSTDName);
             slo.Register("SteelTech", xSteelTech);
             slo.Register("SysType", xSystype);
@@ -109,7 +109,7 @@ namespace OTSDataType
 
             if (isStoring)
             {
-                xSysSTDSwitch.AssignValue(m_bSysSTDSwitch);
+                xEngineType.AssignValue((int)m_engineType+":"+m_engineType.ToString());
                 xstrName.AssignValue(m_strName);
                 xSteelTech.AssignValue((int)m_SteelTech);
                 xstrSTDName.AssignValue(m_strSTDName);
@@ -119,8 +119,11 @@ namespace OTSDataType
             else
             {
                 slo.Serialize(false, classDoc, rootNode);
-
-                m_bSysSTDSwitch = xSysSTDSwitch.value();
+                if (xEngineType.value().Split(':').Length > 1)
+                {
+                    m_engineType = (OTS_CLASSIFY_ENGINE_TYPE)Convert.ToInt32(xEngineType.value().Split(':')[0]);
+                }
+              
                 m_strName = xstrName.value();
                 m_strSTDName = xstrSTDName.value();
                 m_SteelTech = (STEEL_TECHNOLOGY)xSteelTech.value();
@@ -158,7 +161,7 @@ namespace OTSDataType
         public COTSImageProcParam GetImageProcessParam() { m_poImageProcessParam.SetSpecialGreyRangeParam(m_specialGrayRangeParam); return m_poImageProcessParam; }
         public COTSXRayParam GetXRayParam() { return m_poXRayParam; }
         // STDSwitch
-        public bool GetSysSTDSwitch() { return m_bSysSTDSwitch; }
-        public void SetSysSTDSwitch(bool a_bSysSTDSwitch) { m_bSysSTDSwitch = a_bSysSTDSwitch; }
+        public OTS_CLASSIFY_ENGINE_TYPE GetEngineType() { return m_engineType; }
+        public void SetEngineType(OTS_CLASSIFY_ENGINE_TYPE a_enginetype) { m_engineType = a_enginetype; }
     }
 }

+ 1 - 0
OTSIncAMeasureApp/0-OTSModel/OTSDataType/XMLSerialization.cs

@@ -502,6 +502,7 @@ namespace OTSDataType
                 }
                 else
                 {
+                   element.Value.getStringPtr("");
                     NLog.LogManager.GetCurrentClassLogger().Error("cann't find " + element.Key + " in config file!");
 
                 }

+ 18 - 3
OTSIncAMeasureApp/0-OTSModel/OTSDataType/otsdataconst.cs

@@ -200,6 +200,15 @@ namespace OTSDataType
 		    TCCleannessA = 1,
             BatteryCleannessA=2
 	    }
+
+        public enum OTS_CLASSIFY_ENGINE_TYPE
+        {
+            InclustionEngine = 0,
+            ExpressionParse = 1,
+            InclutionPlusExpressionParse = 2,
+            SpectrumMatch = 3
+        }
+        
         public enum OTS_Y_AXIS_DIRECTION
         {
             UP_TOWARD = 0,
@@ -265,9 +274,8 @@ namespace OTSDataType
         public enum OTS_GET_IMAGE_MODE
         {
             Spiral = 0,
-           Snake = 1,
-            Zshape = 2
-            //RANDOM = 3
+            Snake = 1,
+            Zshape = 2          
         }
 
 
@@ -289,6 +297,13 @@ namespace OTSDataType
             ExpandMode=2
           
         }
+        public enum OTS_X_RAY_QUANTIFY_MODE
+        {
+            Standard = 0,
+            AutoId = 1,
+            NoQuantify = 2
+
+        }
 
 
 

+ 17 - 2
OTSIncAMeasureApp/1-OTSMeasure/Measure/1-OTSInclution/SmplMeasureInclution.cs

@@ -59,7 +59,7 @@ namespace OTSModelSharp
 
             int steelTech = (int)m_Sample.GetMsrParams().GetSteelTechnology();
             particle.SetType((int)OTS_PARTICLE_TYPE.NOT_IDENTIFIED);
-            if (m_Sample.GetMsrParams().GetSysSTDSwitch())
+            if (m_Sample.GetMsrParams().GetEngineType()==OTS_CLASSIFY_ENGINE_TYPE.InclutionPlusExpressionParse)
             {
 
                 if (libname != "NoSTDDB")
@@ -78,7 +78,7 @@ namespace OTSModelSharp
                 }
 
             }
-            else
+            else if(m_Sample.GetMsrParams().GetEngineType() == OTS_CLASSIFY_ENGINE_TYPE.ExpressionParse)
             {
                 if (libname != "NoSTDDB")
                 {
@@ -88,6 +88,21 @@ namespace OTSModelSharp
 
                 }
             }
+            else if(m_Sample.GetMsrParams().GetEngineType() == OTS_CLASSIFY_ENGINE_TYPE.SpectrumMatch)
+            {
+                if (libname != "NoSTDDB")
+                {
+                    //var m_classifyEngine = new CClassifyEngine();
+                    IClassifyEngine engine = m_classifyEngine.GetSpectrumCompareEngine(libname);
+                    engine.ClassifyBySpectrum(particle);
+                }
+            }
+            else if(m_Sample.GetMsrParams().GetEngineType() == OTS_CLASSIFY_ENGINE_TYPE.InclustionEngine)
+            {
+                IClassifyEngine engine;
+                engine = m_classifyEngine.GetIncClassifyEngine();
+                engine.ClassifyIncA(particle, steelTech);
+            }
 
             return true;
         }

+ 47 - 20
OTSIncAMeasureApp/1-OTSMeasure/Measure/ParamData/COTSMsrPrjResultData.cs

@@ -997,7 +997,8 @@ namespace OTSModelSharp
                 {
                     //get the steel technology parameter
                     STEEL_TECHNOLOGY steelTech = pMsrParam.GetSteelTechnology();
-                    if (spl.GetMsrParams().GetSysSTDSwitch())
+
+                    if (spl.GetMsrParams().GetEngineType() == OTS_CLASSIFY_ENGINE_TYPE.InclutionPlusExpressionParse)
                     {
                         if (stdFileName != "NoSTDDB.db")
                         {
@@ -1034,7 +1035,13 @@ namespace OTSModelSharp
                                 analysisparts.AddRange(fld.GetListAnalysisParticles());
                             }
                         }
-                        else
+
+
+                    }
+                    else if (spl.GetMsrParams().GetEngineType() == OTS_CLASSIFY_ENGINE_TYPE.ExpressionParse)
+                    {
+
+                        if (stdFileName != "NoSTDDB.db")
                         {
                             foreach (var fld in spl.GetFieldsData())
                             {
@@ -1045,42 +1052,62 @@ namespace OTSModelSharp
                                         continue;
 
                                     }
-                                    IClassifyEngine incAEngine = m_classifyEngine.GetIncClassifyEngine();
-                                    if (!incAEngine.ClassifyIncA(part, (int)steelTech))
+                                    IClassifyEngine engine = m_classifyEngine.GetExpressionClassifyEngine(stdFileName);
+                                    if (!engine.ClassifyByExpression(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 (spl.GetMsrParams().GetEngineType() == OTS_CLASSIFY_ENGINE_TYPE.InclustionEngine)
                     {
+                        foreach (var fld in spl.GetFieldsData())
+                        {
+                            foreach (var part in fld.GetListAnalysisParticles())
+                            {
+                                if (IsLowCounts(part))
+                                {
+                                    continue;
 
-                        if (stdFileName != "NoSTDDB.db")
+                                }
+                                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 (spl.GetMsrParams().GetEngineType() == OTS_CLASSIFY_ENGINE_TYPE.SpectrumMatch)
+                    {
+                        foreach (var fld in spl.GetFieldsData())
                         {
-                            foreach (var fld in spl.GetFieldsData())
+                            foreach (var part in fld.GetListAnalysisParticles())
                             {
-                                foreach (var part in fld.GetListAnalysisParticles())
+                                if (IsLowCounts(part))
                                 {
-                                    if (IsLowCounts(part))
-                                    {
-                                        continue;
+                                    continue;
 
-                                    }
-                                    IClassifyEngine engine = m_classifyEngine.GetExpressionClassifyEngine(stdFileName);
-                                    if (!engine.ClassifyByExpression(part))
-                                    {
+                                }
+                                IClassifyEngine spectrumEng = m_classifyEngine.GetSpectrumCompareEngine(stdFileName);
+                                if (!spectrumEng.ClassifyBySpectrum(part))
+                                {
 
-                                        NLog.LogManager.GetCurrentClassLogger().Error("3 failed to classify!" + "Particle Engine");
-                                    }
+                                    NLog.LogManager.GetCurrentClassLogger().Error("2 failed to classify!" + "IncA Engine");
                                 }
-                                analysisparts.AddRange(fld.GetListAnalysisParticles());
                             }
+                            analysisparts.AddRange(fld.GetListAnalysisParticles());
                         }
+
                     }
 
                 }

+ 16 - 9
OTSIncAMeasureApp/1-OTSMeasure/Measure/ParamData/OTSGeneralParam.cs

@@ -5,6 +5,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Xml;
+using static OTSDataType.otsdataconst;
 
 namespace OTSModelSharp
 {
@@ -24,7 +25,7 @@ namespace OTSModelSharp
         string m_strSampleDescription;
         string m_strOperatorName;
         string m_strComment;
-        bool m_bSysSTD;
+        OTS_CLASSIFY_ENGINE_TYPE m_EngineType=OTS_CLASSIFY_ENGINE_TYPE.InclutionPlusExpressionParse;
         int m_steelTechnologyl;
         string m_sSTDSelect;
         otsdataconst.DOMAIN_SHAPE m_nDefaultShape;
@@ -191,8 +192,8 @@ namespace OTSModelSharp
             m_DefaultmembraneType = val;
         }
 
-        public bool GetSysSTD() { return m_bSysSTD; }
-        public void SetSysSTD(bool a_bSysSTD) { m_bSysSTD = a_bSysSTD; }
+        public OTS_CLASSIFY_ENGINE_TYPE GetEngineType() { return m_EngineType; }
+        public void SetEngineType(OTS_CLASSIFY_ENGINE_TYPE a_bSysSTD) { m_EngineType = a_bSysSTD; }
 
         public int GetSteelTechnology() { return m_steelTechnologyl; }
         public void SetSteelTechnology(int a_steelTechnology) { m_steelTechnologyl = a_steelTechnology; }
@@ -219,7 +220,7 @@ namespace OTSModelSharp
             m_strSampleDescription = ("");
             m_strOperatorName = ("");
             m_strComment = ("");
-            m_bSysSTD = false;
+            m_EngineType = OTS_CLASSIFY_ENGINE_TYPE.InclustionEngine;
             m_steelTechnologyl = 0;
             m_sSTDSelect = ("");
 
@@ -246,7 +247,7 @@ namespace OTSModelSharp
             m_strSampleDescription = a_oSource.m_strSampleDescription;
             m_strOperatorName = a_oSource.m_strOperatorName;
             m_strComment = a_oSource.m_strComment;
-            m_bSysSTD = a_oSource.m_bSysSTD;
+            m_EngineType = a_oSource.m_EngineType;
             m_steelTechnologyl = a_oSource.m_steelTechnologyl;
             m_sSTDSelect = a_oSource.m_sSTDSelect;
         }
@@ -261,7 +262,7 @@ namespace OTSModelSharp
             xInt xnStdLibTypeIndex = new xInt();
             xInt xnSteelTechnology = new xInt();
             xInt xnDefaultShape = new xInt();
-            xBool xbUseSysSTD = new xBool();
+            xString xEngineType = new xString();
             xDouble xbDefaultArea = new xDouble();
             xInt xnPropertyDisplayMode = new xInt();
             Slo slo = new Slo();
@@ -273,7 +274,7 @@ namespace OTSModelSharp
             slo.Register("StdLibFileName", xstrSTDSelect);
             slo.Register("SteelTechnology", xnSteelTechnology);
             slo.Register("DefaultShape", xnDefaultShape);
-            slo.Register("UseSysSTD", xbUseSysSTD);
+            slo.Register("EngineType", xEngineType);
             slo.Register("DefaultArea", xbDefaultArea);
             slo.Register("PropertyDisplayMode", xnPropertyDisplayMode);
 
@@ -287,7 +288,7 @@ namespace OTSModelSharp
               
                 xnSteelTechnology.AssignValue(m_steelTechnologyl);
                 xnDefaultShape.AssignValue((int)m_nDefaultShape);
-                xbUseSysSTD.AssignValue(m_bSysSTD);
+                xEngineType.AssignValue((int)m_EngineType+":"+m_EngineType.ToString());
                 xbDefaultArea.AssignValue(m_dDefaultArea);
                 xnPropertyDisplayMode.AssignValue(m_nPropertyDisplayMode);
 
@@ -305,7 +306,13 @@ namespace OTSModelSharp
               
                 m_steelTechnologyl = xnSteelTechnology.value();
                 m_nDefaultShape = (otsdataconst.DOMAIN_SHAPE)xnDefaultShape.value();
-                m_bSysSTD =Convert.ToBoolean(xbUseSysSTD.toString());
+                if (xEngineType.value().Split(':').Length > 1)
+                {
+                    m_EngineType = (OTS_CLASSIFY_ENGINE_TYPE)Convert.ToInt32(xEngineType.value().Split(':')[0]);
+                }
+                  
+                
+               
                 m_dDefaultArea = xbDefaultArea.value();
                 m_nPropertyDisplayMode= xnPropertyDisplayMode.value();
             }

+ 1 - 1
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -368,7 +368,7 @@ namespace OTSMeasureApp
             pSample.SetName(strNewSampleName);
             pSample.SetSampleHoleName(pHole.GetName());
             pSample.SetSwitch(m_pParam.GetMeasurementSwitch());
-            poMsrParams.SetSysSTDSwitch(m_pParam.GetSysSTD());
+            poMsrParams.SetEngineType(m_pParam.GetEngineType());
             pSample.SetMsrDomain(pMsrArea);
            
             pSample.SetMsrParams(poMsrParams);

+ 1 - 1
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSPropertyWindow.cs

@@ -351,7 +351,7 @@ namespace OTSMeasureApp
             m_cotsprogmgrparamfile.SetImageScanParam(WSample.GetMsrParams().GetImageScanParam());
             m_cotsprogmgrparamfile.SetXRayParam(WSample.GetMsrParams().GetXRayParam());
             OTSModelSharp.COTSGeneralParam m_cgenparam = m_cotsprogmgrparamfile.GetGenParam();
-            m_cgenparam.SetSysSTD(WSample.GetMsrParams().GetSysSTDSwitch());
+            m_cgenparam.SetEngineType(WSample.GetMsrParams().GetEngineType());
             m_cgenparam.SetSteelTechnology((int)WSample.GetMsrParams().GetSteelTechnology());
             m_cgenparam.SetSTDSelect(WSample.GetMsrParams().GetSTDName().ToString());
             m_cotsprogmgrparamfile.SetGenParam(m_cgenparam);

+ 34 - 28
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSSampleVisualPropertyInfo.cs

@@ -148,11 +148,7 @@ namespace OTSMeasureApp
                         a_bValue = m_Sample.GetSwitch() ;
                     }
                     break;
-                case (int)OTS_SAMPLE_PROP_GRID_ITEMS.SYS_STD_SWITCH:
-                    {
-                        a_bValue = m_poMsrParams.GetSysSTDSwitch();
-                    }
-                    break;
+               
                 case (int)OTS_SAMPLE_PROP_GRID_ITEMS.USING_XRAY:
                     {
                         a_bValue = m_poMsrParams.GetXRayParam().GetUsingXray();
@@ -304,9 +300,9 @@ namespace OTSMeasureApp
                         m_Sample.SetSwitch((bool)objVal);
                     }
                     break;
-                case OTS_SAMPLE_PROP_GRID_ITEMS.SYS_STD_SWITCH:
+                case OTS_SAMPLE_PROP_GRID_ITEMS.ENGINE_SWITCH:
                     {
-                        m_poMsrParams.SetSysSTDSwitch((bool)objVal);
+                        m_poMsrParams.SetEngineType((OTS_CLASSIFY_ENGINE_TYPE)objVal);
                     }
                     break;
                 case OTS_SAMPLE_PROP_GRID_ITEMS.USING_XRAY:
@@ -886,33 +882,38 @@ namespace OTSMeasureApp
                             poPropItem = new CPropItem();
                             nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.SWITCH;
                             poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BOOL, false, bShow);
+                         
                             a_listPropItems.Add(poPropItem);
 
-                            // system STD
-                            poPropItem = new CPropItem();
-                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.SYS_STD_SWITCH;
-                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BOOL, false, bShow);
-                            a_listPropItems.Add(poPropItem);
-
-
-
-                            // STD file name
+                            // engine switch
                             poPropItem = new CPropItem();
-                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STD_FILE_NAME;
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.ENGINE_SWITCH;
                             poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
-                            int val = 0;
-                            List<string> comboDownlist = new List<string>();
-                            GetSTDFileList(ref val, ref comboDownlist);
-                            poPropItem.comboDownList = comboDownlist;
-                            poPropItem.SetItemVal(val);
                             a_listPropItems.Add(poPropItem);
-                          
 
-                            // Steel technology
-                            poPropItem = new CPropItem();
-                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STEEL_TECHNOLOGY;
-                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
-                            a_listPropItems.Add(poPropItem);
+                            var engineType = m_poMsrParams.GetEngineType();
+                            if (engineType == OTS_CLASSIFY_ENGINE_TYPE.InclutionPlusExpressionParse || engineType == OTS_CLASSIFY_ENGINE_TYPE.ExpressionParse
+                                || engineType==OTS_CLASSIFY_ENGINE_TYPE.SpectrumMatch)
+                            {
+                                // STD file name
+                                poPropItem = new CPropItem();
+                                nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STD_FILE_NAME;
+                                poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                                int val = 0;
+                                List<string> comboDownlist = new List<string>();
+                                GetSTDFileList(ref val, ref comboDownlist);
+                                poPropItem.comboDownList = comboDownlist;
+                                poPropItem.SetItemVal(val);
+                                a_listPropItems.Add(poPropItem);
+                            }
+                            if (engineType == OTS_CLASSIFY_ENGINE_TYPE.InclutionPlusExpressionParse || engineType == OTS_CLASSIFY_ENGINE_TYPE.InclustionEngine)
+                            {
+                                // Steel technology
+                                poPropItem = new CPropItem();
+                                nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STEEL_TECHNOLOGY;
+                                poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                                a_listPropItems.Add(poPropItem);
+                            }
                         }
                         break;
 
@@ -2322,6 +2323,11 @@ namespace OTSMeasureApp
                         a_nValue = val;
                     }
                     break;
+                case OTS_SAMPLE_PROP_GRID_ITEMS.ENGINE_SWITCH:
+                    {
+                        a_nValue =(int) m_poMsrParams.GetEngineType();
+                    }
+                    break;
                 default:
                     {
                         // something wrong, return false

+ 22 - 5
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -101,6 +101,19 @@ namespace OTSMeasureApp
 
 
             //初始化选项,下拉框---------------------------------------------
+            //classify engine type
+            comboEngineType.Items.Clear();
+            foreach (otsdataconst.OTS_CLASSIFY_ENGINE_TYPE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_CLASSIFY_ENGINE_TYPE)))
+            {
+                ComboBoxItem cbi = new ComboBoxItem();
+                cbi.Text = enum_one.ToString();
+                cbi.Value = (int)enum_one;
+                comboEngineType.Items.Add(cbi);
+            }
+            this.comboEngineType.SelectedIndexChanged -= new System.EventHandler(this.comboEngineType_SelectedIndexChanged);
+            if (comboEngineType.Items.Count > 0)
+                comboEngineType.SelectedIndex = 0;
+            this.comboEngineType.SelectedIndexChanged += new System.EventHandler(this.comboEngineType_SelectedIndexChanged);
 
             //绑定标准库
             IDC_COMBO_STDSelect.Items.Clear();
@@ -288,7 +301,12 @@ namespace OTSMeasureApp
             this.IDC_COMBO_Model.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_Model_SelectedIndexChanged);
             
         }
-       
+
+        private void comboEngineType_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            ThisSetIsModify();
+        }
+
         public CStage GetWorkingStage()
         {
 
@@ -467,7 +485,7 @@ namespace OTSMeasureApp
             //执行开关
             IDC_MEAS_SWITCH.Checked = m_cgenparam.GetMeasurementSwitch();
             //是否使用系统库开关
-            IDC_SYS_LIB.Checked = m_cgenparam.GetSysSTD();
+            comboEngineType.SelectedIndex = (int)m_cgenparam.GetEngineType();
            
             //精炼工艺选项
             foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
@@ -537,8 +555,7 @@ namespace OTSMeasureApp
             IDC_EDIT_PARTMIN.Text = m_cotsimgprocprm.GetParticleGray().GetStart().ToString();
             //颗粒灰度范围 最大
             IDC_EDIT_PARTMAX.Text = m_cotsimgprocprm.GetParticleGray().GetEnd().ToString();
-            //腐蚀膨胀系数
-            //IDC_COMBO_CorrosionExpansionCoefficient.Text = m_cotsimgprocprm.GetErrodDilateParam().ToString();
+        
             //重叠尺寸
             IDC_EDIT_Overlap.Text = m_cotsimgprocprm.GetOverlapParam().ToString();
 
@@ -706,7 +723,7 @@ namespace OTSMeasureApp
             m_cgenparam.SetMeasurementSwitch(IDC_MEAS_SWITCH.Checked);
 
             //是否使用系统库
-            m_cgenparam.SetSysSTD(IDC_SYS_LIB.Checked);
+            m_cgenparam.SetEngineType((OTS_CLASSIFY_ENGINE_TYPE)comboEngineType.SelectedIndex);
 
             //获取精炼工艺索引
             ComboBoxItem cbiTECH = new ComboBoxItem();

+ 15 - 16
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.designer.cs

@@ -65,7 +65,6 @@
             this.label7 = new System.Windows.Forms.Label();
             this.groupBox4 = new System.Windows.Forms.GroupBox();
             this.IDC_COMBO_STDSelect = new System.Windows.Forms.ComboBox();
-            this.IDC_SYS_LIB = new System.Windows.Forms.CheckBox();
             this.label17 = new System.Windows.Forms.Label();
             this.tBMeasArea = new System.Windows.Forms.TextBox();
             this.cBMeasShape = new System.Windows.Forms.ComboBox();
@@ -135,6 +134,7 @@
             this.IDC_COMBO_Model = new System.Windows.Forms.ComboBox();
             this.groupBox7 = new System.Windows.Forms.GroupBox();
             this.btncancel = new System.Windows.Forms.Button();
+            this.comboEngineType = new System.Windows.Forms.ComboBox();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -547,8 +547,8 @@
             // 
             // groupBox4
             // 
+            this.groupBox4.Controls.Add(this.comboEngineType);
             this.groupBox4.Controls.Add(this.IDC_COMBO_STDSelect);
-            this.groupBox4.Controls.Add(this.IDC_SYS_LIB);
             this.groupBox4.Controls.Add(this.label17);
             this.groupBox4.Controls.Add(this.tBMeasArea);
             this.groupBox4.Controls.Add(this.cBMeasShape);
@@ -582,26 +582,15 @@
             this.IDC_COMBO_STDSelect.TabIndex = 821;
             this.IDC_COMBO_STDSelect.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STDSelect_SelectedIndexChanged);
             // 
-            // IDC_SYS_LIB
-            // 
-            this.IDC_SYS_LIB.AutoSize = true;
-            this.IDC_SYS_LIB.Location = new System.Drawing.Point(122, 80);
-            this.IDC_SYS_LIB.Margin = new System.Windows.Forms.Padding(2);
-            this.IDC_SYS_LIB.Name = "IDC_SYS_LIB";
-            this.IDC_SYS_LIB.Size = new System.Drawing.Size(15, 14);
-            this.IDC_SYS_LIB.TabIndex = 538;
-            this.IDC_SYS_LIB.UseVisualStyleBackColor = true;
-            this.IDC_SYS_LIB.CheckedChanged += new System.EventHandler(this.IDC_SYS_LIB_CheckedChanged);
-            // 
             // label17
             // 
             this.label17.AutoSize = true;
             this.label17.Location = new System.Drawing.Point(6, 80);
             this.label17.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(89, 12);
+            this.label17.Size = new System.Drawing.Size(53, 12);
             this.label17.TabIndex = 537;
-            this.label17.Text = "使用系统库开关";
+            this.label17.Text = "分类引擎";
             // 
             // tBMeasArea
             // 
@@ -1337,6 +1326,16 @@
             this.btncancel.UseVisualStyleBackColor = true;
             this.btncancel.Click += new System.EventHandler(this.btncancel_Click);
             // 
+            // comboEngineType
+            // 
+            this.comboEngineType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboEngineType.FormattingEnabled = true;
+            this.comboEngineType.Location = new System.Drawing.Point(117, 74);
+            this.comboEngineType.Margin = new System.Windows.Forms.Padding(2);
+            this.comboEngineType.Name = "comboEngineType";
+            this.comboEngineType.Size = new System.Drawing.Size(137, 20);
+            this.comboEngineType.TabIndex = 822;
+            // 
             // ProgMgrInfoForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1451,7 +1450,6 @@
         public System.Windows.Forms.ComboBox cBMeasShape;
         private System.Windows.Forms.Label lbArea;
         public System.Windows.Forms.Button IDC_BUTTON_KLFX;
-        public System.Windows.Forms.CheckBox IDC_SYS_LIB;
         private System.Windows.Forms.Label label17;
         public System.Windows.Forms.ComboBox IDC_COMBO_STDSelect;
         private System.Windows.Forms.Label label44;
@@ -1490,5 +1488,6 @@
         private System.Windows.Forms.RadioButton radioButton1;
         private System.Windows.Forms.Label label18;
         private System.Windows.Forms.Label tb_xsys;
+        public System.Windows.Forms.ComboBox comboEngineType;
     }
 }

+ 1 - 1
OTSIncAMeasureApp/ResourceManage/ResourceData.cs

@@ -29,7 +29,7 @@ namespace OTSModelSharp.ResourceManage
         MEMBRANE_TYPE = 20005,
         STEEL_TECHNOLOGY = 20006,
      
-        SYS_STD_SWITCH = 20008,
+        ENGINE_SWITCH = 20008,
        
        
         START_PHOTO_MODE = 20010,