Commit 682372e6 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron

* Added Frelon native min_latency_time (Readout & Transfer) support

* Support dynamic min_latency_time with Accumulation in CtAcquisition
parent dd88e0b3
Subproject commit 75fd770dfb846293b9084a1b6af7a916a090429e
Subproject commit bc07a23e8211fdd09bbe2b8920721e75dacb3777
Subproject commit 21abf1dfe1735999aefe1c1756d4ea8ea9e45618
Subproject commit 2e957572ff39cfcb75b040cd631c54be6e7da286
......@@ -22,6 +22,8 @@
#include "CtAcquisition.h"
#include "math.h"
#include <algorithm>
using std::max;
#define CHECK_EXPOTIME(val) \
if (val < m_valid_ranges.min_exp_time) \
......@@ -175,7 +177,7 @@ void CtAcquisition::reset()
DEB_MEMBER_FUNCT();
m_inpars.reset();
m_inpars.latencyTime = m_valid_ranges.min_lat_time;
m_inpars.latencyTime = 0;
m_applied_once= false;
//Check auto exposure capability
......@@ -249,6 +251,8 @@ void CtAcquisition::_hwRead()
m_hw_sync->getTrigMode(m_hwpars.triggerMode);
m_hw_sync->getExpTime(m_hwpars.acqExpoTime);
m_hw_sync->getLatTime(m_hwpars.latencyTime);
if (m_hwpars.latencyTime <= m_valid_ranges.min_lat_time)
m_hwpars.latencyTime = 0;
m_hw_sync->getNbFrames(m_hwpars.acqNbFrames);
switch (m_hwpars.acqMode) {
......@@ -276,7 +280,8 @@ void CtAcquisition::_apply()
m_hw_sync->setAcqMode(m_inpars.acqMode);
if (m_changes.triggerMode) m_hw_sync->setTrigMode(m_inpars.triggerMode);
if (m_changes.latencyTime) m_hw_sync->setLatTime(m_inpars.latencyTime);
double lat_time = max(m_inpars.latencyTime, m_valid_ranges.min_lat_time);
if (m_changes.latencyTime) m_hw_sync->setLatTime(lat_time);
if(m_changes.acqMode || m_changes.acqNbFrames)
{
......@@ -638,8 +643,8 @@ void CtAcquisition::setLatencyTime(double lat_time)
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(lat_time);
if (lat_time < m_valid_ranges.min_lat_time)
lat_time = m_valid_ranges.min_lat_time;
if (lat_time <= m_valid_ranges.min_lat_time)
lat_time = 0;
if (lat_time > m_valid_ranges.max_lat_time)
THROW_CTL_ERROR(InvalidValue)
<< "Specified latency time " << DEB_VAR1(lat_time) << " too long: "
......@@ -651,7 +656,7 @@ void CtAcquisition::getLatencyTime(double& time) const
{
DEB_MEMBER_FUNCT();
time= m_inpars.latencyTime;
time= max(m_inpars.latencyTime, m_valid_ranges.min_lat_time);
DEB_RETURN() << DEB_VAR1(time);
}
......
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