Commit bd2f49dc authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Add IntTrigMult support (with M. Brueckner)

parent e01e83b0
......@@ -152,6 +152,8 @@ public:
void startAcq();
void stopAcq();
void triggerFrame();
void registerTimeRangesChangedCallback(TimeRangesChangedCallback& cb);
void unregisterTimeRangesChangedCallback(TimeRangesChangedCallback& cb);
......
......@@ -47,6 +47,7 @@ enum TrigMode {
Gating = slsDetectorDefs::GATE_FIX_NUMBER,
TriggeredGating = slsDetectorDefs::GATE_WITH_START_TRIGGER,
BurstTrigger = slsDetectorDefs::BURST_TRIGGER,
SoftTriggerExposure,
};
enum Settings {
......
......@@ -112,6 +112,8 @@ public:
void startAcq();
void stopAcq();
void triggerFrame();
void getStats(SlsDetector::Stats& stats /Out/, int port_idx=-1);
void setPixelDepthCPUAffinityMap(
......
......@@ -170,6 +170,7 @@ enum TrigMode {
Gating = GATE_FIX_NUMBER,
TriggeredGating = GATE_WITH_START_TRIGGER,
BurstTrigger = BURST_TRIGGER,
SoftTriggerExposure,
};
enum Settings {
......
......@@ -508,8 +508,11 @@ void Camera::setTrigMode(TrigMode trig_mode)
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(trig_mode);
waitState(Idle);
TrigMode cam_trig_mode = trig_mode;
if (trig_mode == Defs::SoftTriggerExposure)
cam_trig_mode = Defs::TriggerExposure;
typedef slsDetectorDefs::externalCommunicationMode ExtComMode;
ExtComMode mode = static_cast<ExtComMode>(trig_mode);
ExtComMode mode = static_cast<ExtComMode>(cam_trig_mode);
m_det->setTimingMode(mode);
m_trig_mode = trig_mode;
setNbFrames(m_lima_nb_frames);
......@@ -856,6 +859,20 @@ void Camera::stopAcq()
THROW_HW_ERROR(Error) << "Camera not Idle";
}
void Camera::triggerFrame()
{
DEB_MEMBER_FUNCT();
if (m_trig_mode != Defs::SoftTriggerExposure)
THROW_HW_ERROR(InvalidValue) << "Wrong trigger mode";
AutoMutex l = lock();
if (getEffectiveState() != Running)
THROW_HW_ERROR(Error) << "Camera not Running";
m_det->sendSoftwareTrigger();
}
bool Camera::checkLostPackets()
{
DEB_MEMBER_FUNCT();
......
......@@ -193,6 +193,7 @@ TimeRangesChangedCallback::timeRangesChanged(TimeRanges time_ranges)
typedef pair<TrigMode, Defs::TrigMode> TrigPair;
static const TrigPair Lima2CamTrigModeCList[] = {
TrigPair(IntTrig, Defs::Auto),
TrigPair(IntTrigMult, Defs::SoftTriggerExposure),
TrigPair(ExtTrigSingle, Defs::BurstTrigger),
TrigPair(ExtTrigMult, Defs::TriggerExposure),
TrigPair(ExtGate, Defs::Gating),
......@@ -399,7 +400,13 @@ void Interface::prepareAcq()
void Interface::startAcq()
{
DEB_MEMBER_FUNCT();
m_cam.startAcq();
Defs::TrigMode trig_mode;
m_cam.getTrigMode(trig_mode);
bool int_trig_multi = (trig_mode == Defs::SoftTriggerExposure);
if (!int_trig_multi || (m_cam.getState() != Running))
m_cam.startAcq();
if (int_trig_multi)
m_cam.triggerFrame();
}
void Interface::stopAcq()
......
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