فهرست منبع

修改 涉及到 control类 的一些 更改 ,与孙工系统划分前备份

CXS 5 سال پیش
والد
کامیت
c0603dd7a8

+ 8 - 10
OTS/OTSModelSharp/Measure/GetBSEPic/SmplMeasure.cs

@@ -1676,18 +1676,17 @@ namespace OTSModelSharp
         }
 
         // get x-rays
-       public bool GetXRayByPoints(List<CPosXray> a_listPosXRay, uint a_nXRayAQTime, bool a_bElementInfo /*= FALSE*/)
+        public bool GetXRayByPoints(List<CPosXray> a_listPosXRay, int a_nXRayAQTime, bool a_bElementInfo /*= FALSE*/)
         {
             // get EDS controller
-            OTSEDSBase pEDSController = GetEDSControl();
-           
+            IEDSController pEDSController = m_HardwareMgr.GetEDSControl();  //OTSEDSBase pEDSController = GetEDSControl();
 
             // init EDS controller
-            if (!pEDSController.Init())
-            {
-                loger.Error("GetXRayByFeatures: failed to inti EDS (%s).", pEDSController.GetName());
-                return false;
-            }
+            //if (!pEDSController.Init())
+            //{
+            //    loger.Error("GetXRayByFeatures: failed to inti EDS (%s).", pEDSController.GetName());
+            //    return false;
+            //}
             // set get quantify info flag, firstly only get x-ray data
 
             if (!a_bElementInfo)
@@ -1718,7 +1717,7 @@ namespace OTSModelSharp
                 listXRayPointsTemp[0] = a_listPosXRay[i];
 
 
-                if (!pEDSController.GetXRayByPoints(listXRayPointsTemp, a_nXRayAQTime))
+                if (!pEDSController.GetXRayByPoints(ref listXRayPointsTemp, a_nXRayAQTime))
                 {
                     loger.Error("GetXRayByPoints: failed to get element.");
                     //return FALSE;
@@ -1733,6 +1732,5 @@ namespace OTSModelSharp
             return true;
         }
 
-
     }
 }

+ 2 - 3
OTS/OTSModelSharp/MeasureControl/IMeasureHardware.cs

@@ -52,8 +52,7 @@ namespace OTSIncAMeasureApp.OTSMeasureControl
 
     public interface IEDSController
     {
-        bool GetPixelSize(ref double a_dPixelSize);
-        bool GetXRayByFeatures(List<COTSParticle> a_listParticles, List<CPosXray> a_listPosXRay, double a_nXRayAQTime, bool a_bElementInfo /*= FALSE*/);//这里将DWORD转成了Double类型,因为在后续调用时还有DWORD强制转换
-        bool GetXRayByPoints(List<CPosXray> a_listPosXRay, uint a_nXRayAQTime, bool a_bElementInfo /*= FALSE*/);
+        void SetQuantification(bool a_bQuantification);
+        bool GetXRayByPoints(ref List<CPosXray> a_vXRayPoints,int a_nXRayAQTime);
     }
 }

+ 0 - 190
OTS/OTSModelSharp/OTSDataType/COTSHardwareMgr.cs

