|
|
|
@ -24,9 +24,8 @@ void CaptureThreadBasler::process(void)
|
|
|
|
|
{
|
|
|
|
|
bool last_high = false;
|
|
|
|
|
bool last_result = false;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
CSampleConfigurationEventHandler *CfgEvent=NULL;
|
|
|
|
|
|
|
|
|
|
CSampleConfigurationEventHandler* CfgEvent = NULL;
|
|
|
|
|
CfgEvent = new CSampleConfigurationEventHandler;
|
|
|
|
|
CfgEvent->channel_ = Local_Num;
|
|
|
|
|
pDev_->RegisterConfiguration(CfgEvent, Pylon::RegistrationMode_Append, Pylon::Cleanup_None);
|
|
|
|
@ -51,6 +50,8 @@ void CaptureThreadBasler::process(void)
|
|
|
|
|
BurstEvent.pDev__ = pDev_;
|
|
|
|
|
BurstEvent.pCaptureThreadBasler = this;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
m_threadFunc.pDev__ = pDev_;
|
|
|
|
|
m_threadFunc.p_result_queue_ = p_result_queue;
|
|
|
|
|
m_threadFunc.p_double_queue_ = p_double_queue;
|
|
|
|
@ -89,11 +90,9 @@ void CaptureThreadBasler::process(void)
|
|
|
|
|
/*Set here*/
|
|
|
|
|
if (pDev_->TriggerSelector.TrySetValue(Basler_UniversalCameraParams::TriggerSelector_FrameBurstStart))
|
|
|
|
|
{
|
|
|
|
|
DEBUG(" TriggerSelector_FrameBurstStart\n");
|
|
|
|
|
pDev_->TriggerMode.SetValue(Basler_UniversalCameraParams::TriggerMode_Off);
|
|
|
|
|
if(pDev_->EventSelector.TrySetValue(Basler_UniversalCameraParams::EventSelector_FrameBurstStart))
|
|
|
|
|
{
|
|
|
|
|
DEBUG(" EventSelector_FrameBurstStart\n");
|
|
|
|
|
pDev_->EventNotification.SetValue(Basler_UniversalCameraParams::EventNotification_Off);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -144,18 +143,38 @@ void CaptureThreadBasler::process(void)
|
|
|
|
|
if (m_Timer) delete m_Timer;
|
|
|
|
|
pDev_->StopGrabbing();
|
|
|
|
|
pDev_->Close();
|
|
|
|
|
pDev_->GrabCameraEvents = false;
|
|
|
|
|
pDev_->DeregisterConfiguration(CfgEvent);
|
|
|
|
|
pDev_->DeregisterImageEventHandler(&ImageEvent);
|
|
|
|
|
#ifndef USB_BASLER_NEW_FW
|
|
|
|
|
pDev_->DeregisterCameraEventHandler(&BurstEvent, "EventFrameBurstStartData");
|
|
|
|
|
#else
|
|
|
|
|
pDev_->DeregisterCameraEventHandler(&BurstEvent, "EventLine1RisingEdgeData");
|
|
|
|
|
pDev_->DeregisterCameraEventHandler(&BurstEvent, "EventLine1FallingEdgeData");
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
catch(const Pylon::GenericException& e)
|
|
|
|
|
{
|
|
|
|
|
emit error( QString::fromStdString( e.GetDescription()) );
|
|
|
|
|
std::cout << e.GetSourceLine()<<e.GetDescription() << std::endl;
|
|
|
|
|
if (pDev_->IsCameraDeviceRemoved())
|
|
|
|
|
{
|
|
|
|
|
cout << "The camera has been removed from the computer." << endl;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pDev_->StopGrabbing();
|
|
|
|
|
pDev_->GrabCameraEvents = false;
|
|
|
|
|
pDev_->Close();
|
|
|
|
|
pDev_->DeregisterConfiguration(CfgEvent);
|
|
|
|
|
pDev_->DeregisterImageEventHandler(&ImageEvent);
|
|
|
|
|
#ifndef USB_BASLER_NEW_FW
|
|
|
|
|
pDev_->DeregisterCameraEventHandler(&BurstEvent, "EventFrameBurstStartData");
|
|
|
|
|
#else
|
|
|
|
|
pDev_->DeregisterCameraEventHandler(&BurstEvent, "EventLine1RisingEdgeData");
|
|
|
|
|
pDev_->DeregisterCameraEventHandler(&BurstEvent, "EventLine1FallingEdgeData");
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|