浏览代码

fix log bug.

gsp 3 年之前
父节点
当前提交
5114eaddf2

+ 1 - 1
OTSCPP/OTSControl/COTSHardwareMgr.cpp

@@ -94,7 +94,7 @@ namespace OTSController {
 				{
 	
 						m_SemBasePtr = CSemBasePtr(new COTSSEMOxford());
-						LogInfoTrace(__FILE__, __LINE__, "(COTSHardwareMgr::GetSemControllerMgrPtr) new COTSSemSim() ");
+						LogInfoTrace(__FILE__, __LINE__, "(COTSHardwareMgr::GetSemControllerMgrPtr) new COTSSEMOxford() ");
 				
 					break;
 				}

+ 1 - 1
OTSCPP/OTSLog/COTSUtilityDllFunExport.cpp

@@ -197,7 +197,7 @@ bool SendLogMessageToNlog(LPCTSTR Msg, int postLogLevel)
 
 	if (NULL == m_hWnd)
 	{
-		LogErrorTrace(__FILE__, __LINE__, _T("(PostMessageToMeasureApp) FindWindow(NULL, m_MAppFormName=%s) failed"), "Log");
+		
 		return false;
 	}
 	CString msg = Msg;

+ 0 - 1
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -536,7 +536,6 @@
     <None Include="0-OTSModel\OTSDataType\COTSSample.cd" />
     <None Include="1-OTSMeasure\MeasureRetThread.cd" />
     <None Include="2-OTSMeasureParamManage\MeasureParam.cd" />
-    <None Include="4-OTSSamplespaceGraphicsPanel\GDIUIClass.cd" />
     <None Include="app.manifest" />
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">

+ 25 - 9
OTSIncAReportApp/3-ServiceCenter/SemController.cs

@@ -14,16 +14,16 @@ namespace ServiceInterface
 
         public SemController()
         {
-            if (hw == null)
-            {
-                hw = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance();
-            }
+           
            
         }
 
         public bool Connect()
         {
-          
+            if (hw == null)
+            {
+                hw = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance();
+            }
             if (hw.IsConnected())
             {
                 return true;
@@ -36,23 +36,34 @@ namespace ServiceInterface
 
         public bool DisConnect()
         {
-         
-            return hw.DisconnectSem();
+            if (hw != null)
+            {
+
+                if (hw.IsConnected())
+                {
+                    return hw.DisconnectSem();
+                }
+            }
+           
+            return true;
         }
 
         public bool GetMagnification(ref double a_dMagnification)
         {
+            Connect();
             return hw.GetSemMagnification(ref a_dMagnification);
              
         }
 
         public bool GetScanFieldSize(ref double dScanFieldSizeX, ref double dScanFieldSizeY)
         {
-          return  hw.GetSemScanFieldSize(ref dScanFieldSizeX, ref dScanFieldSizeY);
+            Connect();
+            return  hw.GetSemScanFieldSize(ref dScanFieldSizeX, ref dScanFieldSizeY);
         }
 
         public bool GetSemPositionXY(ref double a_dPositionX, ref double a_dPositionY, ref double a_dPositionR)
         {
+            Connect();
             return hw.GetSemPositionXY(ref a_dPositionX, ref a_dPositionY, ref a_dPositionR);
         }
 
@@ -60,6 +71,7 @@ namespace ServiceInterface
 
         public bool GetWorkingDistance(ref double a_distance)
         {
+            Connect();
             return hw.GetSemWorkingDistance(ref a_distance);
         }
 
@@ -71,24 +83,28 @@ namespace ServiceInterface
 
         public bool MoveSEMToPoint(Point poi, double rotation)
         {
+            Connect();
             return hw.MoveSEMToPoint(poi.X, poi.Y, rotation);
         }
 
         public bool SetMagnification(double a_dMagnification)
         {
-             //hw.SetMagnification(a_dMagnification);
+            Connect();
+            //hw.SetMagnification(a_dMagnification);
             hw.SetSemMagnification(a_dMagnification);
             return true;
         }
 
         public bool SetScanExternal(bool b)
         {
+            Connect();
             //int seValue = b ? 1 : 0;
             return hw.SetSemScanExternal(b);
         }
 
         public bool SetWorkingDistance(double a_distance)
         {
+            Connect();
             return hw.SetSemWorkingDistance(a_distance);
         }