|
@@ -99,7 +99,8 @@ void OxfordControllerWrapper::ControllerThreadFunction()
|
|
|
{
|
|
|
if (_microscopeController == nullptr)
|
|
|
{
|
|
|
- CreateMicroscopeController();
|
|
|
+ auto ctrl=CreateMicroscopeController();
|
|
|
+ if (ctrl == nullptr) return;
|
|
|
}
|
|
|
|
|
|
if (_edSpectrumController == nullptr)
|
|
@@ -2054,7 +2055,7 @@ IMicroscopeController^ OxfordControllerWrapper::CreateMicroscopeController()
|
|
|
CString sErrorMessage = ex->Message;
|
|
|
AfxMessageBox(_T("oxford eds cann't work,you can change work mode to offline in the sysMgrApp to run offline mode!\nerror:")+ sErrorMessage);
|
|
|
LogErrorTrace(__FILE__, __LINE__, sErrorMessage);
|
|
|
- exit(0);
|
|
|
+ return nullptr;
|
|
|
}
|
|
|
|
|
|
if (_microscopeController == nullptr)
|
|
@@ -2062,7 +2063,7 @@ IMicroscopeController^ OxfordControllerWrapper::CreateMicroscopeController()
|
|
|
CString sErrorMessage ="";
|
|
|
AfxMessageBox(_T("oxford eds cann't work,you can change work mode to offline in the sysMgrApp to run offline mode!\nerror:") + sErrorMessage);
|
|
|
LogErrorTrace(__FILE__, __LINE__, sErrorMessage);
|
|
|
- exit(0);
|
|
|
+ return nullptr;
|
|
|
}
|
|
|
|
|
|
_microscopeController->ColumnChange += gcnew EventHandler<OINA::Extender::MicroscopeControl::ColumnEventArgs^>(this, &OxfordControllerWrapper::OnMicroscopeColumnUpdated);
|
|
@@ -2092,21 +2093,32 @@ IEdSpectrumAcquisitionController^ OxfordControllerWrapper::CreateEdsSpectrumCont
|
|
|
if (_edSpectrumController == nullptr)
|
|
|
{
|
|
|
LogTrace(__FILE__, __LINE__, _T("CreateEdSpectrumServer..."));
|
|
|
- _edSpectrumController = AcquireFactory::CreateEdSpectrumServer();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ _edSpectrumController = AcquireFactory::CreateEdSpectrumServer();
|
|
|
|
|
|
- _edSpectrumController->ExperimentFinished += gcnew EventHandler<OINA::Extender::Acquisition::AcquisitionFinishedEventArgs<OINA::Extender::Data::Ed::IEdSpectrum^>^>(this, &OxfordControllerWrapper::OnXrayAcquisitionFinished);
|
|
|
+ _edSpectrumController->ExperimentFinished += gcnew EventHandler<OINA::Extender::Acquisition::AcquisitionFinishedEventArgs<OINA::Extender::Data::Ed::IEdSpectrum^>^>(this, &OxfordControllerWrapper::OnXrayAcquisitionFinished);
|
|
|
|
|
|
- auto edsSpectrumSettings = GetEdsSpectrumSettings();
|
|
|
- while (true)
|
|
|
- {
|
|
|
- if (_edSpectrumController->IsEdHardwareReady(edsSpectrumSettings))
|
|
|
+ auto edsSpectrumSettings = GetEdsSpectrumSettings();
|
|
|
+ while (true)
|
|
|
{
|
|
|
- if (edsSpectrumSettings->EdCapabilities->HasHardwareConnection)
|
|
|
+ if (_edSpectrumController->IsEdHardwareReady(edsSpectrumSettings))
|
|
|
{
|
|
|
- break;
|
|
|
+ if (edsSpectrumSettings->EdCapabilities->HasHardwareConnection)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (const std::exception& e)
|
|
|
+ {
|
|
|
+ CString msg(e.what());
|
|
|
+ LogTrace(__FILE__, __LINE__,msg);
|
|
|
+ return nullptr;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return _edSpectrumController;
|
|
@@ -2165,10 +2177,10 @@ IImageAcquisitionController^ OxfordControllerWrapper::CreateImageAcqusitionContr
|
|
|
catch (Exception^ ex)
|
|
|
{
|
|
|
CString sMessage = ex->Message;
|
|
|
- CString sErrorMessage;
|
|
|
-
|
|
|
- LogErrorTrace(__FILE__, __LINE__, sErrorMessage);
|
|
|
|
|
|
+
|
|
|
+ LogErrorTrace(__FILE__, __LINE__, sMessage);
|
|
|
+ return nullptr;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2237,23 +2249,35 @@ IEdChordListAcquisitionController^ OxfordControllerWrapper::CreateChordlistContr
|
|
|
{
|
|
|
if (_edsChordListController == nullptr)
|
|
|
{
|
|
|
- LogTrace(__FILE__, __LINE__, _T("CreateEdChordListServer..."));
|
|
|
- _edsChordListController = AcquireFactory::CreateEdChordListServer();
|
|
|
-
|
|
|
- _edsChordListController->PixelProcessed += gcnew EventHandler<OINA::Extender::EventArgs<OINA::Extender::Processing::Quant::IPixelSEMQuantStatus^>^>(this, &OxfordControllerWrapper::OnController_PixelProcessed);
|
|
|
- _edsChordListController->ExperimentFinished += gcnew EventHandler<OINA::Extender::Acquisition::AcquisitionFinishedEventArgs^>(this, &OxfordControllerWrapper::OnController_ExperimentFinished);
|
|
|
-
|
|
|
- auto edsChordListSettings = GetChordlistSettings();
|
|
|
- while (true)
|
|
|
+ try
|
|
|
{
|
|
|
- if (_edsChordListController->IsEdHardwareReady(edsChordListSettings))
|
|
|
+ LogTrace(__FILE__, __LINE__, _T("CreateEdChordListServer..."));
|
|
|
+ _edsChordListController = AcquireFactory::CreateEdChordListServer();
|
|
|
+
|
|
|
+ _edsChordListController->PixelProcessed += gcnew EventHandler<OINA::Extender::EventArgs<OINA::Extender::Processing::Quant::IPixelSEMQuantStatus^>^>(this, &OxfordControllerWrapper::OnController_PixelProcessed);
|
|
|
+ _edsChordListController->ExperimentFinished += gcnew EventHandler<OINA::Extender::Acquisition::AcquisitionFinishedEventArgs^>(this, &OxfordControllerWrapper::OnController_ExperimentFinished);
|
|
|
+
|
|
|
+ auto edsChordListSettings = GetChordlistSettings();
|
|
|
+ while (true)
|
|
|
{
|
|
|
- if (edsChordListSettings->EdCapabilities->HasHardwareConnection)
|
|
|
+ if (_edsChordListController->IsEdHardwareReady(edsChordListSettings))
|
|
|
{
|
|
|
- break;
|
|
|
+ if (edsChordListSettings->EdCapabilities->HasHardwareConnection)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ }catch(Exception^ ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ CString sMessage = ex->Message;
|
|
|
+
|
|
|
+
|
|
|
+ LogErrorTrace(__FILE__, __LINE__, sMessage);
|
|
|
+ return nullptr;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return _edsChordListController;
|