Browse Source

Merge branch 'Release2.3' of http://36.129.163.148:10080/gaoshipeng/OTS2_0 into Release2.3

zhangjiaxin 3 years ago
parent
commit
06b2d5fb79

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSStage.stg

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="3">
+<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="1">
   <Collection RegName="Stagelist">
   <Collection RegName="Stagelist">
     <Member strName="圆形九圆孔50mm">
     <Member strName="圆形九圆孔50mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0" />
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0" />

+ 2 - 0
OTSCPP/OTSClassifyEngine/InclutionClassifyEngine.cpp

@@ -47,6 +47,7 @@ bool InclutionClassifyEngine::Classify(COTSParticlePtr particle, int SteelTech,
 		particle->SetType(OTS_PARTICLE_TYPE::INVALID);
 		particle->SetType(OTS_PARTICLE_TYPE::INVALID);
 		particle->TypeName("Invalid");
 		particle->TypeName("Invalid");
 		particle->TypeColor("#000000");
 		particle->TypeColor("#000000");
+		particle->SetClassifyId(Id);
 		particle->SetGroupId(grpId);
 		particle->SetGroupId(grpId);
 		std::string grpName;
 		std::string grpName;
 		std::string grpColor;
 		std::string grpColor;
@@ -60,6 +61,7 @@ bool InclutionClassifyEngine::Classify(COTSParticlePtr particle, int SteelTech,
 		particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
 		particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
 		particle->TypeName("Not Identified");
 		particle->TypeName("Not Identified");
 		particle->TypeColor("#000000");
 		particle->TypeColor("#000000");
+		particle->SetClassifyId((int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
 		particle->SetGroupId(grpId);
 		particle->SetGroupId(grpId);
 		std::string grpName;
 		std::string grpName;
 		std::string grpColor;
 		std::string grpColor;

+ 10 - 3
OTSCPP/OTSClassifyEngine/InclutionEngine/OTSClassifyEng.cpp

@@ -37,8 +37,8 @@ namespace OTSClassifyEngine
 		double dMolarSum = 0.0f;
 		double dMolarSum = 0.0f;
 		double dMolarSumNoFe = 0.0f;
 		double dMolarSumNoFe = 0.0f;
 		OTS_PARTICLE_TYPE incId;
 		OTS_PARTICLE_TYPE incId;
-		NOT_INCLUTION_ID notIncId;
-		if (!IsAnValidIncXRay(a_listElementChemistries, listElChemsInc, listElChemsIncNoFe, dMolarSum, dMolarSumNoFe, incId, notIncId))
+		NOT_INCLUTION_ID notAIncId;// is not an inc but we can identify
+		if (!IsAnValidIncXRay(a_listElementChemistries, listElChemsInc, listElChemsIncNoFe, dMolarSum, dMolarSumNoFe, incId, notAIncId))
 		{
 		{
 		
 		
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::failed to call IsAnValidIncXRay"));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::failed to call IsAnValidIncXRay"));
@@ -47,7 +47,7 @@ namespace OTSClassifyEngine
 		}
 		}
 		if (incId == OTS_PARTCLE_TYPE::ISNOT_INCLUTION)// this is not an inclution particle,but we can identify.
 		if (incId == OTS_PARTCLE_TYPE::ISNOT_INCLUTION)// this is not an inclution particle,but we can identify.
 		{
 		{
-			a_nIncId =(int) notIncId;
+			a_nIncId =(int) notAIncId;
 			a_GrpId = (int)OTS_PARTCLE_TYPE::ISNOT_INCLUTION;
 			a_GrpId = (int)OTS_PARTCLE_TYPE::ISNOT_INCLUTION;
 			return TRUE;
 			return TRUE;
 
 
@@ -2094,6 +2094,13 @@ namespace OTSClassifyEngine
 		if (dKeyElMolar100 > ALUMINAT_KEY_ELEMENT_MOLAR_TOTAL_MIN && dKeyElMolar100 < ALUMINAT_KEY_ELEMENT_MOLAR_TOTAL_MAX)
 		if (dKeyElMolar100 > ALUMINAT_KEY_ELEMENT_MOLAR_TOTAL_MIN && dKeyElMolar100 < ALUMINAT_KEY_ELEMENT_MOLAR_TOTAL_MAX)
 		{
 		{
 			CElementChemistryPtr pKeyElChem2 = GetNamedElementChemistry(a_listElChems, ALUMINATE_KEY_ELEMENT_NAME[1]);
 			CElementChemistryPtr pKeyElChem2 = GetNamedElementChemistry(a_listElChems, ALUMINATE_KEY_ELEMENT_NAME[1]);
+
+			if (!pKeyElChem2)
+			{
+				strName = ALUMINATE_STR;
+				return TRUE;
+			}
+
 			double dFirstElMolar = pKeyElChem->GetMolarPercentage();//Al
 			double dFirstElMolar = pKeyElChem->GetMolarPercentage();//Al
 			double dSecondElMolar = pKeyElChem2->GetMolarPercentage();//Ca
 			double dSecondElMolar = pKeyElChem2->GetMolarPercentage();//Ca
 			double dRatio = dFirstElMolar/dSecondElMolar ;// Al/Ca
 			double dRatio = dFirstElMolar/dSecondElMolar ;// Al/Ca

+ 13 - 3
OTSCPP/OTSClassifyEngine/ParticleClassifyEngine.cpp

@@ -59,9 +59,9 @@ bool ParticleClassifyEngine::Classify(COTSParticlePtr particle, CPosXrayPtr xray
 		}
 		}
 		LogTrace(__FILE__, __LINE__, allele.c_str());*/
 		LogTrace(__FILE__, __LINE__, allele.c_str());*/
 		//-----------------------------
 		//-----------------------------
-		//zero element process,if satisfied the condition than erase the element from the list.
+		//zero element process,if satisfied the condition than set the particular element percentage to 0.and make it 100% of all the element percentage.
 
 
-		auto partEles = ZeroElementProcess(particle, xray);//auto partEles = xray->GetElementQuantifyData();
+		auto partEles = ZeroElementProcess(particle, xray);//
 
 
 
 
 		std::map<std::string, CElementChemistryPtr> mapChemistrys;
 		std::map<std::string, CElementChemistryPtr> mapChemistrys;
@@ -500,7 +500,17 @@ CElementChemistriesList ParticleClassifyEngine::ZeroElementProcess(COTSParticleP
 		auto newChe = CElementChemistryPtr(new CElementChemistry(che.get()));
 		auto newChe = CElementChemistryPtr(new CElementChemistry(che.get()));
 		partEles.push_back(newChe);
 		partEles.push_back(newChe);
 	}
 	}
-
+	//make it 100% in total.
+	double rawPercentage = 0;
+	for (auto ele : partEles)
+	{
+		rawPercentage += ele->GetPercentage();
+	}
+	for (auto ele : partEles)
+	{
+		ele->SetPercentage(ele->GetPercentage() / rawPercentage * 100);
+	}
+	//zero element process
 	std::map<CString, CElementChemistryPtr> mapChe;
 	std::map<CString, CElementChemistryPtr> mapChe;
 	for (auto ch : partEles)
 	for (auto ch : partEles)
 	{
 	{

+ 9 - 1
OTSCPP/OTSClrInterface/ClassificationClr/OTSClassifyEngineClr.cpp

@@ -40,7 +40,15 @@ namespace OTSCLRINTERFACE {
 	{
 	{
 		auto part = particle->GetOTSParticlePtr();
 		auto part = particle->GetOTSParticlePtr();
 		auto xraydata = part->GetXrayInfo();
 		auto xraydata = part->GetXrayInfo();
-		return engine->Classify(part, xraydata);
+		if (xraydata != nullptr)
+		{
+			return engine->Classify(part, xraydata);
+		}
+		else
+		{
+			return false;
+		}
+		
 		
 		
 	}
 	}
 
 

+ 10 - 1
OTSCPP/OTSClrInterface/CommonClr/OTSParticleClr.cpp

@@ -239,7 +239,16 @@ namespace OTSCLRINTERFACE {
 
 
 	CPosXrayClr^ COTSParticleClr::GetXray()
 	CPosXrayClr^ COTSParticleClr::GetXray()
 	{
 	{
-		return gcnew CPosXrayClr(m_Particle->get()->GetXrayInfo());
+		auto xray = m_Particle->get()->GetXrayInfo();
+		if (xray != nullptr)
+		{
+			return gcnew CPosXrayClr(m_Particle->get()->GetXrayInfo());
+		}
+		else
+		{
+			return gcnew CPosXrayClr();
+		}
+		
 	}
 	}
 
 
 	int COTSParticleClr::GetTagId()
 	int COTSParticleClr::GetTagId()

+ 10 - 15
OTSIncAMeasureApp/0-OTSModel/Measure/2-OTSCleanliness/SmplMeasureCleanliness.cs

@@ -288,33 +288,28 @@ namespace OTSModelSharp
         }
         }
         public override void ClassifyMergedParticles(List<COTSParticleClr> mergedParts)
         public override void ClassifyMergedParticles(List<COTSParticleClr> mergedParts)
         {
         {
+           
             try
             try
             {
             {
-                try
-                {
                    
                    
-                    string libname = m_Sample.GetMsrParams().GetSTDName();
-                    if (libname != "NoSTDDB")
-                    {
-                        log.Info("Begin to classify big particles!Using " + libname);
-                        var bigparts = mergedParts;
-                        ClassifyQuantifyParticles(bigparts, libname);
+                string libname = m_Sample.GetMsrParams().GetSTDName();
+                if (libname != "NoSTDDB")
+                {
+                    log.Info("Begin to classify big particles!Using " + libname);
+                    var bigparts = mergedParts;
+                    ClassifyQuantifyParticles(bigparts, libname);
                        
                        
                      
                      
 
 
-                    }
                 }
                 }
-                catch (Exception e)
-                {
-                    log.Info("calcu the particle image property or classify failed. " + e.Message);
-                }
-
             }
             }
             catch (Exception e)
             catch (Exception e)
             {
             {
-                log.Info(" classify failed. " + e.Message);
+                log.Info("calcu the particle image property or classify failed. " + e.Message);
             }
             }
 
 
+        
+
         }
         }
         public void SaveFieldParticlesData()
         public void SaveFieldParticlesData()
         {
         {

+ 5 - 6
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CMeasure.cs

@@ -159,10 +159,10 @@ namespace OTSModelSharp
             MsrMsg.iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
             MsrMsg.iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
          
          
            MsrMsg.STMThreadStu.iMsrStatu = m_ThreadStatus.GetStatus();
            MsrMsg.STMThreadStu.iMsrStatu = m_ThreadStatus.GetStatus();
-               
 
 
-            MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToShortDateString();
-          
+
+            //MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToShortDateString();
+            MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToString("yyyy-MM-dd HH:mm:ss");
             ProgressEvent(MsrMsg);
             ProgressEvent(MsrMsg);
             //disconnect the semcontroller when we exit this task.
             //disconnect the semcontroller when we exit this task.
             m_SemController.DisConnect();
             m_SemController.DisConnect();
@@ -179,9 +179,8 @@ namespace OTSModelSharp
 
 
             MsrMsg.STMThreadStu.iMsrStatu = m_ThreadStatus.GetStatus();
             MsrMsg.STMThreadStu.iMsrStatu = m_ThreadStatus.GetStatus();
 
 
-
-            MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToShortDateString();
-
+            //MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToShortDateString();
+            MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToString("yyyy-MM-dd HH:mm:ss");
             ProgressEvent(MsrMsg);
             ProgressEvent(MsrMsg);
             //disconnect the semcontroller when we exit this task.
             //disconnect the semcontroller when we exit this task.
             //m_SemController.DisConnect();
             //m_SemController.DisConnect();

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/DBDataTransition/GenInfoDB.cs

@@ -224,7 +224,7 @@ namespace OTSModelSharp
         {
         {
             DateTime m_time = DateTime.Now;
             DateTime m_time = DateTime.Now;
 
 
-          string  sDateTime=string.Format("{0:G}", m_time);
+            string sDateTime = m_time.ToString("yyyy-MM-dd HH:mm:ss");
 
 
             return UpdateRow(a_sItemName, sDateTime, a_sItemComment);
             return UpdateRow(a_sItemName, sDateTime, a_sItemComment);
         }
         }

+ 11 - 4
OTSIncAMeasureApp/0-OTSModel/Measure/DBDataTransition/IncADataDB.cs

@@ -72,7 +72,7 @@ namespace OTSModelSharp
             paras[8].Value = xrayPos.X;
             paras[8].Value = xrayPos.X;
             paras[9].Value = xrayPos.Y;
             paras[9].Value = xrayPos.Y;
 
 
-            paras[10].Value = a_pParticle.GetClassifyId();
+            paras[10].Value = a_pParticle.GetFeretDiameter();
             paras[11].Value = (int)(a_pParticle.GetFeature().GetSegmentsList().Count);
             paras[11].Value = (int)(a_pParticle.GetFeature().GetSegmentsList().Count);
             paras[12].Value = fldPos.X;
             paras[12].Value = fldPos.X;
             paras[13].Value = fldPos.Y;
             paras[13].Value = fldPos.Y;
@@ -85,7 +85,7 @@ namespace OTSModelSharp
             paras[20].Value = a_pParticle.GetDINSCR();
             paras[20].Value = a_pParticle.GetDINSCR();
             paras[21].Value = a_pParticle.GetDMEAN();
             paras[21].Value = a_pParticle.GetDMEAN();
             paras[22].Value = a_pParticle.GetDELONG();
             paras[22].Value = a_pParticle.GetDELONG();
-            paras[23].Value = a_pParticle.GetFeretDiameter();
+            paras[23].Value = a_pParticle.GetClassifyId();
             paras[24].Value = a_pParticle.GetTypeName();
             paras[24].Value = a_pParticle.GetTypeName();
             paras[25].Value = a_pParticle.GetTypeColor();
             paras[25].Value = a_pParticle.GetTypeColor();
             paras[26].Value = semPos.X;
             paras[26].Value = semPos.X;
@@ -119,7 +119,7 @@ namespace OTSModelSharp
                     COTSParticleClr p = new COTSParticleClr();
                     COTSParticleClr p = new COTSParticleClr();
                     p.SetFieldId(fld.GetId());
                     p.SetFieldId(fld.GetId());
                     p.SetTagId(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_PARTICLE_ID]));
                     p.SetTagId(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_PARTICLE_ID]));
-                    p.SetType(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_TYPE_ID]));
+                  
                     int top = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_TOP]);
                     int top = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_TOP]);
                     int left = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_LEFT]);
                     int left = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_LEFT]);
                     int width = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_WIDTH]);
                     int width = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_WIDTH]);