@@ -1,190 +0,0 @@
-using OTSDataType;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml;
-using static OTSModelSharp.COTSHardwareMgr;
-
-namespace OTSModelSharp
-{
-  public   class COTSHardwareMgr
-    {
-        OTSEDSBase m_EDSPtr;
-
-        String  szEdsName = "";
-
-        //XML文件名
-        public String szXMLFileName = "./Config/ProData/HardwareConfig.xml";
-
-        String szSemName = "";
-
-        string[] lpEdsName = { "OffLine", "Bruker", "Oxford" };
-
-        COTSScanBase m_SCanPtr;
-
-
-        public enum  EDSDevID
-        {
-            Invalid = -1,
-	        OFFLINE = 0,
-	        BRUKER = 1,
-	        OXFORD = 2,
-        }
-        
-        public  OTSEDSBase GetEDSControllerPtr()
-        {
-
-            if (null == m_EDSPtr)
-            {
-                int iDevID = -1;
-                if (szEdsName == "")
-                {
-                    if (!this.GetXMLVal(szXMLFileName, szSemName, szEdsName))
-                    {
-                        return null;
-                    }
-                }
-               
-
-                iDevID = this.GetEDSControllerID(szEdsName);
-                switch (iDevID)
-                {
-                    case (int)EDSDevID.BRUKER:
-                        {
-
-                            m_EDSPtr = new OTSEDSBase();
-                            
-
-                            break;
-                        }
-                    case (int)EDSDevID.OFFLINE:
-                        {
-
-                            m_EDSPtr = new OTSEDSBase();
-
-
-
-                            break;
-                        }
-                    case (int)EDSDevID.OXFORD:
-                        {
-
-                            m_EDSPtr = new OTSEDSBase();
-
-
-
-                            break;
-                        }
-                    default:
-
-                        break;
-                }
-            }
-
-
-            return m_EDSPtr;
-
-        }
-
-       public bool GetXMLVal(String szXmlFileName, String szSemName, String  szEdsName)
-	   {
-
-        XmlDocument doc = new XmlDocument();
-        doc.Load(szXmlFileName);//载入xml文件
-        xString szS = new xString();
-        xString szE = new xString();
-
-        Slo subClass = new Slo();
-        Slo subClass1 = new Slo();
-        subClass.Register("drive", szS);
-		subClass1.Register("drive",szE);
-		subClass.Register("SemControllerName", subClass);
-		
-		subClass.Register("EDSName",subClass1);
-
-
-		XmlNode rootNode;
-        rootNode = doc.FirstChild;
-     
-		subClass.Serialize(false, doc, rootNode);
-        szSemName = szS.value().ToString();
-        szEdsName = szE.value().ToString();
-		return true;
-
-       }
-
-        public XmlElement FirstChildElement(string value)	{
-        return this.FirstChildElement(value );
-    }
-
-        //return array Index when ControllerName match for name in array 
-       public int GetEDSControllerID(String  EDSControllerName)
-	   {
-		int iLen = lpEdsName.Length ;
-
-		int i = 0;
-		for (i = 0; i<iLen; i++)
-		{
-			if (0 == string.Compare(lpEdsName[i], EDSControllerName))
-			{
-				return i;
-			}
-        }
-      
-		return -1;
-
-	   }
-
-       public COTSScanBase GetScanControllerPtr()
-        {
-
-            if (null == m_SCanPtr)
-            {
-                int iDevID = -1;
-
-                if (szEdsName == "")
-                {
-                    if (!this.GetXMLVal(szXMLFileName, szSemName, szEdsName))
-                    {
-                        return null;
-                    }
-                }
-
-              
-                iDevID = this.GetEDSControllerID(szEdsName);
-
-                switch (iDevID)
-                {
-                    case (int)EDSDevID.BRUKER:
-                        {
-
-                            m_SCanPtr = new COTSScanBase();
-                            
-                            break;
-                        }
-                    case (int)EDSDevID.OFFLINE:
-                        {
-                            m_SCanPtr = new COTSScanBase();
-
-                            break;
-                        }
-                    case (int)EDSDevID.OXFORD:
-                        {
-                            m_SCanPtr = new COTSScanBase();
-
-                            break;
-                        }
-                    default:
-
-                        break;
-                }
-            }
-
-            return m_SCanPtr;
-        }
-
-
-    }
-}

+ 0 - 16
OTS/OTSModelSharp/OTSEDSBase.cs

@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace OTSModelSharp
-{
-   public class OTSEDSBase
-    {
-        const String SIMULATION_SPECTRUM_FILENAME = "SimSpectrum.txt";
-       // EDSController eDSController = new EDSController();
-
-        
-    }
-}