Commit 12f071e7 authored by seb's avatar seb
Browse files

- Change the way to stop the acquisition in case of overrun


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@208 45c4679d-1946-429d-baad-37912b19538b
parent e0b5e33f
......@@ -112,7 +112,7 @@ namespace lima
void unregisterImageStatusCallback(ImageStatusCallback& cb);
protected:
void newFrameReady(Data& data);
bool newFrameReady(Data& data);
void newFrameToSave(Data& data);
void newBaseImageReady(Data &data);
void newImageReady(Data &data);
......
......@@ -90,7 +90,7 @@ using namespace lima;
void unregisterImageStatusCallback(ImageStatusCallback& cb);
protected:
void newFrameReady(Data& data);
bool newFrameReady(Data& data);
void newFrameToSave(Data& data);
void newBaseImageReady(Data &data);
void newImageReady(Data &data);
......
......@@ -9,8 +9,7 @@ bool CtBufferFrameCB::newFrameReady(const HwFrameInfoType& frame_info)
Data fdata;
CtBuffer::getDataFromHwFrameInfo(fdata,frame_info);
m_ct->newFrameReady(fdata);
return true;
return m_ct->newFrameReady(fdata);
}
CtBuffer::CtBuffer(HwInterface *hw)
......
......@@ -322,41 +322,42 @@ void CtControl::reset()
m_ct_image->reset();
}
void CtControl::newFrameReady(Data& fdata)
bool CtControl::newFrameReady(Data& fdata)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(fdata);
DEB_TRACE() << "Frame acq.nb " << fdata.frameNumber << " received";
bool aContinueFlag = true;
AutoMutex aLock(m_cond.mutex());
if(_checkOverrun(fdata))
aContinueFlag = false;// Stop Acquisition on overun
else
{
m_status.ImageCounters.LastImageAcquired= fdata.frameNumber;
aLock.unlock();
stopAcq(); // Stop Acquisition on overun
return;
}
m_status.ImageCounters.LastImageAcquired= fdata.frameNumber;
aLock.unlock();
TaskMgr *mgr = new TaskMgr();
mgr->setInputData(fdata);
TaskMgr *mgr = new TaskMgr();
mgr->setInputData(fdata);
int internal_stage;
m_op_int->addTo(*mgr, internal_stage);
int internal_stage;
m_op_int->addTo(*mgr, internal_stage);
int last_link,last_sink;
m_op_ext->addTo(*mgr, internal_stage, last_link, last_sink);
int last_link,last_sink;
m_op_ext->addTo(*mgr, internal_stage, last_link, last_sink);
if (internal_stage || last_link || last_sink)
PoolThreadMgr::get().addProcess(mgr);
else
delete mgr;
if (!internal_stage && !last_link)
newBaseImageReady(fdata);
if (internal_stage || last_link || last_sink)
PoolThreadMgr::get().addProcess(mgr);
else
delete mgr;
if (!internal_stage && !last_link)
newBaseImageReady(fdata);
if (m_img_status_cb)
m_img_status_cb->imageStatusChanged(m_status.ImageCounters);
if (m_img_status_cb)
m_img_status_cb->imageStatusChanged(m_status.ImageCounters);
}
return aContinueFlag;
}
void CtControl::newBaseImageReady(Data &aData)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment