mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 11:49:42 +08:00
添加了新的控制基类,现在iSIF和IS1的控制类将派生自基类;学习并测试了Qthread一些功能;测试了QMutex的一些功能
This commit is contained in:
@ -0,0 +1,50 @@
|
||||
#include "ThreadDataGrabber.h"
|
||||
|
||||
ZZ_DataGrabberThread::ZZ_DataGrabberThread(QObject* parent /*= nullptr*/)
|
||||
{
|
||||
SetupSignals();
|
||||
StartGrabberThread();
|
||||
}
|
||||
|
||||
ZZ_DataGrabberThread::~ZZ_DataGrabberThread()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int ZZ_DataGrabberThread::SetupSignals()
|
||||
{
|
||||
connect(this, &ZZ_DataGrabberThread::SignalStartGrabOnce, &m_tcISIFCtrlThread, &ZZ_iSIFControlThread::StartTestAcquisition);
|
||||
connect(this, &ZZ_DataGrabberThread::SignalStartGrabOnce, &m_tcIS1CtrlThread, &ZZ_IS1ControlThread::StartTestAcquisition);
|
||||
|
||||
bool bres = connect(this, &ZZ_DataGrabberThread::SignalStopGrab, &m_tcISIFCtrlThread, &ZZ_iSIFControlThread::StopTestAcquisition, Qt::DirectConnection);
|
||||
bres = connect(this, &ZZ_DataGrabberThread::SignalStopGrab, &m_tcIS1CtrlThread, &ZZ_IS1ControlThread::StopTestAcquisition, Qt::DirectConnection);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ZZ_DataGrabberThread::StartGrabberThread()
|
||||
{
|
||||
m_pqISIFThreadHolder = new QThread();
|
||||
m_tcISIFCtrlThread.moveToThread(m_pqISIFThreadHolder);
|
||||
m_pqISIFThreadHolder->start();
|
||||
|
||||
m_pqIS1ThreadHolder = new QThread();
|
||||
m_tcIS1CtrlThread.moveToThread(m_pqIS1ThreadHolder);
|
||||
m_pqIS1ThreadHolder->start();
|
||||
//m_stCameraServiceThread.SetController(this);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ZZ_DataGrabberThread::TestGrab()
|
||||
{
|
||||
emit SignalStartGrabOnce();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ZZ_DataGrabberThread::StopTestGrab()
|
||||
{
|
||||
emit SignalStopGrab();
|
||||
//m_tcISIFCtrlThread.StopTestAcquisition();
|
||||
//m_tcIS1CtrlThread.StopTestAcquisition();
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user