浏览代码

Merge branch 'release2.31' into Release2.4

gaoshipeng 3 年之前
父节点
当前提交
d24410e859

+ 28 - 34
OTSCPP/OTSControl/Oxford/OxfordWrapper/OxfordControllerWrapper.cpp

@@ -359,7 +359,7 @@ void OxfordControllerWrapper::ControllerThreadFunction()
 					break;
 				}
 			}
-			Thread::Sleep(1000);
+			Thread::Sleep(500);
 
 			m_endControllerEvent->Set();
 		}
@@ -1116,6 +1116,7 @@ bool OxfordControllerWrapper::StartXrayCollecting(const long a_nAcTimeMillisecon
 	auto edsSettings = GetEdsSpectrumSettings();
 
 	edsSettings->EdSettings->AcquisitionTime = TimeSpan::FromMilliseconds(a_nAcTimeMilliseconds);
+	edsSettings->EdSettings->ProcessTime = 4;
 
 	auto spectrum = edsController->StartAcquisition(edsSettings);
 
@@ -1147,6 +1148,8 @@ void  OxfordControllerWrapper::XraySpectrumProcess(OINA::Extender::Data::Ed::IEd
 
 		// Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
 		IAutoIdSettings^ autoIdSettings = ProcessingFactory::CreateAutoIdSettings();
+
+		
 		EdSpectrumProcessing->IdentifyElements(spectrum, autoIdSettings);
 
 		ISEMQuantSettings^ settings = ProcessingFactory::CreateSEMQuantSettings();
@@ -1262,6 +1265,9 @@ void OxfordControllerWrapper::OnXrayAcquisitionFinished(Object^ sender, OINA::Ex
 
 		// Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
 		IAutoIdSettings^ autoIdSettings = ProcessingFactory::CreateAutoIdSettings();
+		 
+		
+
 		EdSpectrumProcessing->IdentifyElements(e->Value, autoIdSettings);
 
 		ISEMQuantSettings^ settings = ProcessingFactory::CreateSEMQuantSettings();
@@ -1852,25 +1858,6 @@ bool OxfordControllerWrapper::StartImageCollecting()
 
 		auto images = imageAcqusitionController->StartAcquisition(imageAcqusitionSettings);
 
-		/*for each (auto eleImage in images)
-		{
-			electronImageList->Add(eleImage);
-		}
-
-		if (electronImageList->Count == 0)
-		{
-			_oxfordControllerData.m_nState = OxfordControllerState::FAILED;
-		}
-		else if (!ReadImageData(electronImageList[0], _oxfordControllerData.m_pImageBits))
-		{
-			_oxfordControllerData.m_nState = OxfordControllerState::FAILED;
-		}
-		else
-		{
-			_oxfordControllerData.m_nState = OxfordControllerState::SUCCEEDED;
-		}
-
-		m_endControllerEvent->Set();*/
 
 
 		return images != nullptr;
@@ -1890,24 +1877,32 @@ void OxfordControllerWrapper::OnImageAcquisitionFinished(Object^ /*sender*/, OIN
 	List<IElectronImage^>^ electronImageList = gcnew List<IElectronImage^>();
 	try
 	{
-
-		for each (auto eleImage in e->Value)
+		if ((bool)e->Success)
 		{
-			electronImageList->Add(eleImage);
-		}
+			for each (auto eleImage in e->Value)
+			{
+				electronImageList->Add(eleImage);
+			}
 
-		if (electronImageList->Count == 0)
-		{
-			_oxfordControllerData.m_nState = OxfordControllerState::FAILED;
-		}
-		else if (!ReadImageData(electronImageList[0], _oxfordControllerData.m_pImageBits))
-		{
-			_oxfordControllerData.m_nState = OxfordControllerState::FAILED;
+			if (electronImageList->Count == 0)
+			{
+				_oxfordControllerData.m_nState = OxfordControllerState::FAILED;
+			}
+			else if (!ReadImageData(electronImageList[0], _oxfordControllerData.m_pImageBits))
+			{
+				_oxfordControllerData.m_nState = OxfordControllerState::FAILED;
+			}
+			else
+			{
+				_oxfordControllerData.m_nState = OxfordControllerState::SUCCEEDED;
+			}
 		}
 		else
 		{
-			_oxfordControllerData.m_nState = OxfordControllerState::SUCCEEDED;
+			CString sMessage(_T("OnImageAcquisitionFinished failed") );
+			LogErrorTrace(__FILE__, __LINE__, sMessage);
 		}
+		
 	}
 	catch (Exception^ ex)
 	{
@@ -2219,8 +2214,7 @@ IImageAcquisitionSettings^ OxfordControllerWrapper::GetImageAcqusitionSettings()
 		{
 			imageSettings->EnableInputSource(OINA::Extender::Data::Image::ImageInputSources::None, true);
 		}
-		//Action<>
-		//Enumerable::ToList(imageSettings->InputSources)->ForEach(imageSettings->EnableInputSource(i.Key, false));
+
 		_imageAcqusitionSettings->ImageSettings->DwellTimeMicroSeconds = 20;
 		_imageAcqusitionSettings->ScanSettings->AcquisitionRegion->CreateFullFieldRegion(1.0 / 1024.0);
 

+ 5 - 5
OTSCPP/OTSLog/COTSUtilityDllFunExport.cpp

@@ -212,12 +212,12 @@ bool SendLogMessageToNlog(LPCTSTR Msg, int postLogLevel)
 	{
 		HWND hd = GetDesktopWindow();        //得到桌面窗口
 		     hd = GetWindow(hd, GW_CHILD);        //得到屏幕上第一个子窗口
-		     char s[200] = { 0 };
+		     char s[2000] = { 0 };
 		     int num = 1;
 		     while (hd != NULL)                    //循环得到所有的子窗口
 		     {
-		       memset(s, 0, 200);
-		       GetWindowText(hd, s, 200);
+		       memset(s, 0, 2000);
+		       GetWindowText(hd, s, 2000);
 			   CString winTxt(s);
 			   if (winTxt.Find(_T("OTSMeasureApp"))>-1)//find the measure app mainform
 			   {
@@ -246,9 +246,9 @@ bool SendLogMessageToNlog(LPCTSTR Msg, int postLogLevel)
 	postlog.logLevel = postLogLevel;
 	int l = msg.GetLength();
 
-	if (l > 200)
+	if (l > 2000)
 	{
-		l = 200;
+		l = 2000;
 	}
 	for (int i = 0; i < l; i++)
 	{

+ 1 - 1
OTSCPP/OTSLog/COTSUtilityDllFunExport.h

@@ -3,7 +3,7 @@
  struct PostLogMsg
 {
 	int logLevel;
-	char logMsg[200];
+	char logMsg[2000];
 
 
 };

+ 9 - 9
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -1514,15 +1514,15 @@ namespace OTSMeasureApp
                 return false;
             }
 
-            //最小放大倍数不得小于45倍
-            if (Convert.ToInt32(IDC_EDIT_MINMAG.Text.Trim()) < 45)
-            {
-                IDC_EDIT_MINMAG.Focus();
-                IDC_EDIT_MINMAG.SelectAll();
-                string message = "The minimum magnification cannot be less than 45 times";
-                MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                return false;
-            }
+            ////最小放大倍数不得小于45倍
+            //if (Convert.ToInt32(IDC_EDIT_MINMAG.Text.Trim()) < 45)
+            //{
+            //    IDC_EDIT_MINMAG.Focus();
+            //    IDC_EDIT_MINMAG.SelectAll();
+            //    string message = "The minimum magnification cannot be less than 45 times";
+            //    MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            //    return false;
+            //}
 
             //再限制,x轴,y轴,的起止的,输入长度,因为现在已经有在mm和um之间的转换,所以这里要限制一下
             //x轴行程/mm 起

+ 1 - 1
OTSIncAMeasureApp/OTSMeasureOutputNlog.cs

@@ -14,7 +14,7 @@ namespace OTSMeasureApp
     public struct PostLogMsg
     {
         public int logLevel;//1 trace 2 debug 3info 4 warn 5 error 6 fatal
-        [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)200)]
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)2000)]
         public char[] logMessage;
     };