Parcourir la source

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

User il y a 1 an
Parent
commit
f2c74f5085

+ 2 - 1
OTSCPP/OTSRptCalculate/GBCal/CGBCalculate.cpp

@@ -1023,7 +1023,8 @@ namespace OTSGBCalculate
 		int nAfterCalNo = 0;
 		for (auto OTSField : myOTSFields)
 		{
-			for (auto part : OTSField->GetParticleList())
+			auto fldParts = OTSField->GetParticleList();
+			for (auto part : fldParts)
 			{
 				CPoint fieldPos = OTSField->GetPosition();
 			

+ 190 - 16
OTSCPP/OTSRptCalculate/GBCal/CGBLevel.cpp

@@ -286,6 +286,193 @@ namespace OTSGBCalculate
 
 		return  m_FeretDiameterMax;
 	}
+	double CGBLevel::GetThinLength()
+	{
+		// get grade
+		// A
+		double dLengthAll = 0;
+		int nSize;
+		switch (m_nLevel)
+		{
+		case GB_LEVEL_TYPE::A_TYPE:
+
+
+			for (auto pAparticle : m_GBField->listAThinParticles)
+			{
+
+
+				double dLength = pAparticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return dLengthAll;
+
+			break;
+		case  GB_LEVEL_TYPE::B_TYPE:
+
+			dLengthAll = 0;
+			for (auto pBparticle : m_GBField->listBThinParticles)
+			{
+
+				double dLength = pBparticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return	dLengthAll;
+
+		case  GB_LEVEL_TYPE::C_TYPE:
+			dLengthAll = 0;
+			for (auto pCparticle : m_GBField->listCThinParticles)
+			{
+
+				double dLength = pCparticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return	dLengthAll;
+			break;
+		case  GB_LEVEL_TYPE::D_TYPE:
+
+			nSize = (int)m_GBField->listDThinParticles.size();
+			return	nSize;
+			break;
+
+		case  GB_LEVEL_TYPE::DSulfide_TYPE:
+
+			nSize = (int)m_GBField->listDSulfideThinParticles.size();
+			return	nSize;
+			break;
+
+		}
+
+
+		return 0;
+	}
+	double CGBLevel::GetWideLength()
+	{
+		double dLengthAll = 0;
+		int nSize;
+		switch (m_nLevel)
+		{
+		case GB_LEVEL_TYPE::A_TYPE:
+
+
+			for (auto pAparticle : m_GBField->listAWideParticles)
+			{
+
+				double dLength = pAparticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return dLengthAll;
+
+			break;
+		case  GB_LEVEL_TYPE::B_TYPE:
+
+			dLengthAll = 0;
+			for (auto pBparticle : m_GBField->listBWideParticles)
+			{
+
+				double dLength = pBparticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return	dLengthAll;
+
+		case  GB_LEVEL_TYPE::C_TYPE:
+			dLengthAll = 0;
+			for (auto pCparticle : m_GBField->listCWideParticles)
+			{
+
+				double dLength = pCparticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return	dLengthAll;
+
+
+			break;
+		case  GB_LEVEL_TYPE::D_TYPE:
+
+			nSize = (int)m_GBField->listDWideParticles.size();
+			return	nSize;
+			break;
+		case  GB_LEVEL_TYPE::DSulfide_TYPE:
+
+			nSize = (int)m_GBField->listDSulfideWideParticles.size();
+			return	nSize;
+			break;
+		}
+
+		return 0;
+	}
+	double CGBLevel::GetSuperLength()
+	{
+		double dLengthAll = 0;
+		int nSize;
+		switch (m_nLevel)
+		{
+		case GB_LEVEL_TYPE::A_TYPE:
+
+
+			for (auto pAparticle : m_GBField->listASuperParticles)
+			{
+
+				double dLength = pAparticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return dLengthAll;
+
+			break;
+		case  GB_LEVEL_TYPE::B_TYPE:
+
+			dLengthAll = 0;
+			for (auto pBparticle : m_GBField->listBSuperParticles)
+			{
+
+				double dLength = pBparticle->GetDMax();
+
+				dLengthAll += dLength;
+			}
+			return	dLengthAll;
+
+		case  GB_LEVEL_TYPE::C_TYPE:
+			dLengthAll = 0;
+			for (auto pParticle : m_GBField->listCSuperParticles)
+			{
+
+				double dLength = pParticle->GetDMax();
+
+
+				dLengthAll += dLength;
+			}
+			return	dLengthAll;
+
+
+			break;
+		case  GB_LEVEL_TYPE::D_TYPE:
+
+			nSize = (int)m_GBField->listDSuperParticles.size();
+			return	nSize;
+			break;
+		case  GB_LEVEL_TYPE::DSulfide_TYPE:
+
+			nSize = (int)m_GBField->listDSulfideSuperParticles.size();
+			return	nSize;
+			break;
+		}
+
+		return 0;
+	}
+	
 	GB_GRADE_TYPE GetAGrade(double dLengthAll)
 	{
 
@@ -534,22 +721,9 @@ namespace OTSGBCalculate
 		return _T("0.0");
 	}
 
-	/*void CGBLevel::Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode)
-	{
-		xmls::xInt xLevel;
-		xmls::Slo slo;
-		slo.Register("Level", &xLevel);
-		if (isStoring)
-		{
-			xLevel = (int)m_nLevel;
-			slo.Serialize(true, classDoc, rootNode);
-		}
-		else
-		{
-			slo.Serialize(false, classDoc, rootNode);
-			m_nLevel = (GB_LEVEL_TYPE)xLevel.value();
-		}
-	}*/
+	
+
+	
 
 	// cleanup 
 	void CGBLevel::Cleanup()

+ 9 - 0
OTSCPP/OTSRptCalculate/GBCal/CGBLevel.h

@@ -30,6 +30,14 @@ namespace OTSGBCalculate
 		
 		double GetMaxFeretDiameter();
 
+		
+		double GetThinLength();
+		
+		double GetWideLength();
+		
+		double GetSuperLength();
+	
+
 	protected:
 
 		// cleanup 
@@ -54,6 +62,7 @@ namespace OTSGBCalculate
 	GB_GRADE_TYPE  __declspec(dllexport) GetCGrade(double dLengthAll);
 	GB_GRADE_TYPE  __declspec(dllexport) GetDGrade(int nSize);
 	CString  __declspec(dllexport) GetDSGrade(double dFeretDiameterMax);
+	
 
 
 }

+ 27 - 20
OTSCPP/OTSRptCalculate/GBCal/GBFieldData.cpp

@@ -53,6 +53,12 @@ namespace OTSGBCalculate
 			}
 			return gr;
 		}
+		CString DoubleToCString(double d)
+		{
+			CString s;
+			s.Format(_T("%.0lf"), d);
+			return s;
+		}
 
 
 	}
@@ -285,7 +291,7 @@ namespace OTSGBCalculate
 			}
 			auto w = pParticle->GetDMin();
 		
-			if (w == 0 || w<2)
+			if (w == 0 )
 			{
 				continue;
 			}
@@ -535,7 +541,7 @@ namespace OTSGBCalculate
 			//check the denominator is zero or not
 			auto w = pParticle->GetDMin();
 
-			if (w == 0|| w<2)
+			if (w == 0)
 			{
 				continue;
 			}
@@ -708,7 +714,7 @@ namespace OTSGBCalculate
 			}
 			auto w = pParticle->GetDMin();
 
-			if (w == 0||w<2)
+			if (w == 0)
 			{
 				continue;
 			}
@@ -1126,11 +1132,12 @@ namespace OTSGBCalculate
 			break;
 		}
 
-		if (dWidth < dMin)
-		{
-			return GB_WIDTH_TYPE::INVALID;//СÓÚ2um²»¿¼ÂÇ
-		}
-		else if (dWidth >= dMin && dWidth <= dMax)
+		//if (dWidth < dMin)
+		//{
+		//	return GB_WIDTH_TYPE::INVALID;//СÓÚ2um²»¿¼ÂÇ
+		//}
+		/*else*/
+		if (dWidth >= 0 && dWidth <= dMax)
 		{
 			return GB_WIDTH_TYPE::THIN;
 		}
@@ -1374,18 +1381,18 @@ namespace OTSGBCalculate
 	std::string CGBFieldData::GetGBGradeString()
 	{
 		std::string grdStr;
-		CString Astring = _T("A:") + GetGradeString(GetALevel()->GetThinGrade()) + _T(" ") +			
-			GetGradeString(GetALevel()->GetWideGrade()) + _T(" ") +
-			GetGradeString(GetALevel()->GetSuperGrade()) + _T(" ");
-		CString Bstring = _T("B:") + GetGradeString(GetBLevel()->GetThinGrade()) + _T(" ") +			
-			GetGradeString(GetBLevel()->GetWideGrade()) + _T(" ") +
-			GetGradeString(GetBLevel()->GetSuperGrade()) + _T(" ");
-		CString Cstring = _T("C:") + GetGradeString(GetCLevel()->GetThinGrade()) + _T(" ") +
-			GetGradeString(GetCLevel()->GetWideGrade()) + _T(" ") +
-			GetGradeString(GetCLevel()->GetSuperGrade()) + _T(" ");
-		CString Dstring = _T("D:") + GetGradeString(GetDLevel()->GetThinGrade()) + _T(" ") +
-			GetGradeString(GetDLevel()->GetWideGrade()) + _T(" ") +
-			GetGradeString(GetDLevel()->GetSuperGrade()) + _T(" ");
+		CString Astring = _T("A:") + GetGradeString(m_pALevel->GetThinGrade())+_T("(")+DoubleToCString(m_pALevel->GetThinLength())+_T(")") + _T(" ") +
+			GetGradeString(m_pALevel->GetWideGrade()) + _T("(") + DoubleToCString(m_pALevel->GetWideLength()) + _T(")") + _T(" ") +
+			GetGradeString(m_pALevel->GetSuperGrade()) + _T("(") + DoubleToCString(m_pALevel->GetSuperLength()) + _T(")") + _T(" ");
+		CString Bstring = _T("B:") + GetGradeString(m_pBLevel->GetThinGrade()) + _T("(") + DoubleToCString(m_pBLevel->GetThinLength()) + _T(")") + _T(" ") +
+			GetGradeString(m_pBLevel->GetWideGrade()) + _T("(") + DoubleToCString(m_pBLevel->GetWideLength()) + _T(")") + _T(" ") +
+			GetGradeString(m_pBLevel->GetSuperGrade()) + _T("(")  + DoubleToCString(m_pBLevel->GetSuperLength()) + _T(")") + _T(" ");
+		CString Cstring = _T("C:") + GetGradeString(m_pCLevel->GetThinGrade()) + _T("(")+ DoubleToCString(m_pCLevel->GetThinLength()) + _T(")") + _T(" ") +
+			GetGradeString(m_pCLevel->GetWideGrade()) + _T("(") + DoubleToCString(m_pCLevel->GetWideLength()) + _T(")") + _T(" ") +
+			GetGradeString(m_pCLevel->GetSuperGrade()) + _T("(") + DoubleToCString(m_pCLevel->GetSuperLength()) + _T(")") + _T(" ");
+		CString Dstring = _T("D:") + GetGradeString(m_pDLevel->GetThinGrade())+_T("(") + DoubleToCString(m_pDLevel->GetThinLength()) + _T(")") + _T(" ") +
+			GetGradeString(m_pDLevel->GetWideGrade()) + _T("(") + DoubleToCString(m_pDLevel->GetWideLength()) + _T(")") + _T(" ") +
+			GetGradeString(m_pDLevel->GetSuperGrade()) + _T("(") + DoubleToCString(m_pDLevel->GetSuperLength()) + _T(")") + _T(" ");
 		if (calcuType == GB_METHODE_TYPE::METHODE_2)
 		{
 			CString DSulstring = _T("DSulfide:") + GetGradeString(GetDSulfideLevel()->GetThinGrade()) + _T(" ") +

+ 1 - 2
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -220,8 +220,7 @@
     </Reference>
     <Reference Include="OINA.Extender, Version=6.1.0.0, Culture=neutral, PublicKeyToken=5efad68c95e0364e, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\OpenDll\OxfordApi61Dll\OINA.Extender.dll</HintPath>
-      <Private>False</Private>
+      <HintPath>E:\OTSSoftWare\OTS2_MiningDev\OpenDll\OxfordApi50Dll\OINA.Extender.dll</HintPath>
     </Reference>
     <Reference Include="OpenCvSharp">
       <HintPath>..\OpenDll\OpenCvSharp\OpenCvSharp.dll</HintPath>

+ 65 - 54
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -114,7 +114,6 @@ namespace OTSIncAReportGraph.Controls
         //国际化存储信息
         Hashtable resourceTable;
         ResultFile resultFile = null;
-
         #region 缩放
         //缩放的增大缩小的增量
         private const float const_zoom_increment = 0.1f;
@@ -205,10 +204,6 @@ namespace OTSIncAReportGraph.Controls
             //向父窗体注册键盘按键事件
             this.Parent.KeyDown += new KeyEventHandler(Control_DrawDistrbutionSortImage_KeyDown);
             this.Parent.KeyUp += new KeyEventHandler(Control_DrawDistrbutionSortImage_KeyUp);
-     
-      
-
-
 
             //设置双缓冲
             SetDoubleBufferByIsDraw();
@@ -558,13 +553,15 @@ namespace OTSIncAReportGraph.Controls
                 else 
                 {
                     this.Cursor = Cursors.Hand;
-
                     foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                     {
                         foreach (DisplayParticle ls_dp in ls_sortparticledistribution.List_DParticle)
                         {
-
-                            ls_dp.IsDragging = true;
+                            PointF ct = ls_dp.GetCenterPoint();
+                            if (ct.X > -100 && ct.X < this.Width + 100 && ct.Y > -100 && ct.Y < this.Height + 100)
+                            {
+                                ls_dp.IsDragging = true;
+                            }
                             ls_dp.DraggingPoint = e.Location;
                         }
                     }
@@ -637,17 +634,34 @@ namespace OTSIncAReportGraph.Controls
                 }
                 else //is draging
                 {
-                    foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
+                    if (m_isDrag)
                     {
-                        foreach (DisplayParticle item in ls_sortparticledistribution.List_DParticle)
+                        foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                         {
-                            if (true == item.IsDragging)
+                            foreach (DisplayParticle item in ls_sortparticledistribution.List_DParticle)
                             {
+                                item.DraggingMove(e.Location);
                                 item.IsSelect = false;
                                 item.IsDragging = false;
                                 item.DraggingPoint = Point.Empty;
+                                PointF ct = item.GetCenterPoint();
+                                if (ct.X < -100 || ct.X > this.Width + 100 || ct.Y < -100 || ct.Y > this.Height + 100)
+                                {
+                                    item.SetPaintState(PaintState.NOPAINT);//the particles which are out of screen don't display.to speed up the display efficient.
+
+                                }
+                                else
+                                {
+                                    item.SetPaintState(PaintState.PAINT);
+                                }
                             }
                         }
+                        foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
+                        {
+                            ls_sortparticledistribution.RectF = new RectangleF(ls_sortparticledistribution.RectF.Location.X + e.X - m_beforedrag_pointf.X,
+                                     ls_sortparticledistribution.RectF.Location.Y + e.Y - m_beforedrag_pointf.Y, ls_sortparticledistribution.RectF.Width, ls_sortparticledistribution.RectF.Height);
+                        }
+                        m_beforedrag_pointf = e.Location;
                     }
                     m_isDrag = false;
                     //在颗粒上点击,则对该颗粒附加显示x-ray的状态,同时将其它颗粒上显示x-ray的状态全部去掉。
@@ -769,41 +783,41 @@ namespace OTSIncAReportGraph.Controls
 
         protected override void OnMouseMove(MouseEventArgs e)
         {
-         
-                if (true == m_SelectTool.IsSelecting)
+
+            if (true == m_SelectTool.IsSelecting)
+            {
+                if (e.Button == MouseButtons.Left)
                 {
-                    if (e.Button == MouseButtons.Left)
+                    if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
                     {
-                        if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
-                        {
-                            //右下拖动
-                            m_SelectTool.Rect = new RectangleF(m_SelectTool.StartPoint, new SizeF(e.Location.X - m_SelectTool.StartPoint.X, e.Location.Y - m_SelectTool.StartPoint.Y));
-                        }
-                        if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
-                        {
-                            //左上拖动
-                            PointF lspointf = new PointF(e.Location.X, e.Location.Y);
-                            m_SelectTool.Rect = new RectangleF(lspointf, new SizeF(m_SelectTool.StartPoint.X - e.Location.X, m_SelectTool.StartPoint.Y - e.Location.Y));
-                        }
-                        if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
-                        {
-                            //右上,这种画法,需要将左下,右上两点转换成左上,右下
-                            PointF left_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
-                            PointF right_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
-                            m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
+                        //右下拖动
+                        m_SelectTool.Rect = new RectangleF(m_SelectTool.StartPoint, new SizeF(e.Location.X - m_SelectTool.StartPoint.X, e.Location.Y - m_SelectTool.StartPoint.Y));
+                    }
+                    if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
+                    {
+                        //左上拖动
+                        PointF lspointf = new PointF(e.Location.X, e.Location.Y);
+                        m_SelectTool.Rect = new RectangleF(lspointf, new SizeF(m_SelectTool.StartPoint.X - e.Location.X, m_SelectTool.StartPoint.Y - e.Location.Y));
+                    }
+                    if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
+                    {
+                        //右上,这种画法,需要将左下,右上两点转换成左上,右下
+                        PointF left_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
+                        PointF right_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
+                        m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
 
-                        }
-                        if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
-                        {
-                            //左下,这种画法,需要将左下,右上两点转换成左上,右下
-                            PointF left_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
-                            PointF right_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
-                            m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
-                        }
+                    }
+                    if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
+                    {
+                        //左下,这种画法,需要将左下,右上两点转换成左上,右下
+                        PointF left_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
+                        PointF right_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
+                        m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
                     }
                 }
-                else
-                {
+            }
+            else
+            {
                 foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                 {
                     foreach (DisplayParticle dp in ls_sortparticledistribution.List_DParticle)
@@ -836,7 +850,7 @@ namespace OTSIncAReportGraph.Controls
 
                         if (true == dp.IsDragging)
                         {
-                            dp.DraggingMove(e.Location);
+                            //dp.DraggingMove(e.Location);
 
                             if (dp.GetShowRect().Left < ClientRectangle.Width * 1f / 50 || dp.GetShowRect().Right > ClientRectangle.Width * 48f / 50f || dp.GetShowRect().Top < 0 || dp.GetShowRect().Bottom > this.Height)
                             {
@@ -852,18 +866,16 @@ namespace OTSIncAReportGraph.Controls
 
                 //如果在拖动中
                 if (true == m_isDrag)
+                {
+                    //同样重新计算backrectf的坐标
+                    foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                     {
-                        //同样重新计算backrectf的坐标
-                        foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
-                        {
-                            ls_sortparticledistribution.RectF = new RectangleF(ls_sortparticledistribution.RectF.Location.X + e.X - m_beforedrag_pointf.X,
-                                     ls_sortparticledistribution.RectF.Location.Y + e.Y - m_beforedrag_pointf.Y, ls_sortparticledistribution.RectF.Width, ls_sortparticledistribution.RectF.Height);
-                        }
-                        m_beforedrag_pointf = e.Location;
+                        ls_sortparticledistribution.RectF = new RectangleF(ls_sortparticledistribution.RectF.Location.X + e.X - m_beforedrag_pointf.X,
+                                 ls_sortparticledistribution.RectF.Location.Y + e.Y - m_beforedrag_pointf.Y, ls_sortparticledistribution.RectF.Width, ls_sortparticledistribution.RectF.Height);
                     }
+                    m_beforedrag_pointf = e.Location;
                 }
-            
-
+            }
 
             #region 向报告程序右下角,传送鼠标颗粒等相关信息
             //然后这里还要将鼠标移动经过的过程,传输给reportapp中,为了能让reportapp能显示出来
@@ -946,8 +958,6 @@ namespace OTSIncAReportGraph.Controls
                 Point sem_point = (Point)in_obj;
 
                 //第一步,连接电镜
-                
-
 
                 //第二步,移动到指定位置,先读取再设置
                 if (m_imgDisHelper.ConnectToIpcSvr())
@@ -1105,7 +1115,8 @@ namespace OTSIncAReportGraph.Controls
         /// </summary>
         public void GetDistrbutionSortimage_ByQuery(Dictionary<OTS_REPORT_PROP_GRID_ITEMS,ConditionItem> currentConditionValue)
         {
-           
+            PointF pointF = new PointF(0, 0);
+            ImageZoom(1, pointF);
             Dictionary<string, List<DisplayParticle>> FLNameList = new System.Collections.Generic.Dictionary<string, List<DisplayParticle>>();
 
             m_list_sortparticledistribution.Clear();

+ 43 - 28
OxfordExtenderWrapper/Form1.Designer.cs

@@ -29,10 +29,10 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-            System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
-            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
-            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+            System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
@@ -178,6 +178,7 @@
             this.显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.隐藏ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.button17 = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.拍图.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pBImage)).BeginInit();
@@ -921,6 +922,7 @@
             // 
             // groupBox1
             // 
+            this.groupBox1.Controls.Add(this.button17);
             this.groupBox1.Controls.Add(this.button27);
             this.groupBox1.Controls.Add(this.button2);
             this.groupBox1.Controls.Add(this.button23);
@@ -1006,15 +1008,15 @@
             // 
             // button27
             // 
-            this.button27.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.button27.Location = new System.Drawing.Point(4, 114);
+            this.button27.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
+            this.button27.Location = new System.Drawing.Point(4, 58);
             this.button27.Margin = new System.Windows.Forms.Padding(2);
             this.button27.Name = "button27";
-            this.button27.Size = new System.Drawing.Size(39, 143);
+            this.button27.Size = new System.Drawing.Size(39, 125);
             this.button27.TabIndex = 79;
             this.button27.Text = "连接能谱";
             this.button27.UseVisualStyleBackColor = true;
-            this.button27.Click += new System.EventHandler(this.button27_Click);
+            this.button27.Click += new System.EventHandler(this.btnConn_Click);
             // 
             // 拍图
             // 
@@ -1190,7 +1192,7 @@
             // 
             // button28
             // 
-            this.button28.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.button28.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
             this.button28.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.button28.Location = new System.Drawing.Point(501, 147);
             this.button28.Margin = new System.Windows.Forms.Padding(2);
@@ -1203,7 +1205,7 @@
             // 
             // btnTest
             // 
-            this.btnTest.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.btnTest.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
             this.btnTest.Location = new System.Drawing.Point(499, 26);
             this.btnTest.Margin = new System.Windows.Forms.Padding(2);
             this.btnTest.Name = "btnTest";
@@ -1226,7 +1228,7 @@
             // 
             // button29
             // 
-            this.button29.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.button29.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
             this.button29.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.button29.Location = new System.Drawing.Point(501, 293);
             this.button29.Margin = new System.Windows.Forms.Padding(2);
@@ -1696,25 +1698,25 @@
             // 
             // chart1
             // 
-            chartArea1.Name = "ChartArea1";
-            this.chart1.ChartAreas.Add(chartArea1);
-            legend1.Alignment = System.Drawing.StringAlignment.Center;
-            legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
-            legend1.Name = "Legend1";
-            this.chart1.Legends.Add(legend1);
+            chartArea3.Name = "ChartArea1";
+            this.chart1.ChartAreas.Add(chartArea3);
+            legend3.Alignment = System.Drawing.StringAlignment.Center;
+            legend3.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+            legend3.Name = "Legend1";
+            this.chart1.Legends.Add(legend3);
             this.chart1.Location = new System.Drawing.Point(554, 31);
             this.chart1.Margin = new System.Windows.Forms.Padding(2);
             this.chart1.Name = "chart1";
-            series1.ChartArea = "ChartArea1";
-            series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
-            series1.Legend = "Legend1";
-            series1.Name = "Series1";
-            series2.ChartArea = "ChartArea1";
-            series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
-            series2.Legend = "Legend1";
-            series2.Name = "Series2";
-            this.chart1.Series.Add(series1);
-            this.chart1.Series.Add(series2);
+            series5.ChartArea = "ChartArea1";
+            series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
+            series5.Legend = "Legend1";
+            series5.Name = "Series1";
+            series6.ChartArea = "ChartArea1";
+            series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
+            series6.Legend = "Legend1";
+            series6.Name = "Series2";
+            this.chart1.Series.Add(series5);
+            this.chart1.Series.Add(series6);
             this.chart1.Size = new System.Drawing.Size(593, 352);
             this.chart1.TabIndex = 3;
             this.chart1.Text = "chart1";
@@ -1779,6 +1781,18 @@
             this.退出ToolStripMenuItem.Text = "退出";
             this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
             // 
+            // button17
+            // 
+            this.button17.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
+            this.button17.Location = new System.Drawing.Point(4, 225);
+            this.button17.Margin = new System.Windows.Forms.Padding(2);
+            this.button17.Name = "button17";
+            this.button17.Size = new System.Drawing.Size(39, 126);
+            this.button17.TabIndex = 79;
+            this.button17.Text = "释放控制权";
+            this.button17.UseVisualStyleBackColor = true;
+            this.button17.Click += new System.EventHandler(this.button27_Click);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1786,7 +1800,7 @@
             this.AutoScroll = true;
             this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
-            this.ClientSize = new System.Drawing.Size(1186, 697);
+            this.ClientSize = new System.Drawing.Size(1187, 869);
             this.Controls.Add(this.拍图);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.groupBox2);
@@ -1955,6 +1969,7 @@
         private System.Windows.Forms.ToolStripMenuItem 显示ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 隐藏ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
+        private System.Windows.Forms.Button button17;
     }
 }
 

+ 21 - 5
OxfordExtenderWrapper/Form1.cs

@@ -613,15 +613,13 @@ namespace OxfordExtenderWrapper
         {
             try
             {
-                if (iExtender.ConnectToEDSHardware())
-                {
-                    MessageBox.Show("连接能谱成功");
-                }
+                iExtender.SetSemScanExternal(false);
+                
                 
             }
             catch (Exception x)
             {
-                MessageBox.Show("oxford 初始化失败" + x.Message);
+                MessageBox.Show("oxford 控制失败" + x.Message);
                 
             }
            
@@ -805,6 +803,24 @@ namespace OxfordExtenderWrapper
                 this.notifyIcon_wrapper.Visible = true;            //设置图标可见
             }
         }
+
+        private void btnConn_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                if (iExtender.ConnectToEDSHardware())
+                {
+                    MessageBox.Show("连接成功" );
+                }
+
+
+            }
+            catch (Exception x)
+            {
+                MessageBox.Show("oxford 控制失败" + x.Message);
+
+            }
+        }
     }
 
 }

+ 6 - 0
OxfordExtenderWrapper/Form1.resx

@@ -123,6 +123,12 @@
   <metadata name="含量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="元素.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="含量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="notifyIcon_wrapper.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>