Bläddra i källkod

Merge branch 'Release2.5' into OTSMining

gsp 3 år sedan
förälder
incheckning
5dc4cbcae7

+ 16 - 16
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -236,7 +236,7 @@
  <Form>
     <Name>Triangulation_List</Name>
     <Controls>
-      <Control name="Triangulation_List" text="三元图模板列表" />
+      <Control name="Triangulation_List" text="三元图模板列表" />
 	  <Control name="button1" text="添  加" />
 	  <Control name="button2" text="返  回" />
     </Controls>
@@ -244,7 +244,7 @@
   <Form>
     <Name>Triangulation_Edit</Name>
     <Controls>
-      <Control name="Triangulation_Edit" text="三元图模板编辑" />
+      <Control name="Triangulation_Edit" text="三元图模板编辑" />
     </Controls>
  </Form>
   <Form>
@@ -275,7 +275,7 @@
 	  <Control name="label7" text="文件夹" />
 	  <Control name="label17" text="文件" />
 	  <Control name="label5" text="文件夹" />
-	  <Control name="groupBox6" text="三元图模板设置" />
+	  <Control name="groupBox6" text="三元图模板设置" />
 	  <Control name="groupBox7" text="颗粒分析标准库设置" />
 	  <Control name="groupBox9" text="纳入指数计算" />
 	  <Control name="label22" text="比例因子" />
@@ -330,7 +330,7 @@
 	  <Control name="lb_sjlx" text="数据类型" />
 	  <Control name="lb_ccjsff" text="尺寸计算方法" />
 	  <Control name="lb_ljb" text="粒级表" />
-	  <Control name="lb_syxtmb" text="三元图模板" />
+	  <Control name="lb_syxtmb" text="三元图模板" />
 	  <Control name="OTSReport_Condition" text="编辑模板条件" />
     </Controls>
  </Form>
@@ -388,10 +388,10 @@
 	  <Control name="RictBox29" text="加载元素成份图模块完成" />
 	  <Control name="RictBox30" text="元素成份图" />
 	  
-	  <Control name="RictBox31" text="加载三元图模块中...." />
-	  <Control name="RictBox32" text="加载:三元图" />
-	  <Control name="RictBox33" text="加载三元图模块完成" />
-	  <Control name="RictBox34" text="三元图" />
+	  <Control name="RictBox31" text="加载三元图模块中...." />
+	  <Control name="RictBox32" text="加载:三元图" />
+	  <Control name="RictBox33" text="加载三元图模块完成" />
+	  <Control name="RictBox34" text="三元图" />
 	  
 	  <Control name="RictBox35" text="生成模板临时数据库文件...." />
 	  <Control name="RictBox36" text="加载:生成模板临时数据库文件" />
@@ -495,11 +495,11 @@
 	  <Control name="label26" text="颗粒范围" />
 	  <Control name="label27" text="显示元素" />
 	  <Control name="label28" text="计算方式" />
-	  <Control name="tabPage5" text="三相图" />
-	  <Control name="groupBox7" text="三相图" />
+	  <Control name="tabPage5" text="三相图" />
+	  <Control name="groupBox7" text="三相图" />
 	  <Control name="label40" text="显示该模块" />
 	  <Control name="label41" text="颗粒范围" />
-	  <Control name="label33" text="三相图模板列表" />
+	  <Control name="label33" text="三相图模板列表" />
 	  <Control name="label42" text="每行显示数量" />
 	  <Control name="label44" text="计算方式" />
 	  <Control name="tabPage6" text="颗粒列表信息" />
@@ -521,8 +521,8 @@
 	  <Control name="report4" text="线状图" />
 	  <Control name="report5" text="堆叠图" />
 	  
-	  <Control name="report10" text="三元图模板选择项需2整倍数,请重新选择!" />
-	  <Control name="report11" text="三元图模板选择项需3整倍数,请重新选择!" />
+	  <Control name="report10" text="三元图模板选择项需2整倍数,请重新选择!" />
+	  <Control name="report11" text="三元图模板选择项需3整倍数,请重新选择!" />
 	  <Control name="report12" text="提示" />
 	  
 	  <Control name="groupBox9" text="首页设置信息" />
@@ -826,7 +826,7 @@
 	  <Control name="sscaptionname9" text="数据类型" />
 	  <Control name="sscaptionname10" text="数据表类型" /> 
 	  <Control name="sscaptionname11" text="数据图类型" />
-	  <Control name="sscaptionname12" text="三元图" />
+	  <Control name="sscaptionname12" text="三元图" />
 	  <Control name="sscaptionname13" text="颗粒分类图" />
 	  <Control name="sscaptionname14" text="颗粒分布图" />
 	  <Control name="sscaptionname15" text="颗粒排列图" />
@@ -853,7 +853,7 @@
 	  <Control name="m_reportname4" text="颗粒尺寸分布" />
 	  <Control name="m_str_axisy4" text="颗粒数" />
 	  <Control name="str_operatonmodule4" text="颗粒尺寸分布图" />
-	  <Control name="str_operatonmodule5" text="三元图" />
+	  <Control name="str_operatonmodule5" text="三元图" />
 	  <Control name="str1" text="参数" />
 	  <Control name="str2" text="常规参数" />
 	  <Control name="BSEOriginal" text="BSE原图" />
@@ -1339,7 +1339,7 @@
 	  <Control name="m_reportname4" text="颗粒尺寸分布" />
 	  <Control name="m_str_axisy4" text="颗粒数" />
 	  <Control name="str_operatonmodule4" text="颗粒尺寸分布图" />
-	  <Control name="str_operatonmodule5" text="三元图" />
+	  <Control name="str_operatonmodule5" text="三元图" />
 	  <Control name="str1" text="参数" />
 	  <Control name="str2" text="常规参数" />
     </Controls>

+ 101 - 8
OTSCPP/OTSClassifyEngine/InclutionEngine/OTSClassifyEng.cpp

@@ -608,23 +608,24 @@ namespace OTSClassifyEngine
 		}
 		
 	
-		if (dOWeight >= MIN_ELEMENT_SUM && dSWeight< MIN_ELEMENT_SUM )
-		{
-			
-			a_GrpId = IDENTIFIED_INC_GRP_ID::OXIDE;
-			
-		}
-		else if ( dSWeight >= MIN_ELEMENT_SUM && dOWeight < MIN_ELEMENT_SUM)
+	
+		if ( dSWeight >= MIN_ELEMENT_SUM && dOWeight < MIN_ELEMENT_SUM && dNWeight <= MIN_ELEMENT_SUM)
 		{
 			a_GrpId = IDENTIFIED_INC_GRP_ID::SULFIDE;
 		}
