Browse Source

add 4 documents

CXS 5 years ago
parent
commit
10aefb6221

+ 16 - 0
OTS/OTSModelSharp/OTSDataType/COTSEDSBrucker.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OTSModelSharp
+{
+   public  class COTSEDSBrucker
+    {
+        // constructor
+      public  COTSEDSBrucker()
+	{
+	}
+}
+}

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

@@ -0,0 +1,190 @@
+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;
+        }
+
+
+    }
+}

+ 12 - 0
OTS/OTSModelSharp/OTSDataType/COTSScanBase.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OTSModelSharp
+{
+   public  class COTSScanBase
+    {
+    }
+}

+ 35 - 0
OTS/OTSModelSharp/OTSDataType/SEMCommonConst.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OTSModelSharp
+{
+   public   class SEMCommonConst
+    {
+        public enum SCANNER_ID
+        {
+                INVALID = 0,
+				OFFLINE = 1,
+				MIN = 1,
+				GENESIS = 2,
+				USEDMIN = 2,
+				BRUKER = 3,
+				OXFORD = 4,
+				IXRF = 5,
+				MAX = 5
+	    };
+        public  String GetName( int a_nId)
+	    {
+		if (a_nId<(int)SCANNER_ID.MIN || a_nId>(int) SCANNER_ID.MAX)
+        {
+            return "Invalid Scan";
+        }
+
+		    return "";// SCANER_CONTROLLER_NAMES[a_nId - (int)SCANNER_ID::MIN];
+	    }
+
+        class EDSController { }
+    }
+}