解决打开/关闭巴斯勒相机失败问题

1600-900
CJ980606 2 years ago
parent 083f23904e
commit 3259939c6f

@ -36,7 +36,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Qt5Version = 5.15.2_msvc2019_64
SolutionGuid = {0AF1A30E-A12C-4014-ACD5-65A1E6D54D46}
Qt5Version = 5.15.2_msvc2019_64
EndGlobalSection
EndGlobal

@ -141,6 +141,8 @@ void CaptureThreadBasler::process(void)
#endif
if (m_Timer) delete m_Timer;
pDev_->StopGrabbing();
pDev_->Close();
pDev_->GrabCameraEvents = false;
pDev_->DeregisterConfiguration(&CfgEvent);
pDev_->DeregisterImageEventHandler(&ImageEvent);
#ifndef USB_BASLER_NEW_FW

@ -91,6 +91,7 @@ int g_lst_quantiy; //
int quantity_stop_count; //产量不变的秒数
int g_seconds;
int CurOpLabel;
bool onrestart = false;
VOID BeforeWork(int shoot[])
{
@ -571,7 +572,7 @@ void Cigarette::Exit()
rThread->stop();
delete rThread;
#endif
qDebug() << "Close thread ";;
qDebug() << "Close thread ";
if(m_PLCDevice) {
m_PLCDevice->disconnect_plc();
@ -581,6 +582,8 @@ void Cigarette::Exit()
this->close();
Pylon::PylonTerminate();
}
//暂停按钮
void Cigarette::on_btn_pause_released()
@ -688,9 +691,8 @@ void Cigarette::OnOp()
//退出前执行
void Cigarette::OnExit()
{
//emit sengMsgToClog("Close the Application.");
emit sengMsgToClog("Close the Application.");
Exit();
exit(1);///
}
void Cigarette::OnRestart()
@ -2996,11 +2998,11 @@ bool Cigarette::ControlCamOpenOrClose(int Num,bool OpenOrClose)
}
}
Pylon::CBaslerUniversalInstantCamera* baslerCamera = BaslerCamHandle[Num];
if(baslerCamera && baslerCamera->IsOpen())
/*if(baslerCamera && baslerCamera->IsOpen())
{
baslerCamera->Close();
baslerCamera->GrabCameraEvents = false;
}
}*/
DeleteElement(pBaslerCaptureThread[Num]);
DeleteElement(pThread[Num]);
SingleCamInfo[Num].IsOpen = false;
@ -3643,7 +3645,9 @@ void Cigarette::recMsgFromUdp(QString data)
}
else if (data == "RESTART")
{
onrestart = true;
OnRestart();
onrestart = false;
}
else if (data == "GETSETTING")
{

@ -19,7 +19,7 @@
//#define CAP_FEED_BACK //拍照时也检测有没有测试结果,有的话就反馈
//#define DOUBLE_FEED_BACK //一次ng两次反馈ng信号
#endif
#define identify_Hik_YSXID//识别海康相机YSXID
//#define identify_Hik_YSXID//识别海康相机YSXID
#define Queue_Size 15
#define Unit_Queue_Size Queue_Size*3

Loading…
Cancel
Save