-		else if (dOWeight >= MIN_ELEMENT_SUM && dSWeight >= MIN_ELEMENT_SUM )
+		else if (dOWeight >= MIN_ELEMENT_SUM && dSWeight >= MIN_ELEMENT_SUM && dNWeight<=MIN_ELEMENT_SUM)
 		{
 			a_GrpId = IDENTIFIED_INC_GRP_ID::SULFIDE_OXIDE;
 		}
 		else if ( dNWeight >= MIN_ELEMENT_SUM)
 		{
 			a_GrpId = IDENTIFIED_INC_GRP_ID::CARBONNITRIDE_NITRIDE;
+		}else
+		if (dOWeight >= MIN_ELEMENT_SUM && dSWeight < MIN_ELEMENT_SUM)
+		{
+
+			a_GrpId = IDENTIFIED_INC_GRP_ID::OXIDE;
+
 		}
 		else
 		{
@@ -636,6 +637,70 @@ namespace OTSClassifyEngine
 		return TRUE;
 		
 	
+	}
+	BOOL COTSClassifyEng::GroupClassify1(CElementChemistriesList& a_listElChemsIncNoFe, int incId, IDENTIFIED_INC_GRP_ID& a_GrpId)
+	{
+
+		double dOWeight = 0;
+		double dSWeight = 0;
+		double dNWeight = 0;
+		for (auto pElChem : a_listElChemsIncNoFe)
+		{
+
+			if (pElChem->GetName().CompareNoCase(STR_O) == 0)
+			{
+
+				dOWeight = pElChem->GetPercentage();
+
+			}
+			else if (pElChem->GetName().CompareNoCase(STR_SUL) == 0)
+			{
+
+				dSWeight = pElChem->GetPercentage();
+
+			}
+			else if (pElChem->GetName().CompareNoCase(STR_N) == 0)
+			{
+				dNWeight = pElChem->GetPercentage();
+			}
+
+
+
+		}
+
+		auto stdItm = pPartSTDData->GetSTDItemById(incId);
+		INC_CLASSIFY_TYPE claType = INC_CLASSIFY_TYPE::INVALID;
+		this->GetClassifyTypeOfSTDItem(incId, claType);
+
+		if (claType == INC_CLASSIFY_TYPE::COMPLEX_OXIDE || claType == INC_CLASSIFY_TYPE::OXIDE || claType == INC_CLASSIFY_TYPE::SIMPLE_OXIDE)
+		{
+			a_GrpId = IDENTIFIED_INC_GRP_ID::OXIDE;
+			return true;
+		}
+		else if (claType == INC_CLASSIFY_TYPE::SUL)
+		{
+
+			 if (dOWeight >= MIN_ELEMENT_SUM && dSWeight <= 1)
+			{
+				a_GrpId = IDENTIFIED_INC_GRP_ID::SULFIDE_OXIDE;
+			 }
+			 else
+			 {
+				 a_GrpId = IDENTIFIED_INC_GRP_ID::SULFIDE;
+			 }
+		}
+		else if (claType == INC_CLASSIFY_TYPE::NITR)
+		{
+			a_GrpId = IDENTIFIED_INC_GRP_ID::CARBONNITRIDE_NITRIDE;
+		}
+		else
+		{
+			a_GrpId = IDENTIFIED_INC_GRP_ID::Others;
+		}
+
+		return TRUE;
+
+
 	}
 
 	BOOL COTSClassifyEng::GetGroupNameAndColorById(int grpId,std::string& grpName,std::string& grpColor)
@@ -1502,7 +1567,35 @@ namespace OTSClassifyEngine
 		// ok, return TRUE
 		return TRUE;
 	}
+	BOOL COTSClassifyEng::GetClassifyTypeOfSTDItem(int a_nIncId, INC_CLASSIFY_TYPE& a_nClassifyType)
+	{
+
+
+		a_nClassifyType = INC_CLASSIFY_TYPE::INVALID;
+		if (a_nIncId >=(int) OTS_STD_ITEM_VALUE::SYS_SIMPLE_OXIDE_MIN && a_nIncId < (int)OTS_STD_ITEM_VALUE::SYS_SIMPLE_OXIDE_MAX)
+		{
+			a_nClassifyType = INC_CLASSIFY_TYPE::SIMPLE_OXIDE;
+		}else if(a_nIncId >= (int) OTS_STD_ITEM_VALUE::SYS_COMPLEX_OXIDE_MIN && a_nIncId < (int)OTS_STD_ITEM_VALUE::SYS_COMPLEX_OXIDE_MAX)
+		{
+		
+			a_nClassifyType = INC_CLASSIFY_TYPE::COMPLEX_OXIDE;
+		}
+		else if (a_nIncId >= (int)OTS_STD_ITEM_VALUE::SYS_OXIDE_MIN && a_nIncId < (int)OTS_STD_ITEM_VALUE::SYS_OXIDE_MAX)
+		{
+			a_nClassifyType = INC_CLASSIFY_TYPE::OXIDE;
+		}
+		else if (a_nIncId >= (int)OTS_STD_ITEM_VALUE::SYS_SUL_MIN && a_nIncId < (int)OTS_STD_ITEM_VALUE::SYS_SUL_MAX)
+		{
+			a_nClassifyType = INC_CLASSIFY_TYPE::SUL;
+		}
+		else if (a_nIncId >= (int)OTS_STD_ITEM_VALUE::SYS_NITRIDE_MIN && a_nIncId < (int)OTS_STD_ITEM_VALUE::SYS_NITRIDE_MAX)
+		{
+			a_nClassifyType = INC_CLASSIFY_TYPE::NITR;
+		}
+		return true;
 
+		
+	}
 	BOOL COTSClassifyEng::GetSulfildeOxideComplexItemId(CElementChemistriesList& a_listElChemsIncNoFe, double a_dMolarSumNoFe, CString strSulfideBaseName, int& a_nIncId)
 	{
 		int nIncId;

+ 3 - 0
OTSCPP/OTSClassifyEngine/InclutionEngine/OTSClassifyEng.h

@@ -42,6 +42,8 @@ namespace OTSClassifyEngine
 
 		 BOOL GroupClassify(CElementChemistriesList& a_listElChemsIncNoFe,int incId, IDENTIFIED_INC_GRP_ID& a_GrpId);
 
+		 BOOL GroupClassify1(CElementChemistriesList& a_listElChemsIncNoFe, int incId, IDENTIFIED_INC_GRP_ID& a_GrpId);
+
 		 BOOL GetGroupNameAndColorById(int grpId, std::string& grpName, std::string& grpColor);
 
 		// sulfides classification 
@@ -123,6 +125,7 @@ namespace OTSClassifyEngine
 			CElementChemistriesList& a_listNomiElChemsInc);
 		// get classify STD items
 		BOOL GetClassifySTDItem(CInclutionSTDDataPtr a_pPartSTDDataPtr, INC_CLASSIFY_TYPE a_nClassifyType, CSTDItemsList& a_listSTDItems);
+		BOOL GetClassifyTypeOfSTDItem(int a_nIncId, INC_CLASSIFY_TYPE& a_nClassifyType);
 		BOOL GetSulfildeOxideComplexItemId(CElementChemistriesList& a_listElChemsIncNoFe,
 			double a_dMolarSumNoFe, CString strSulfideBaseName,
 			int& nIncId);

+ 4 - 1
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -190,7 +190,10 @@ namespace OTSMeasureApp
                 var sam = GetWorkingVisualSample();
                 SizeF size = new SizeF(diameter, diameter);
                 var position =sam.GetMeasureGDIObject().GetZoomedRegionF().Location;
-                RectangleF rectangle = new RectangleF(position, size);
+                RectangleF rec = sam.GetMeasureGDIObject().GetZoomedRegionF();
+                PointF centerPos = new PointF(position.X + rec.Width / 2, position.Y + rec.Height / 2);
+                PointF newRegionFPos = new PointF(centerPos.X - diameter / 2, centerPos.Y - diameter / 2);
+                RectangleF rectangle = new RectangleF(newRegionFPos, size);
                 Color MeasureColor = Color.Red;
                 CRingGDIObject newGDI;
                

+ 46 - 41
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -172,8 +172,7 @@ namespace OTSIncAReportGraph.Controls
         //移动SEM到指定位置发生线程
         private Thread m_mythread;
 
-        //记录线程是否已经运行完成的状态
-        //private bool m_mythread_state = false;
+
 
         private Color m_ColorNotContent = Color.SkyBlue;
 
@@ -335,7 +334,7 @@ namespace OTSIncAReportGraph.Controls
             //记录原值,用于缩放计算操作 ,此处要用克隆 ,原particle颗粒的值,在底层调用时已经赋值过了
             foreach (DisplayParticle ls_dp in m_list_allDPart)
             {
-                ls_dp.SetPaintState(PaintState.NORMALPAINT);
+                ls_dp.SetPaintState(PaintState.PAINT);
                 DisplayParticle old_dp = ls_dp.Clone() as DisplayParticle;
                 ReportFun. m_original_list_baseobject.Add(old_dp);
             }
@@ -778,7 +777,7 @@ namespace OTSIncAReportGraph.Controls
                 DisplayParticle dp = (DisplayParticle)m_list_allDPart[i];
                 
                 
-                    //dp.displayState = DisplayState.NORMALDISPLAY;
+                  
                     for (int y = 0; y < dp.DSegments.Count(); y++)
                     {
                         //这里重新设置每条线的高度,和x,y坐标
@@ -802,7 +801,7 @@ namespace OTSIncAReportGraph.Controls
                 //设置缩放到多少倍时进行显示
                 if (m_zoom_record >= dp.Zoom_DisPlayThreshold)
                 {
-                    dp.SetPaintState(PaintState.NORMALPAINT);
+                    dp.SetPaintState(PaintState.PAINT);
                 }
                 else
                 {
@@ -810,13 +809,15 @@ namespace OTSIncAReportGraph.Controls
                 }
 
 
-                if (dp.Rect.Left < -120 || dp.Rect.Right > this.Width+120 || dp.Rect.Top < -120 || dp.Rect.Bottom > this.Height+120)
+          
+                PointF ct = dp.GetCenterPoint();
+                if (ct.X < -100 || ct.X > this.Width + 100 || ct.Y < -100 || ct.Y > this.Height + 100)
                 {
                     dp.SetPaintState(PaintState.NOPAINT);//the particles which are out of screen don't display.to speed up the display efficient.
+
                 }
-               
 
-               
+
             }
             if (m_list_allDfield != null)
             {
@@ -913,11 +914,15 @@ namespace OTSIncAReportGraph.Controls
                         foreach (BaseObject item in m_list_allDPart)
                         {
                             var dp = (DisplayParticle)item;
-                            if (dp.Rect.Left > -120 && dp.Rect.Right < this.Width + 120 && dp.Rect.Top > -120 && dp.Rect.Bottom < this.Height + 120)
+                         
+
+                            PointF ct = dp.GetCenterPoint();
+                            if (ct.X > -100 && ct.X < this.Width + 100 && ct.Y > -100 && ct.Y < this.Height + 100)
                             {
                                 item.IsDragging = true;
-                            
+
                             }
+
                             item.DraggingPoint = e.Location;
                             if (OriginalBackground)
                             {
@@ -1013,15 +1018,18 @@ namespace OTSIncAReportGraph.Controls
                             dp.SmallRect = dp.GetSmallRectangleFromRect();
                             if (m_zoom_record >= dp.Zoom_DisPlayThreshold)
                             {
-                                dp.SetPaintState(PaintState.NORMALPAINT);
+                                dp.SetPaintState(PaintState.PAINT);
                             }
                             else
                             {
                                 dp.SetPaintState(PaintState.CONCISEPAINT);
                             }
-                            if (dp.Rect.Left < -120 || dp.Rect.Right > this.Width + 120 || dp.Rect.Top < -120 || dp.Rect.Bottom > this.Height + 120)
+                       
+                            PointF ct = dp.GetCenterPoint();
+                            if (ct.X < -100 || ct.X > this.Width + 100 || ct.Y < -100 || ct.Y > this.Height + 100)
                             {
-                                dp.SetPaintState(PaintState.NOPAINT);
+                                dp.SetPaintState(PaintState.NOPAINT);//the particles which are out of screen don't display.to speed up the display efficient.
+
                             }
                         }
                     }
@@ -1049,7 +1057,7 @@ namespace OTSIncAReportGraph.Controls
                     foreach (BaseObject item in m_list_allDPart)
                     {
                         DisplayParticle dp = (DisplayParticle)item;
-                        if (dp.GetPaintState() == PaintState.NORMALPAINT)
+                        if (dp.GetPaintState() == PaintState.PAINT)
                         {
                             if (ReportFun.WhetherInRange(dp, e.Location))
                             {
@@ -1282,17 +1290,21 @@ namespace OTSIncAReportGraph.Controls
                             dp.SmallRect = dp.GetSmallRectangleFromRect();
                             if (m_zoom_record >= dp.Zoom_DisPlayThreshold)
                             {
-                                dp.SetPaintState(PaintState.NORMALPAINT);
+                                dp.SetPaintState(PaintState.PAINT);
                             }
                             else
                             {
                                 dp.SetPaintState(PaintState.CONCISEPAINT);
                             }
-                            if (dp.Rect.Left < -120 || dp.Rect.Right > this.Width + 120 || dp.Rect.Top < -120 || dp.Rect.Bottom > this.Height + 120)
+
+
+                            PointF ct = dp.GetCenterPoint();
+                            if (ct.X < -100 || ct.X > this.Width + 100 || ct.Y < -100 || ct.Y > this.Height + 100)
                             {
-                                dp.SetPaintState(PaintState.NOPAINT);
+                                dp.SetPaintState(PaintState.NOPAINT);//the particles which are out of screen don't display.to speed up the display efficient.
+
                             }
-                            
+
                         }
 
 
@@ -1322,20 +1334,15 @@ namespace OTSIncAReportGraph.Controls
                         CMenuStrip.Items[(int)RightButtonMenu.CopyImage].Visible = false;
                         CMenuStrip.Items[(int)RightButtonMenu.OriginalSplicing].Visible = false;
                         CMenuStrip.Items[(int)RightButtonMenu.DeleteParticle].Visible = true;
-                        //CMenuStrip.Items[(int)RightButtonMenu.CopyDatabase].Visible = true;
+                  
 
                         CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Visible = true;
                         CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Tag = item;
 
                         DisplayParticle dp = (DisplayParticle)item;
-                        //if (dp.TypeId == 9)
-                        //{
+                     
                             CMenuStrip.Items[(int)RightButtonMenu.ImportSTDDb].Visible = true;
-                        //}
-                        //else
-                        //{
-                        //    CMenuStrip.Items[(int)RightButtonMenu.ImportSTDDb].Visible = false;
-                        //}
+                     
 
                         CMenuStrip.Items[(int)RightButtonMenu.ParticleSegmentation].Visible = true;
                         m_ParticleSegmentation.ParticleData = dp.objParticleData;
@@ -1362,7 +1369,7 @@ namespace OTSIncAReportGraph.Controls
 
                     }
                     CMenuStrip.Items[(int)RightButtonMenu.DeleteParticle].Visible = false;
-                    //CMenuStrip.Items[(int)RightButtonMenu.CopyDatabase].Visible = false;
+                
                     CMenuStrip.Items[(int)RightButtonMenu.CopyImage].Visible = true;
                     CMenuStrip.Items[(int)RightButtonMenu.OriginalSplicing].Visible = true;
                     CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Visible = false;
@@ -1574,7 +1581,7 @@ namespace OTSIncAReportGraph.Controls
             foreach (DisplayParticle ls_dp in m_list_allDPart)
             {
               
-                if (ls_dp.GetPaintState() == PaintState.NORMALPAINT)
+                if (ls_dp.GetPaintState() == PaintState.PAINT)
                 {
                     for (int i = 0; i < particles.Count; i++)
                     {
@@ -1683,7 +1690,6 @@ namespace OTSIncAReportGraph.Controls
 
               
 
-                //Thread.Sleep(500);
 
                 //第二步,移动到指定位置,先读取再设置
                 if (ReportFun.ConnectToIpcSvr())
@@ -1693,10 +1699,7 @@ namespace OTSIncAReportGraph.Controls
 
                 }
 
-                //Thread.Sleep(1500);
-
-                //第三步,断开电镜连接
-                //ReportFun.DisConnectSEM();
+               
 
                
 
@@ -1832,9 +1835,11 @@ namespace OTSIncAReportGraph.Controls
 
                 //重新计算小矩形边框
                 dp.SmallRect = dp.GetSmallRectangleFromRect();
-                if (dp.Rect.Left < -120 || dp.Rect.Right > this.Width + 120 || dp.Rect.Top < -120 || dp.Rect.Bottom > this.Height + 120)
+                PointF ct = dp.GetCenterPoint();
+                if (ct.X < -100 || ct.X > this.Width + 100 || ct.Y < -100 || ct.Y > this.Height + 100)
                 {
-                    dp.SetPaintState(PaintState.NOPAINT);
+                    dp.SetPaintState(PaintState.NOPAINT);//the particles which are out of screen don't display.to speed up the display efficient.
+
                 }
             }
             //同样重新计算backrectf的坐标
@@ -2004,7 +2009,7 @@ namespace OTSIncAReportGraph.Controls
                         ls_ds.ShowMode = SegmentShowMode.DRAWPOINT;
                     }
                 }
-                FullGraphMatch();
+              
             }
             else if (a_type == IMAGE_TYPE.CLASSIFIED)
             {
@@ -2018,7 +2023,7 @@ namespace OTSIncAReportGraph.Controls
                         ls_ds.ShowMode = SegmentShowMode.DRAWLINE;
                     }
                 }