@@ -139,6 +139,10 @@ namespace OTSModelSharp
                     p.SetDELONG(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_DELONG]));
                     p.SetDELONG(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_DELONG]));
                     p.SetDPRIMETER(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_PERIMETER]));
                     p.SetDPRIMETER(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_PERIMETER]));
                     p.SetORIENTATION(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_ORIENTATION]));
                     p.SetORIENTATION(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_ORIENTATION]));
+
+                    p.SetFeretDiameter(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_DFERET]));
+
+                    p.SetType(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_TYPE_ID]));
                     p.SetTypeName(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_NAME].ToString());
                     p.SetTypeName(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_NAME].ToString());
                     p.SetTypeColor(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_COLOR].ToString());
                     p.SetTypeColor(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_COLOR].ToString());
                     ps.Add(p);
                     ps.Add(p);
@@ -152,7 +156,7 @@ namespace OTSModelSharp
                     COTSParticleClr p = new COTSParticleClr();
                     COTSParticleClr p = new COTSParticleClr();
                     p.SetFieldId(fld.GetId());
                     p.SetFieldId(fld.GetId());
                     p.SetTagId(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_PARTICLE_ID]));
                     p.SetTagId(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_PARTICLE_ID]));
-                    p.SetType(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_TYPE_ID]));
+                  
                     int top = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_TOP]);
                     int top = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_TOP]);
                     int left = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_LEFT]);
                     int left = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_LEFT]);
                     int width = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_WIDTH]);
                     int width = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_WIDTH]);
