Jelajahi Sumber

optimize bruker driver

beijing 1 tahun lalu
induk
melakukan
52423e960d

+ 1 - 1
Bin/x64/Debug/Config/ProData/HardwareConfig.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData PathName="HardwareConfig.xml" ID="1">
   <Member RegName="SemControllerName" Value="Bruker" ImageInputSources="BSE" />
-  <Member RegName="EDSName" Value="Bruker" DelayQuantify="true" />
+  <Member RegName="EDSName" Value="Bruker" DelayQuantify="false" />
   <Member RegName="BrukerDllVersion" Version="Bruker.API.Esprit64.dll" />
   <Member RegName="FEIIP" Value="192.168.0.1" />
   <Member RegName="FEIPORT" Value="7520" />

+ 35 - 33
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -183,27 +183,27 @@ namespace OTSController {
 	}
 
 	// check connection
-	BOOL COTSBrukerImpl::CheckConnection(BOOL& a_bConnected)
-	{
+	//BOOL COTSBrukerImpl::CheckConnection(BOOL& a_bConnected)
+	//{
 
-		if (BrukerDll::CheckConnection(m_nClientID)== 0)
-		{
-			// connected
-			a_bConnected = TRUE;
+	//	if (BrukerDll::CheckConnection(m_nClientID)== 0)
+	//	{
+	//		// connected
+	//		a_bConnected = TRUE;
 
-			// ok, return true
-			return TRUE;
-		}
-		else
-		{
-			
-			a_bConnected = FALSE;
+	//		// ok, return true
+	//		return TRUE;
+	//	}
+	//	else
+	//	{
+	//		
+	//		a_bConnected = FALSE;
 
-				//LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CheckConnection: no hardware connected."));
+	//			//LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CheckConnection: no hardware connected."));
 
-			return FALSE;
-		}
-	}
+	//		return FALSE;
+	//	}
+	//}
 
 	void COTSBrukerImpl::SetExpectCount(int expectCount)
 	{
@@ -1235,50 +1235,52 @@ namespace OTSController {
 		// first attempt to open client 
 		BOOL bStartNew = TRUE;
 		BOOL bGUI = FALSE;
-		
+		BOOL bConnected = FALSE;
 		auto bRet = BrukerDll::OpenClient(m_psServerName.get(), "edx", "edx", static_cast<BYTE>(bStartNew), static_cast<BYTE>(bGUI), m_nClientID);
-		
-		if (!bRet)
+		//CheckConnection(bConnected);
+		if (bRet)
 		{
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::OpenClient: call OpenClient failed at the first attempt."));
+			bConnected = FALSE;
+		}
+		else
+		{
+			bConnected = TRUE;
 		}
 		
 
 		// double check the connection if client id is zero
-		BOOL bConnected = FALSE;
+		
 		if (m_nClientID == 0)
 		{
 			// check if connection is OK
 			
-			if (!CheckConnection(bConnected))
+			if(BrukerDll::CheckConnection(m_nClientID)!=0)
 			{
-				// failed to check connection
-				m_bConnected = false;
-				return FALSE;
-			}
+			
 
 		
 			// try to open client again if there is no connection
-			if (!bConnected)	
-			{
+			
 				// second attempt to open client 
 				
 				bRet = BrukerDll::OpenClient(m_psServerName.get(), "edx", "edx", static_cast<BYTE>(bStartNew), static_cast<BYTE>(bGUI), m_nClientID);
 			
-				if (!bRet)
+				if (bRet)
 				{
 					LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::OpenClient: call OpenClient failed at the second attempt."));
-					m_bConnected = false;
+					bConnected = false;
 				}
 			}
 		}
-		if (bRet)
+		/*if (!bRet)
 		{
 			m_bConnected = true;
-		}
+		}*/
 		
 		// return method return flag
-		return bRet;
+		m_bConnected = bConnected;
+		return m_bConnected;
 	}
 	//BOOL COTSBrukerImpl::OpenClient(char* a_sServerName, char* a_sUserName, char* a_sPassword, BYTE a_nStartNew, BYTE a_bGUI, uint32_t& a_nClientID)
 	//{

+ 1 - 1
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.h

@@ -52,7 +52,7 @@ namespace OTSController {
 		BOOL SetSPU(void);
 
 		// check connection
-		BOOL CheckConnection(BOOL& a_bConnected);
+		//BOOL CheckConnection(BOOL& a_bConnected);
 		BOOL DisConnect();
 		
 		void SetExpectCount(int expectCount);

+ 3 - 5
OTSCPP/OTSControl/Bruker/OTSSEMBruker.cpp

@@ -48,7 +48,7 @@ namespace OTSController {
 		
 			
 			// check connection
-		m_pBrukerImplPtr->CheckConnection(m_bConnected);
+		//m_pBrukerImplPtr->CheckConnection(m_bConnected);
 			/*if (!m_bConnected)
 			{
 
@@ -69,12 +69,10 @@ namespace OTSController {
 					return FALSE;
 				}
 				
-		
+				m_bConnected = TRUE;
 			
 			}
-		//}
-
-		// ok, return TRUE
+		
 		return TRUE;
 	}
 

+ 9 - 4
OTSIncAMeasureApp/ServiceCenter/CPP(Bruker)API/SemController.cs

@@ -265,14 +265,14 @@ namespace OTSModelSharp.ServiceCenter
            
         }
 
-        public bool SetSemBeamBlank(bool a_dKV)
+        public bool SetSemBeamBlank(bool value)
         {
            
                 if (!hw.IsConnected())
                 {
                     return false;
                 }
-                return hw.SetSemBeamBlank(a_dKV);
+                return hw.SetSemBeamBlank(value);
            
         }
 
@@ -302,14 +302,19 @@ namespace OTSModelSharp.ServiceCenter
 
     
 
-        public bool SetSemBeamCurrent(bool a_dKV)
+        public bool SetSemBeamCurrentOff(bool value)
         {
-            throw new NotImplementedException();
+            return hw.SetSemBeamCurrent(value);
         }
 
         bool ISemController.StopXrayAcquisition()
         {
             throw new NotImplementedException();
         }
+
+        public bool SetSemHTOff(bool value)
+        {
+            return hw.SetSemHTOnOff(value);
+        }
     }
 }

+ 6 - 1
OTSIncAMeasureApp/ServiceCenter/FEIAutoScript/FEISemController.cs

@@ -152,7 +152,7 @@ namespace OTSMeasureApp.ServiceCenter
             }
         }
 
-        public bool SetSemBeamCurrent(bool val)
+        public bool SetSemBeamCurrentOff(bool val)
         {
             if (val)
             {
@@ -179,6 +179,11 @@ namespace OTSMeasureApp.ServiceCenter
             return m_ApiClass.SetHightVoltage(a_dKV);
         }
 
+        public bool SetSemHTOff(bool value)
+        {
+            return m_ApiClass.SetBeamStateOff();
+        }
+
         public bool SetWorkingDistance(double a_distance)
         {
             return m_ApiClass.SetWorkingDistance(a_distance);

+ 4 - 2
OTSIncAMeasureApp/ServiceCenter/IMeasureHardware.cs

@@ -40,8 +40,10 @@ namespace OTSModelSharp.ServiceCenter
         bool GetSemContrast(ref double a_dContrast);
         bool SetSemHighTension(double a_dKV);
         bool GetSemHighTension(ref double a_dKV);
-        bool SetSemBeamCurrent(bool a_dKV);
-        bool SetSemBeamBlank(bool a_dKV);
+        bool SetSemBeamCurrentOff(bool value);
+        bool SetSemBeamBlank(bool value);
+
+        bool SetSemHTOff(bool value);
         bool GetSemBeamBlank(ref int a_nBeamBlank);
         bool StopXrayAcquisition();
        

+ 6 - 1
OTSIncAMeasureApp/ServiceCenter/OxfordExtender/OxfordSemController.cs

@@ -176,7 +176,7 @@ namespace OTSMeasureApp.ServiceCenter
         }
 
 
-        public bool SetSemBeamCurrent(bool a_dKV)
+        public bool SetSemBeamCurrentOff(bool a_dKV)
         {
             throw new NotImplementedException();
         }
@@ -190,5 +190,10 @@ namespace OTSMeasureApp.ServiceCenter
         {
             throw new NotImplementedException();
         }
+
+        public bool SetSemHTOff(bool value)
+        {
+            return true;
+        }
     }
 }

File diff ditekan karena terlalu besar
+ 160 - 147
OTSSysMgrApp/SemTestForms.Designer.cs


+ 14 - 8
OTSSysMgrApp/SemTestForms.cs

@@ -611,13 +611,13 @@ namespace OTSSysMgrApp
             try
             {
                 int a_nBeamBlank = 0;
-                //获取参数
-                bool result = m_SemHardwareMgr.SetSemBeamBlank(true);
+               
+                bool result = m_SemHardwareMgr.GetSemBeamBlank(ref a_nBeamBlank);
                 if (result)
                 {
                     //赋值 显示
-                    tbBeamBlank.Text = Convert.ToString(result);
-                    log.Info("Beam baffle:" + result.ToString());
+                    tbBeamBlank.Text = Convert.ToString(a_nBeamBlank);
+                    log.Info("Beam baffle:" + a_nBeamBlank.ToString());
                 }
                 else
                 {
@@ -649,7 +649,9 @@ namespace OTSSysMgrApp
                     tbSBeamBlank.Focus();
                     return;
                 }
-               
+              
+
+                bool result = m_SemHardwareMgr.SetSemBeamBlank(true);
             }
             catch (Exception ex)
             {
@@ -1076,7 +1078,7 @@ namespace OTSSysMgrApp
         private void bVoltageClose_Click(object sender, EventArgs e)
         {
             bool a_HTValue = true;
-            bool result = m_SemHardwareMgr.SetSemBeamBlank(a_HTValue);
+            bool result = m_SemHardwareMgr.SetSemBeamCurrentOff(a_HTValue);
 
         }
 
@@ -1113,9 +1115,13 @@ namespace OTSSysMgrApp
 
         }
 
-        private void btnSSemScanFieldXY_Click(object sender, EventArgs e)
-        {
+     
 
+       
+
+        private void button3_Click_1(object sender, EventArgs e)
+        {
+            bool result = m_SemHardwareMgr.SetSemHTOff(true);
         }
     }
 }

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini