Commit 6400cf06 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

* Allow setting a non-null exp. time in FrelonAcq if

  in ExtGateMode as indication of gate duration.
* Ignore a non-null exp. time in Frelon::Camera if in ExtGate.
parent c9a05cfe
......@@ -394,12 +394,11 @@ class FrelonAcq:
@DEB_MEMBER_FUNCT
def setTriggerMode(self, trig_mode):
deb.Param('Setting trigger mode: %s' % trig_mode)
exp_time = prev_exp_time = self.m_ct_acq.getAcqExpoTime()
if trig_mode == IntTrig and prev_exp_time == 0:
exp_time = 1.0
prev_trig_mode = self.m_ct_acq.getTriggerMode()
set_exp_time = ((trig_mode == IntTrig) and (prev_trig_mode == ExtGate))
self.m_ct_acq.setTriggerMode(trig_mode)
if exp_time != prev_exp_time:
self.m_ct_acq.setAcqExpoTime(exp_time)
if set_exp_time:
self.m_ct_acq.setAcqExpoTime(1.0)
@DEB_MEMBER_FUNCT
def getTriggerMode(self):
......@@ -421,11 +420,6 @@ class FrelonAcq:
@DEB_MEMBER_FUNCT
def setExpTime(self, exp_time):
deb.Param('Setting exp. time: %s' % exp_time)
trig_mode = self.m_ct_acq.getTriggerMode()
if exp_time == 0 and trig_mode == ExtTrigSingle:
self.m_ct_acq.setTriggerMode(ExtGate)
elif exp_time > 0 and trig_mode == ExtGate:
self.m_ct_acq.setTriggerMode(ExtTrigSingle)
self.m_ct_acq.setAcqExpoTime(exp_time)
@DEB_MEMBER_FUNCT
......
......@@ -949,6 +949,12 @@ void Camera::setTrigMode(TrigMode trig_mode)
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(trig_mode);
m_trig_mode = trig_mode;
double exp_time;
getExpTime(exp_time);
if ((trig_mode == ExtGate) && (exp_time != 0))
setExpTime(0);
else if ((trig_mode != ExtGate) && (exp_time == 0))
setExpTime(1);
setNbFrames(m_nb_frames);
}
......@@ -981,6 +987,14 @@ void Camera::setExpTime(double exp_time)
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(exp_time);
TrigMode trig_mode;
getTrigMode(trig_mode);
if ((trig_mode == ExtGate) && (exp_time != 0)) {
DEB_TRACE() << "Ignoring " << DEB_VAR1(exp_time)
<< " in ExtGate trigger mode";
return;
}
bool ok = false;
int exp_val;
TimeUnitFactor seq_clist[] = { Microseconds, Milliseconds };
......
Supports Markdown
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