@@ -171,6 +175,9 @@ namespace OTSModelSharp
                     p.SetDELONG(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_DELONG]));
                     p.SetDELONG(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_DELONG]));
                     p.SetDPRIMETER(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_PERIMETER]));
                     p.SetDPRIMETER(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_PERIMETER]));
                     p.SetORIENTATION(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_ORIENTATION]));
                     p.SetORIENTATION(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_ORIENTATION]));
+                    p.SetFeretDiameter(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.F_DFERET]));
+
+                    p.SetType(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_TYPE_ID]));
                     p.SetTypeName(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_NAME].ToString());
                     p.SetTypeName(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_NAME].ToString());
                     p.SetTypeColor(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_COLOR].ToString());
                     p.SetTypeColor(allRecords.Rows[i][(int)CIncADataTable.ColumnID.S_COLOR].ToString());
                     ps.Add(p);
                     ps.Add(p);

+ 5 - 4
OTSIncAMeasureApp/0-OTSModel/Measure/DBDataTransition/IncADataTable.cs

@@ -23,7 +23,7 @@ namespace OTSModelSharp
             F_AREA = 7,
             F_AREA = 7,
             N_POS_X = 8,
             N_POS_X = 8,
             N_POS_Y = 9,
             N_POS_Y = 9,
-            N_TYPE_ID = 10,           
+            F_DFERET = 10,           
             N_SEGMENT_NUM = 11,
             N_SEGMENT_NUM = 11,
             N_FldPosX = 12,
             N_FldPosX = 12,
             N_FldPosY = 13,
             N_FldPosY = 13,