-                FullGraphMatch();
+               
             }
             else if (a_type== IMAGE_TYPE.ORIGINAl)
             {
@@ -2028,7 +2033,7 @@ namespace OTSIncAReportGraph.Controls
                 {
                     ls_dp.SetDisplayState(DisplayState.NODISPLAY);
                 }
-                FullGraphMatch();
+               
             }
             else if(a_type== IMAGE_TYPE.ORIGINALCLASSIFIED)
             {
@@ -2042,7 +2047,7 @@ namespace OTSIncAReportGraph.Controls
                         ls_ds.ShowMode = SegmentShowMode.DRAWLINE;
                     }
                 }
-                FullGraphMatch();
+              
             }
 
         
@@ -2081,7 +2086,7 @@ namespace OTSIncAReportGraph.Controls
             {
 
                 var curfldrec = f.Current_Rect;
-                if (curfldrec.Left > -1000 && curfldrec.Right < this.Width + 1000 && curfldrec.Top > -1000 && curfldrec.Bottom < this.Height + 1000)
+                if (curfldrec.Left > -2000 && curfldrec.Right < this.Width + 2000 && curfldrec.Top > -2000 && curfldrec.Bottom < this.Height + 2000)
                 {
                    
                   
@@ -2156,7 +2161,7 @@ namespace OTSIncAReportGraph.Controls
                 //"单个OTS视域屏幕像素宽:" + m_OneField_OTS_Rect.Width.ToString() + " 高:" + m_OneField_OTS_Rect.Height.ToString() + Environment.NewLine +
                 "屏幕像素backrectf  x:" + m_backRect.X.ToString() + "  y:" + m_backRect.Y.ToString() + "  width:" + m_backRect.Width.ToString() + "  height:" + m_backRect.Height.ToString() + Environment.NewLine +
                 "包含Field数量:" + ReportFun.m_field_count.ToString() + " Particle数量:" + ReportFun.m_particle_count.ToString() + Environment.NewLine +
-                "正常显示Paticle数量:" + GetParticleNumberByState(PaintState.NORMALPAINT).ToString() + " 不显示Particel数量:" + GetParticleNumberByState(PaintState.NOPAINT).ToString() + Environment.NewLine +
+                "正常显示Paticle数量:" + GetParticleNumberByState(PaintState.PAINT).ToString() + " 不显示Particel数量:" + GetParticleNumberByState(PaintState.NOPAINT).ToString() + Environment.NewLine +
                 //"删除Particle数量:" + GetParticleNumberByState("删除").ToString() + " 选中Particle数量:" + GetParticleNumberByState("选择").ToString() + Environment.NewLine +
                 "加载底层数据用时:" + ReportFun.m_time_str + Environment.NewLine +
                 "组建并计算图像用时:" + ReportFun.m_time_str2 + Environment.NewLine +

+ 8 - 8
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -386,7 +386,7 @@ namespace OTSIncAReportGraph.Controls
                     DisplayParticle dp = (DisplayParticle)item;
                     if (dp.IsDeleted==false)
                     {
-                        if (dp.GetPaintState() == PaintState.NORMALPAINT)
+                        if (dp.GetPaintState() == PaintState.PAINT)
                         {
                             item.OnPaint(e);
                         }
@@ -480,7 +480,7 @@ namespace OTSIncAReportGraph.Controls
                         }
                         else
                         {
-                            dp.SetPaintState(PaintState.NORMALPAINT);
+                            dp.SetPaintState(PaintState.PAINT);
                         }
 
                     }
@@ -675,7 +675,7 @@ namespace OTSIncAReportGraph.Controls
                         {
 
                             DisplayParticle dp = (DisplayParticle)item;
-                            if (dp.GetPaintState() == PaintState.NORMALPAINT )
+                            if (dp.GetPaintState() == PaintState.PAINT )
                             {
                                 CMenuStrip.Items[0].Enabled = true;
                                 CMenuStrip.Items[0].Tag = dp;
@@ -782,7 +782,7 @@ namespace OTSIncAReportGraph.Controls
                             DisplayParticle dp = (DisplayParticle)item;
 
                     
-                        if (dp.GetPaintState() == PaintState.NORMALPAINT)
+                        if (dp.GetPaintState() == PaintState.PAINT)
                         {
                             if (true == m_ReportFun.WhetherInRange(dp, e.Location))
                             {
@@ -866,7 +866,7 @@ namespace OTSIncAReportGraph.Controls
                     DisplayParticle dp = (DisplayParticle)item;
                     if (true == m_ReportFun.WhetherInRange(dp, e.Location))
                     {
-                        if (dp.GetPaintState() == PaintState.NORMALPAINT)
+                        if (dp.GetPaintState() == PaintState.PAINT)
                         {
  
 
@@ -1073,7 +1073,7 @@ namespace OTSIncAReportGraph.Controls
                 foreach (DisplayParticle ls_dp in spd.List_DParticle)
                 {
                     //只有显示状态,才可以切换到选择状态,考虑可能会出现如果在条件选择成不显示状态下,如果被选择了,是不是就强制切换成了选择状态
-                    if (ls_dp.GetPaintState() == PaintState.NORMALPAINT)
+                    if (ls_dp.GetPaintState() == PaintState.PAINT)
                     {
                         for (int i = 0; i < in_list_cotsparticleclr.Count; i++)
                         {
@@ -1118,7 +1118,7 @@ namespace OTSIncAReportGraph.Controls
                 foreach (DisplayParticle ls_dp in m_list_baseobject)
                 {
                     ls_dp.ParticleFL = Convert.ToString(Math.Sqrt(ls_dp.objParticleData.Area / 3.14159) * 2);
-                    ls_dp.SetPaintState(PaintState.NORMALPAINT);
+                    ls_dp.SetPaintState(PaintState.PAINT);
                    
                     if (!FLNameList.ContainsKey(ls_dp.TypeName))
                     {
@@ -1430,7 +1430,7 @@ namespace OTSIncAReportGraph.Controls
 
             if (dp.IsSelect)
             {
-                dp.SetPaintState(PaintState.NORMALPAINT);
+                dp.SetPaintState(PaintState.PAINT);
                 CMenuStrip.Items[1].Text = "选择颗粒";
 
                 control_XRayTable1.Visible = false;

+ 3 - 8
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -527,16 +527,11 @@ namespace OTSIncAReportApp
         {
             int sourceid = 0;
             sourceid =(int) m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemVal;
-            //sourceid = m_rstDataMgr.GetWorkingResult();
-            //m_rstDataMgr.SetWorkingResult(sourceid);
-
-
-
-            //var resultFile = m_rstDataMgr.ResultFilesList[sourceid];
+         
 
             var prop = m_SourceGridData;
 
-            //String m_fileName = resultFile.FileName;
+           
             String m_fileName=m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
 
 
@@ -579,7 +574,7 @@ namespace OTSIncAReportApp
                             IMAGE_TYPE t = (IMAGE_TYPE)imgType.itemVal;
                             m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.ShowMode(t);
 
-                            m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.FullGraphMatch();
+                          
 
                         }
                         else if (m_ReportApp.im_Control_DrawDistrbutionImageAndBSE == null)

+ 42 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -973,6 +973,27 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             }
 
+            //去除物质分类(非夹杂物分类)
+
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            {
+                for (int i = dt.Rows.Count-1; i >=0; i--)
+                {
+                    if (dt.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    {
+                        dt.Rows.RemoveAt(i);
+                    
+                    }
+                }
+            }
+
+
+
+
+
+
+
+
             //将颗粒大小排序(从大到小)
             DataView dv = dt.DefaultView;
             dv.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";
@@ -1213,6 +1234,27 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     }
                 }
             }
+
+
+
+            //去除物质分类(非夹杂物分类)
+
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            {
+                for (int i = dt.Rows.Count - 1; i >= 0; i--)
+                {
+                    if (dt.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    {
+                        dt.Rows.RemoveAt(i);
+
+                    }
+                }
+            }
+
+
+
+
+
             //将颗粒大小排序(从大到小)
             DataView dv = dt.DefaultView;
             dv.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";

+ 24 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -135,6 +135,7 @@ namespace OTSIncAReportApp
                 M_JZWZB = new JZWZB();
                 M_KLLBXX.list_str_tb_lllb_sxys = new List<string>();
                 M_KLLBXX.list_str_kllb_qcys = new List<string>();
+                M_KLLBXX.list_str_kllb_DeleteClass = new List<string>();
                 M_DZ = new DZ();
             }
             #endregion
@@ -568,6 +569,14 @@ namespace OTSIncAReportApp
                 /// </summary>
                 public List<string> list_str_kllb_qcys { get; set; }
 
+                /// <summary>
+                /// 颗粒列表去除不要的物质分类
+                /// </summary>
+                public string str_kllb_DeleteClass { get; set; }
+                /// <summary>
+                /// 颗粒列表去除不要的物质分类
+                /// </summary>
+                public List<string> list_str_kllb_DeleteClass { get; set; }
             }
             #endregion
             #region 夹杂物占比
@@ -785,6 +794,21 @@ namespace OTSIncAReportApp
                     m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Add(str);
                 }
             }
+            m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = Convert.ToString(xmlutil2.Read("M_KLLBXX", "str_kllb_DeleteClass"));
+            m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Clear();
+            for (int i = 0; i < 100; i++)                              //取得所有元素列表
+            {
+                string str = xmlutil2.Read("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + i.ToString());
+                if (str == null)
+                {
+                    break;
+                }
+                else
+                {
+                    m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Add(str);
+                }
+            }
+
 
             //夹杂物占比
             m_mbszclass.M_JZWZB.b_ck_surface = Convert.ToBoolean(xmlutil2.Read("M_JZWZB", "b_ck_surface"));//夹杂物占比表

+ 52 - 30
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.Designer.cs

@@ -76,6 +76,9 @@
             this.label33 = new System.Windows.Forms.Label();
             this.label42 = new System.Windows.Forms.Label();
             this.groupBox8 = new System.Windows.Forms.GroupBox();
+            this.label11111 = new System.Windows.Forms.Label();
+            this.button5 = new System.Windows.Forms.Button();
+            this.tb_RemoveElements = new System.Windows.Forms.TextBox();
             this.ck_kllb_fjzt = new System.Windows.Forms.CheckBox();
             this.label111 = new System.Windows.Forms.Label();
             this.groupBox_zt = new System.Windows.Forms.GroupBox();
@@ -118,9 +121,8 @@
             this.groupBox9 = new System.Windows.Forms.GroupBox();
             this.label39 = new System.Windows.Forms.Label();
             this.cb_ParticleRange = new System.Windows.Forms.ComboBox();
-            this.tb_RemoveElements = new System.Windows.Forms.TextBox();
-            this.button5 = new System.Windows.Forms.Button();
-            this.label11111 = new System.Windows.Forms.Label();
+            this.delete_Class = new System.Windows.Forms.TextBox();
+            this.label_delete_Class = new System.Windows.Forms.Label();
             this.groupBox1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox6.SuspendLayout();
@@ -634,6 +636,8 @@
             // 
             // groupBox8
             // 
+            this.groupBox8.Controls.Add(this.label_delete_Class);
+            this.groupBox8.Controls.Add(this.delete_Class);
             this.groupBox8.Controls.Add(this.label11111);
             this.groupBox8.Controls.Add(this.button5);
             this.groupBox8.Controls.Add(this.tb_RemoveElements);
@@ -653,11 +657,39 @@
             this.groupBox8.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox8.Name = "groupBox8";
             this.groupBox8.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox8.Size = new System.Drawing.Size(263, 464);
+            this.groupBox8.Size = new System.Drawing.Size(263, 501);
             this.groupBox8.TabIndex = 6;
             this.groupBox8.TabStop = false;
             this.groupBox8.Text = "颗粒列表";
             // 
+            // label11111
+            // 
+            this.label11111.AutoSize = true;
+            this.label11111.Location = new System.Drawing.Point(14, 382);
+            this.label11111.Name = "label11111";
+            this.label11111.Size = new System.Drawing.Size(77, 12);
+            this.label11111.TabIndex = 61;
+            this.label11111.Text = "去除元素信息";
+            // 
+            // button5
+            // 
+            this.button5.Location = new System.Drawing.Point(202, 403);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(55, 23);
+            this.button5.TabIndex = 60;
+            this.button5.Text = "选取";
+            this.button5.UseVisualStyleBackColor = true;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
+            // tb_RemoveElements
+            // 
+            this.tb_RemoveElements.Location = new System.Drawing.Point(11, 405);
+            this.tb_RemoveElements.Margin = new System.Windows.Forms.Padding(2);
+            this.tb_RemoveElements.Name = "tb_RemoveElements";
+            this.tb_RemoveElements.ReadOnly = true;
+            this.tb_RemoveElements.Size = new System.Drawing.Size(181, 21);
+            this.tb_RemoveElements.TabIndex = 59;
+            // 
             // ck_kllb_fjzt
             // 
             this.ck_kllb_fjzt.AutoSize = true;
@@ -1002,7 +1034,7 @@
             this.groupBox211.Controls.Add(this.label1311);
             this.groupBox211.Controls.Add(this.label1211);
             this.groupBox211.Controls.Add(this.ck_jzwzb_surface);
-            this.groupBox211.Location = new System.Drawing.Point(3, 1706);
+            this.groupBox211.Location = new System.Drawing.Point(3, 1749);
             this.groupBox211.Name = "groupBox211";
             this.groupBox211.Size = new System.Drawing.Size(263, 81);
             this.groupBox211.TabIndex = 8;
@@ -1049,7 +1081,7 @@
             // groupBZ
             // 
             this.groupBZ.Controls.Add(this.textBox_strBZ);
-            this.groupBZ.Location = new System.Drawing.Point(5, 1793);
+            this.groupBZ.Location = new System.Drawing.Point(5, 1838);
             this.groupBZ.Name = "groupBZ";
             this.groupBZ.Size = new System.Drawing.Size(263, 139);
             this.groupBZ.TabIndex = 7;
@@ -1106,33 +1138,21 @@
             this.cb_ParticleRange.Size = new System.Drawing.Size(121, 20);
             this.cb_ParticleRange.TabIndex = 76;
             // 
-            // tb_RemoveElements
+            // delete_Class
             // 
-            this.tb_RemoveElements.Location = new System.Drawing.Point(11, 405);
-            this.tb_RemoveElements.Margin = new System.Windows.Forms.Padding(2);
-            this.tb_RemoveElements.Name = "tb_RemoveElements";
-            this.tb_RemoveElements.ReadOnly = true;
-            this.tb_RemoveElements.Size = new System.Drawing.Size(181, 21);
-            this.tb_RemoveElements.TabIndex = 59;
+            this.delete_Class.Location = new System.Drawing.Point(11, 464);
+            this.delete_Class.Name = "delete_Class";
+            this.delete_Class.Size = new System.Drawing.Size(181, 21);
+            this.delete_Class.TabIndex = 62;
             // 
-            // button5
+            // label_delete_Class
             // 
-            this.button5.Location = new System.Drawing.Point(202, 403);
-            this.button5.Name = "button5";
-            this.button5.Size = new System.Drawing.Size(55, 23);
-            this.button5.TabIndex = 60;
-            this.button5.Text = "选取";
-            this.button5.UseVisualStyleBackColor = true;
-            this.button5.Click += new System.EventHandler(this.button5_Click);
-            // 
-            // label11111
-            // 
-            this.label11111.AutoSize = true;
-            this.label11111.Location = new System.Drawing.Point(14, 382);
-            this.label11111.Name = "label11111";
-            this.label11111.Size = new System.Drawing.Size(77, 12);
-            this.label11111.TabIndex = 61;
-            this.label11111.Text = "去除元素信息";
+            this.label_delete_Class.AutoSize = true;
+            this.label_delete_Class.Location = new System.Drawing.Point(12, 440);
+            this.label_delete_Class.Name = "label_delete_Class";
+            this.label_delete_Class.Size = new System.Drawing.Size(101, 12);
+            this.label_delete_Class.TabIndex = 63;
+            this.label_delete_Class.Text = "去除指定物质分类";
             // 
             // OTSReport_TemplateDesignerRM
             // 
@@ -1282,5 +1302,7 @@
         private System.Windows.Forms.Button button5;
         private System.Windows.Forms.TextBox tb_RemoveElements;
         private System.Windows.Forms.Label label11111;
+        private System.Windows.Forms.Label label_delete_Class;
+        private System.Windows.Forms.TextBox delete_Class;
     }
 }

+ 38 - 1
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -595,6 +595,29 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 }
 
 
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass.ToString(), "M_KLLBXX", "str_kllb_DeleteClass");
+
+                for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i++)                              //去除元素列表
+                {
+                    xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[i].ToString(), "M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + i.ToString());
+                }
+
+                //然后判断一下xml中是否还存在之前比现有长度长的节点存在,存在则删除,防止后面再进行读取
+                for (int i = m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i < 1000; i++)
+                {
+                    string strxh = i.ToString();
+                    if (null != xmlutil.Read("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + strxh))
+                    {
+                        //删除该节点
+                        xmlutil.RemoveNode("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + strxh);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+
+
                 //夹杂物占比
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_surface.ToString(), "M_JZWZB", "b_ck_surface");//夹杂物占比表
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_chart.ToString(), "M_JZWZB", "b_ck_chart");//夹杂物占比图
@@ -671,7 +694,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p2 = cb_FrameChart_p2.Text;//颗粒帧图表行第二个字段的可选参数
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p2 = cb_FrameChart_p2.SelectedIndex;
 
-            m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_qcys = tb_RemoveElements.Text;
+            m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_qcys = tb_RemoveElements.Text;//去除不要的物质元素
+
+            m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = delete_Class.Text;//去除不要的物质分类
 
             if (ck_kllb_xsmk.Checked)
             {
@@ -682,6 +707,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx = Convert.ToInt32("1");
             }
 
+
             //m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_tb_kllb_sxys = tb_kllb_sxys.Text;//显示元素
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_ystx = ck_kllb_ystx.Checked;//原始图像
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_fdtx = ck_kllb_fdtx.Checked;//放大图像
@@ -771,6 +797,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             cb_FrameChart_p2.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p2;
             //cb_FrameChart_p3.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p3;
 
+            delete_Class.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass;
+
             //夹杂物占比
             ck_jzwzb_surface.Checked = m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_surface;//夹杂物占比表
             ck_jzwzb_chart.Checked = m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_chart;//夹杂物占比图
@@ -890,6 +918,15 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 m_OTSReport_Export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys.Add(after[i]);
             }
+            //拆分,物质分类
+            m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Clear();
+            for (int i=0;i< delete_Class.Text.Split(',').Length;i++)
+            {
+                if (delete_Class.Text.Split(',')[i]!="")
+                m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Add(delete_Class.Text.Split(',')[i]);
+            }
+            
+
 
             SaveTemplateParameters();
 

+ 41 - 11
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayField.cs

@@ -41,6 +41,7 @@ namespace OTSIncAReportGraph
         /// </summary>
         public DisplayField(Field fld, int fldwidth, int fldheight,Point screenPos)
         {
+         
             m_list_dparticle = new List<DisplayParticle>();
             m_list_Useparticle = new List<DisplayParticle>();
             m_id = System.Guid.NewGuid();
@@ -48,7 +49,9 @@ namespace OTSIncAReportGraph
            
             FieldID = fld.FieldID.ToString();
             Show_Rect = new Rectangle(screenPos, new Size(fldwidth, fldheight));
+
             Current_Rect = new Rectangle(screenPos, new Size(fldwidth, fldheight));
+
             OTSCoordinatePos = new PointF(thisfield_point.X, thisfield_point.Y);
             //先获取该Field中的所有Particle
             List<Particle> list_particle;
@@ -57,6 +60,7 @@ namespace OTSIncAReportGraph
             //然后将取出的数据,转换成Bitmap对象
             m_originalImage = DrawFunction.ReadImageFile(fld.FieldImage);
 
+            Bitmap dpImage = new Bitmap(fldwidth, fldheight);
             //再循环计算所有的Particle对象
             foreach (Particle particle in list_particle)
             {
@@ -68,6 +72,7 @@ namespace OTSIncAReportGraph
                 //创建DParticle颗粒
                 DisplayParticle dp = new DisplayParticle(particle);
 
+             
                 List<Segment> list_seg;
                 list_seg = particle.SegmentList;
 
@@ -83,7 +88,7 @@ namespace OTSIncAReportGraph
                     DisplaySegment ds = new DisplaySegment();
                     ds.Rect = new Rectangle(seg.Start + screenPos.X,
                      
-                       seg.Height + screenPos.Y,
+                        seg.Height + screenPos.Y,
                         seg.Length,
                         1);
 
@@ -95,35 +100,60 @@ namespace OTSIncAReportGraph
                   
                     //合成图像完成,开始抠取像素-----------------------------------------------------------------
                     int f_length = seg.Length;
-                    List<Color> ls_list_colors = new List<Color>();
+                 
                     for (int m = 0; m < f_length; m++)
                     {
                         //这里实现一下代码保护
                         int lsjs_x = seg.Start + m;
                      
                         int lsjs_y = seg.Height;
-                   
-                        ls_list_colors.Add(m_originalImage.GetPixel(lsjs_x,
-                           lsjs_y));
+
+                    
+
+
+                        var pixelColor = m_originalImage.GetPixel(lsjs_x, lsjs_y);
+
+
+
+                        try
+                        {
+                           
+                            dpImage.SetPixel(lsjs_x, lsjs_y, pixelColor);//ls_list_colors[m]
+                        }
+                        catch (Exception ex)
+                        {
+                            NLog.LogManager.GetCurrentClassLogger().Error(ex.Message.ToString());
+                        }
+                        
                     }
-                    //保存原BSE图中的颜色列表
-                    ds.List_Colors = ls_list_colors;
+                  
                     #endregion //------------------------------------------------------------------------------
 
                     list_dsegment.Add(ds);
-
+                   
                 }
 
           
-                dp.SetPaintState(PaintState.NORMALPAINT);
+                dp.SetPaintState(PaintState.PAINT);
 
                 dp.DSegments = list_dsegment;
 
-               
+
                 dp.Rect = dp.GetRectFromDSegment();
                 dp.GPath = dp.GetRegionFromDSegments();
                 dp.SmallRect = dp.GetSmallRectangleFromRect();
+                var currentRect = new RectangleF(dp.Rect.X - screenPos.X, dp.Rect.Y - screenPos.Y, dp.Rect.Width, dp.Rect.Height);
 
+                try 
+                {
+                    var dpImg = dpImage.Clone(currentRect, dpImage.PixelFormat);
+                    dp.SetImage(dpImg);
+                } catch (Exception ex)
+                {
+                    NLog.LogManager.GetCurrentClassLogger().Error(ex.ToString());
+                }
+             
+               
                
                 m_list_dparticle.Add(dp);
                 if (dp.XRayId > -1)
@@ -246,7 +276,7 @@ namespace OTSIncAReportGraph
                 DisplayParticle dp = (DisplayParticle)item;
                 if (dp.IsDeleted==false)
                 {
-                    if (dp.GetPaintState() == PaintState.NORMALPAINT)
+                    if (dp.GetPaintState() == PaintState.PAINT)
                     {
                         item.OnPaint(e);
                     }

+ 53 - 19
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayParticle.cs

@@ -17,7 +17,7 @@ namespace OTSIncAReportGraph
     /// </summary>
     public enum PaintState
     {
-        NORMALPAINT = 0,
+        PAINT = 0,
         NOPAINT = 1,
         CONCISEPAINT=2,// display as a "+"
  
@@ -66,7 +66,7 @@ namespace OTSIncAReportGraph
         private bool m_isSelected;
         private bool m_isDeleted;
         private bool m_isMouseOver;
-        private PaintState m_paintState = PaintState.NORMALPAINT;
+        private PaintState m_paintState = PaintState.PAINT;
         private ParticleShowXray m_operator_showxray = ParticleShowXray.NODISPLAY;//选定显示XRAY,不显示XRAY,默认应为(不显示XRAY)
         private bool m_isdragging;
         private PointF m_dragingpoint;
@@ -76,6 +76,8 @@ namespace OTSIncAReportGraph
         private List<DisplaySegment> m_listdsegment = new List<DisplaySegment>();
         private DisplayState m_displayState;
 
+        private Image m_image;
+
         private string m_sort_type = "从大到小";
         private float m_f_size = 0;
         private string m_str_lj = "颗粒粒级";
@@ -135,6 +137,7 @@ namespace OTSIncAReportGraph
             m_id = System.Guid.NewGuid();
             objParticleData = part;
             this.Color = GetColorBySTDTypeIDForBSEAndSorImage(part.TypeColor, part.TypeId);
+           
         }
 
         public DisplayParticle(List<DisplaySegment> in_list_segment, DisplayParticle in_particle)
@@ -283,7 +286,12 @@ namespace OTSIncAReportGraph
         {
             return new DisplayParticle(this.m_listdsegment, this);
         }
+        public PointF GetCenterPoint()
+        {
 
+            return new PointF(m_rect.X + m_rect.Width / 2, m_rect.Y + m_rect.Height / 2);
+        
+        }
         /// <summary>
         /// ID
         /// </summary>
@@ -509,6 +517,16 @@ namespace OTSIncAReportGraph
         public bool IsDeleted { get => m_isDeleted; set => m_isDeleted = value; }
         public bool IsMouseOver { get => m_isMouseOver; set => m_isMouseOver = value; }
 
+        public Image GetImage()
+        {
+            return m_image;
+        }
+
+        public void SetImage(Image value)
+        {
+            m_image = value;
+        }
+
         public DisplayState GetDisplayState()
         {
             if (m_isDeleted)
@@ -552,14 +570,35 @@ namespace OTSIncAReportGraph
                                     ButtonBorderStyle.Solid);
             }
            
-            if (GetPaintState() == PaintState.NORMALPAINT)
+            if (GetPaintState() == PaintState.PAINT)
             {
-             
-                //调用绘制基本线
-                foreach (DisplaySegment item in m_listdsegment)
+                DisplaySegment ds = m_listdsegment[0];
+                if (ds.ShowMode == SegmentShowMode.DRAWPOINT)
                 {
-                    item.OnPaint(e);
+                    try
+                    {
+                        e.Graphics.DrawImage(m_image, m_rect);
+
+                    }
+                    catch (Exception ex)
+                    {
+                        NLog.LogManager.GetCurrentClassLogger().Error(ex.ToString());
+                    }
+                  
+
                 }
+                else 
+                {
+                    //调用绘制基本线
+                    foreach (DisplaySegment item in m_listdsegment)
+                    {
+                        item.OnPaint(e);
+                    }
+
+                }
+             
+              
+
 
 
             }
@@ -757,18 +796,13 @@ namespace OTSIncAReportGraph
                 }
             }
 
-            //对矩形Rect大小位置进行修补,因为画线是内边框,并且计算出来的位置也是向内占用一像素的,
-            //正常应该是 +2,但实际效果,+3也才勉强够用,因为放大缩小画笔宽度影响的
-            rect.X = x1 - 2;
-            rect.Y = y1 - 3;
-            rect.Width = i_width - rect.X + 2;
-            rect.Height = i_height - rect.Y + 3;
-
-            //判断如果太小,就给个最小值吧
-            if (rect.Width < 8)
-                rect.Width = 8;
-            if (rect.Height < 8)
-                rect.Height = 8;
+  
+            rect.X = x1 ;
+            rect.Y = y1 ;
+            rect.Width = i_width - rect.X ;
+            rect.Height = i_height - rect.Y ;
+
+        
 
             return rect;
         }

+ 15 - 12
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplaySegment.cs

@@ -154,6 +154,7 @@ namespace OTSIncAReportGraph
         /// <param name="e"></param>
         public override void OnPaint(PaintEventArgs e)
         {
+          
             //两种绘制模式的选择,绘线还是缓点
             if (show_mode == SegmentShowMode.DRAWLINE)
             {
@@ -161,18 +162,20 @@ namespace OTSIncAReportGraph
                 Pen p = new Pen(m_color, m_PenWidthAndHeight + 1f);//这里加1f的宽度后,用线组成多边形不会分散,效果正常,原因不知,但目前没有遇到问题
                 e.Graphics.DrawLine(p, Rect.X, Rect.Y, Rect.X + Rect.Width, Rect.Y);
             }
-            else if (show_mode == SegmentShowMode.DRAWPOINT)
-            {
-                //根据color的序列,显示绘制的原像素的图像。
-                for (int i = 0; i < m_list_colors.Count(); i++)
-                {
-                    e.Graphics.FillRectangle(new SolidBrush(m_list_colors[i]),
-                                            this.Rect.X + (i * m_PenWidthAndHeight) + 1f,
-                            this.Rect.Y,
-                            m_PenWidthAndHeight,
-                            m_PenWidthAndHeight);
-                }
-            }
+            //else if (show_mode == SegmentShowMode.DRAWPOINT)
+            //{
+            //    //根据color的序列,显示绘制的原像素的图像。
+            //    for (int i = 0; i < m_list_colors.Count(); i++)
+            //    {
+                 
+            //        e.Graphics.FillRectangle(new SolidBrush(m_list_colors[i]),
+            //                                this.Rect.X + (i * m_PenWidthAndHeight) + 1f,
+            //                this.Rect.Y,
+            //                m_PenWidthAndHeight,
+            //                m_PenWidthAndHeight);
+                   
+            //    }
+            //}
         }
     }
 

+ 4 - 1
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.cs

@@ -652,7 +652,10 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             //     Export_ReportTemplate export_ReportTemplate = new Export_ReportTemplate(m_otsreport_export);
             DataTable dataTable = export_ReportTemplate.Get_dev_kllb_data(TemplateClass);
 
-            for (int i=0;i<dataTable.Rows.Count;i++)
+           
+
+
+            for (int i = 0; i < dataTable.Rows.Count; i++)
             {
                 dataTable.Rows[i]["Class"] = subscript.Getsubscriptstring(dataTable.Rows[i]["Class"].ToString());
             }

+ 11 - 3
OTSPartA_STDEditor/Form_ConstantsEditor2.cs

@@ -1561,7 +1561,7 @@ namespace OTSPartA_STDEditor
                         OtsDatabaseCommand.ExecuteNonQuery();
                         OtsDatabaseCommand.CommandText = "CREATE TABLE MaxEDSRules (MaxEDSTime INT,UsingElementList TEXT, UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT)";
                         OtsDatabaseCommand.ExecuteNonQuery();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE STDGroups (id INTEGER,name TEXT, color INTEGER,iorder INTEGER)";
+                        OtsDatabaseCommand.CommandText = "CREATE TABLE STDGroups (id INTEGER,name TEXT, color TEXT,iorder INTEGER)";
                         OtsDatabaseCommand.ExecuteNonQuery();
                         OtsDatabaseCommand.CommandText = "CREATE TABLE STDMinerals (id INTEGER,SPEC BLOB)";
                         OtsDatabaseCommand.ExecuteNonQuery();
@@ -1571,11 +1571,19 @@ namespace OTSPartA_STDEditor
 
                         foreach (DataRow item in OreDatabasedt.Rows)
                         {
-                            OtsDatabaseCommand.CommandText = "insert into ClassifySTD (Density,BSE,Formula,StrName,Color,STDId,ListNum,GroupId,KeyElementList,SubElementList,UsingImgPropertyList,UsingOtherPropertyList,Expression,Hardness,Electrical_conductivity,Element) values ( '" + item["density"].ToString() + "','" + item["BSEValue"].ToString() + "','" + item["formula"].ToString() + "','" + item["name"].ToString() + "','" + item["color"].ToString() + "'," + item["id"].ToString() + "," + listnum.ToString() + @",0,' ',' ',' ',' ',' ',' ',' ',' ')";
+                            int n = 0;
+                            string STRcolor = "#0";
+                            if(int.TryParse(item["color"].ToString(),out n))
+                            {
+                                STRcolor = "#"+n.ToString("X6");
+                            }
+                            int idaAdd10 = 0;
+                            idaAdd10 = int.Parse(item["id"].ToString()) + 10;
+                            OtsDatabaseCommand.CommandText = "insert into ClassifySTD (Density,BSE,Formula,StrName,Color,STDId,ListNum,GroupId,KeyElementList,SubElementList,UsingImgPropertyList,UsingOtherPropertyList,Expression,Hardness,Electrical_conductivity,Element) values ( '" + item["density"].ToString() + "','" + item["BSEValue"].ToString() + "','" + item["formula"].ToString() + "','" + item["name"].ToString() + "','" + STRcolor + "'," + idaAdd10.ToString() + "," + listnum.ToString() + @",0,' ',' ',' ',' ',' ',' ',' ',' ')";
                             OtsDatabaseCommand.ExecuteNonQuery();
                             listnum++;
                             OtsDatabaseCommand.CommandText = "insert into STDMinerals (id,SPEC) values (@id,@SPEC)";
-                            OtsDatabaseCommand.Parameters.Add("id", DbType.Int32).Value = item["id"];
+                            OtsDatabaseCommand.Parameters.Add("id", DbType.Int32).Value = idaAdd10;
                             OtsDatabaseCommand.Parameters.Add("SPEC", DbType.Binary).Value = item["SPEC"];
                             OtsDatabaseCommand.ExecuteNonQuery();
                         }