@@ -36,7 +36,7 @@ namespace OTSModelSharp
             F_DINSCR = 20,
             F_DINSCR = 20,
             F_DMEAN = 21,
             F_DMEAN = 21,
             F_DELONG = 22,
             F_DELONG = 22,
-            F_DFERET = 23,
+            N_TYPE_ID = 23,
             S_NAME = 24,
             S_NAME = 24,
             S_COLOR = 25,
             S_COLOR = 25,
             N_SEMPOS_X=26,
             N_SEMPOS_X=26,
@@ -63,7 +63,7 @@ namespace OTSModelSharp
             AddColumn(new ColumnDefine() { ColumName = "Area", ColumType = new ColumnType(ColumnType.ID.FLOAT,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "Area", ColumType = new ColumnType(ColumnType.ID.FLOAT,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "PosX", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "PosX", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "PosY", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "PosY", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
-            AddColumn(new ColumnDefine() { ColumName = "TypeId", ColumType =new ColumnType(ColumnType.ID.INTEGER,false,false), IsPrimarykey = false });           
+            AddColumn(new ColumnDefine() { ColumName = "DFERET", ColumType = new ColumnType(ColumnType.ID.FLOAT, false, false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "SegmentNum", ColumType =new ColumnType(ColumnType.ID.INTEGER,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "SegmentNum", ColumType =new ColumnType(ColumnType.ID.INTEGER,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "FieldPosX", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "FieldPosX", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "FieldPosY", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "FieldPosY", ColumType =new ColumnType(ColumnType.ID.INTEGER, false,false), IsPrimarykey = false });
@@ -76,7 +76,8 @@ namespace OTSModelSharp
             AddColumn(new ColumnDefine() { ColumName = "DINSCR", ColumType =new ColumnType(ColumnType.ID.FLOAT, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "DINSCR", ColumType =new ColumnType(ColumnType.ID.FLOAT, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "DMEAN", ColumType =new ColumnType(ColumnType.ID.FLOAT, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "DMEAN", ColumType =new ColumnType(ColumnType.ID.FLOAT, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "DELONG", ColumType =new ColumnType(ColumnType.ID.FLOAT, false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "DELONG", ColumType =new ColumnType(ColumnType.ID.FLOAT, false,false), IsPrimarykey = false });
-            AddColumn(new ColumnDefine() { ColumName = "DFERET", ColumType =new ColumnType(ColumnType.ID.FLOAT, false,false), IsPrimarykey = false });
+          
+            AddColumn(new ColumnDefine() { ColumName = "TypeId", ColumType = new ColumnType(ColumnType.ID.INTEGER, false, false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "TypeName", ColumType =new ColumnType(ColumnType.ID.STRING,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "TypeName", ColumType =new ColumnType(ColumnType.ID.STRING,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "TypeColor", ColumType =new ColumnType(ColumnType.ID.STRING,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "TypeColor", ColumType =new ColumnType(ColumnType.ID.STRING,false,false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "SEMPosX", ColumType = new ColumnType(ColumnType.ID.INTEGER, false, false), IsPrimarykey = false });
             AddColumn(new ColumnDefine() { ColumName = "SEMPosX", ColumType = new ColumnType(ColumnType.ID.INTEGER, false, false), IsPrimarykey = false });

+ 2 - 0
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CSampleParam.cs

@@ -108,6 +108,8 @@ namespace OTSDataType
                 m_strName = xstrName.value();
                 m_strName = xstrName.value();
                 m_strSTDName = xstrSTDName.value();
                 m_strSTDName = xstrSTDName.value();
                 m_SteelTech = (STEEL_TECHNOLOGY)xSteelTech.value();
                 m_SteelTech = (STEEL_TECHNOLOGY)xSteelTech.value();
+                var syst = xSystype.toString();
+                m_nPackId = (OTS_SysType_ID)Convert.ToInt32(syst.Split(':')[0]);
             }
             }
         }
         }
 
 

+ 1 - 13
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -565,19 +565,7 @@ namespace OTSMeasureApp
 
 
             //打开已保存的样品后,将所有样品发送给样品台
             //打开已保存的样品后,将所有样品发送给样品台
             string sWSampleName = m_ProjParam.GetWorkSampleName();
             string sWSampleName = m_ProjParam.GetWorkSampleName();
-            if (SMInfo.sSampleSoluName != "")
-            {
-                string str = table[this.Name.ToLower()].ToString();
-                //this.Text = str + "-" + SMInfo.sSampleSoluName;
-                if (m_ProjParam.m_ResultData.m_nPackId.ToString() == "IncA")
-                {
-                    this.Text = str + "(Inclusion)";
-                }
-                else if (m_ProjParam.m_ResultData.m_nPackId.ToString() == "CleannessA")
-                {
-                    this.Text = str + "(Cleanness)";
-                }
-            }
+           
             if ("" == sWSampleName)
             if ("" == sWSampleName)
             {
             {
                 log.Error("(OTSIncAMeasureAppForm.OpenExistSampleFile)  m_DataMgrFun.GetWorkSampleName() = null Failed !");
                 log.Error("(OTSIncAMeasureAppForm.OpenExistSampleFile)  m_DataMgrFun.GetWorkSampleName() = null Failed !");

+ 3 - 3
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1342,8 +1342,8 @@ namespace OTSIncAReportGraph.Controls
 
 
             //获取使用标准库的名称
             //获取使用标准库的名称
           
           
-            string str_IncALibName = "";
-            str_IncALibName = m_mouseOver_dparticle.TypeName;
+            string str_IncAName = "";
+            str_IncAName = m_mouseOver_dparticle.TypeName;
 
 
 
 
             //获取数据后,需要对xraytable设置
             //获取数据后,需要对xraytable设置
@@ -1351,7 +1351,7 @@ namespace OTSIncAReportGraph.Controls
             control_XRayTable1.SetXRayShowLineValue(Search_xray, Analysis_xray, list_showelementinfo);
             control_XRayTable1.SetXRayShowLineValue(Search_xray, Analysis_xray, list_showelementinfo);
             //颗粒国标信息
             //颗粒国标信息
             control_XRayTable1.GBInfoStr = "";
             control_XRayTable1.GBInfoStr = "";
-            control_XRayTable1.MaterialName = str_IncALibName;//杂夹物
+            control_XRayTable1.MaterialName = str_IncAName;//杂夹物
          
          
             control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
             control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
             control_XRayTable1.Visible = true;
             control_XRayTable1.Visible = true;

+ 27 - 2
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_XRayTable.cs

@@ -6,6 +6,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Drawing;
 using System.Drawing;
 using System.Linq;
 using System.Linq;
+using System.Text;
 using System.Windows.Forms;
 using System.Windows.Forms;
 
 
 namespace OTSIncAReportGraph.Controls
 namespace OTSIncAReportGraph.Controls
@@ -619,15 +620,38 @@ namespace OTSIncAReportGraph.Controls
             g.DrawString(m_goodname, m_thisfont_bold, m_this_sb, new PointF(m_i_rightdrawlabellocation_x + 50, m_i_rightdrawlabellocation_y + 40));
             g.DrawString(m_goodname, m_thisfont_bold, m_this_sb, new PointF(m_i_rightdrawlabellocation_x + 50, m_i_rightdrawlabellocation_y + 40));
 
 
             //show element list information,using the elementlist number to make sure width,number take width 25 growth
             //show element list information,using the elementlist number to make sure width,number take width 25 growth
+
             if (m_list_showelementinfo != null)
             if (m_list_showelementinfo != null)
             {
             {
+                //make it 100%
+                double sumpercentage = 0;
+                for (int i = 0; i < m_list_showelementinfo.Count; i++)
+                {
+                    sumpercentage += m_list_showelementinfo[i].Percentage;
+                
+                }
+                for (int i = 0; i < m_list_showelementinfo.Count; i++)
+                {
+                    m_list_showelementinfo[i].percentageIn100 = m_list_showelementinfo[i].Percentage / sumpercentage * 100;
+
+                }
+
+
+
                 PointF ls_pt = new PointF(m_i_rightdrawlabellocation_x - (m_list_showelementinfo.Count * 25 - 60), m_i_rightdrawlabellocation_y + 60);
                 PointF ls_pt = new PointF(m_i_rightdrawlabellocation_x - (m_list_showelementinfo.Count * 25 - 60), m_i_rightdrawlabellocation_y + 60);
                 for (int i = 0; i < m_list_showelementinfo.Count; i++)
                 for (int i = 0; i < m_list_showelementinfo.Count; i++)
                 {
                 {
-                    string str_element = "" + m_list_showelementinfo[i].ElementName + "(" + m_list_showelementinfo[i].Percentage.ToString("0.00") + ")";
+                    StringBuilder sb = new StringBuilder();
+
+                    sb.Append(m_list_showelementinfo[i].ElementName);
+                    sb.Append("(");
+                    sb.Append(m_list_showelementinfo[i].Percentage.ToString("0.00/"));
+                    sb.Append(m_list_showelementinfo[i].percentageIn100.ToString("0.00)"));
+                    string str_element = sb.ToString();
+                    //string str_element = m_list_showelementinfo[i].ElementName + "(" + m_list_showelementinfo[i].Percentage.ToString("0.00:") + m_list_showelementinfo[i].percentageIn100.ToString("0.00") +")";
                     SizeF out_testsizef = g.MeasureString(str_element, m_thisfont);
                     SizeF out_testsizef = g.MeasureString(str_element, m_thisfont);
                     g.DrawString(str_element, m_thisfont, new SolidBrush(DrawFunction.GetColorByNumber(i + 1)), ls_pt);
                     g.DrawString(str_element, m_thisfont, new SolidBrush(DrawFunction.GetColorByNumber(i + 1)), ls_pt);
-                    ls_pt.X = ls_pt.X + out_testsizef.Width + 2;
+                    ls_pt.X = ls_pt.X + out_testsizef.Width -4;
                 }
                 }
             }
             }
             //标准库显示
             //标准库显示
@@ -698,6 +722,7 @@ namespace OTSIncAReportGraph.Controls
         public string ElementName;
         public string ElementName;
         public double Percentage;//实际能谱返回的质量百分比
         public double Percentage;//实际能谱返回的质量百分比
         public double dKF;//K峰,元素周期表中固定值
         public double dKF;//K峰,元素周期表中固定值
+        public double percentageIn100;//归一化后的百分比
     }
     }
     #endregion
     #endregion
 
 

File diff suppressed because it is too large
+ 235 - 174
OTSSysMgrApp/SemTestForms.Designer.cs


+ 8 - 8
OTSSysMgrApp/SemTestForms.cs

@@ -1296,19 +1296,19 @@ namespace OTSSysMgrApp
 
 
         }
         }
 
 
-        private void button_VoltageStatus_Click(object sender, EventArgs e)
+        private void bVoltageClose_Click(object sender, EventArgs e)
         {
         {
-            //连接电镜 关闭电压
             int a_HTValue = 0;
             int a_HTValue = 0;
-            bool result = cfun.GetSemHTOnOff(ref a_HTValue);
-                MessageBox.Show("电压当前状态:" + Convert.ToBoolean(a_HTValue).ToString());
+            bool result = cfun.SetSemHTOnOff(a_HTValue);
+            MessageBox.Show("关闭电压是否成功:" + Convert.ToBoolean(result).ToString());
         }
         }
 
 
-        private void button_VoltageClose_Click(object sender, EventArgs e)
+        private void bVoltageStatus_Click(object sender, EventArgs e)
         {
         {
-            int a_HTValue = 0; 
-            bool result = cfun.SetSemHTOnOff(a_HTValue);
-                MessageBox.Show("关闭电压是否成功:" + Convert.ToBoolean(result).ToString());
+            //连接电镜 关闭电压
+            int a_HTValue = 0;
+            bool result = cfun.GetSemHTOnOff(ref a_HTValue);
+            MessageBox.Show("电压当前状态:" + Convert.ToBoolean(a_HTValue).ToString());
         }
         }
     }
     }
 }
 }

Some files were not shown because too many files changed in this diff