Commit b58facf2 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron

* Added (empty) Frelon::TimingCtrl

* Set Frelon::Camera NbFrames to 1 if trig_mode is ExtGate
* Send Frelon::Camera Stop cmd only of if NbFrames > 1
parent 2da304cb
......@@ -3,6 +3,7 @@
#include "FrelonSerialLine.h"
#include "FrelonModel.h"
#include "FrelonTimingCtrl.h"
#include "HwMaxImageSizeCallback.h"
namespace lima
......@@ -29,6 +30,8 @@ class Camera : public HwMaxImageSizeCallbackGen
void getComplexSerialNb(int& complex_ser_nb);
Model& getModel();
TimingCtrl& getTimingCtrl();
void setInputChan(InputChan input_chan);
void getInputChan(InputChan& input_chan);
......@@ -138,6 +141,7 @@ class Camera : public HwMaxImageSizeCallbackGen
SerialLine m_ser_line;
Model m_model;
TimingCtrl m_timing_ctrl;
Point m_roi_offset;
TrigMode m_trig_mode;
int m_nb_frames;
......
#ifndef FRELONTIMINGCTRL_H
#define FRELONTIMINGCTRL_H
#include "FrelonModel.h"
#include "FrelonSerialLine.h"
namespace lima
{
namespace Frelon
{
class TimingCtrl
{
DEB_CLASS_NAMESPC(DebModCamera, "TimingCtrl", "Frelon");
public:
TimingCtrl(Model& model, SerialLine& ser_line);
~TimingCtrl();
private:
Model& m_model;
SerialLine& m_ser_line;
};
} // namespace Frelon
} // namespace lima
#endif // FRELONTIMINGCTRL_H
......@@ -24,6 +24,8 @@ class Camera
void getComplexSerialNb(int& complex_ser_nb /Out/);
Frelon::Model& getModel();
Frelon::TimingCtrl& getTimingCtrl();
void setInputChan(Frelon::InputChan input_chan);
void getInputChan(Frelon::InputChan& input_chan /Out/);
......
namespace Frelon
{
class TimingCtrl
{
%TypeHeaderCode
#include "FrelonTimingCtrl.h"
%End
public:
TimingCtrl(Frelon::Model& model, Frelon::SerialLine& ser_line);
~TimingCtrl();
};
}; // namespace Frelon
......@@ -11,7 +11,8 @@ const double Camera::MaxIdleWaitTime = 1.5;
Camera::Camera(Espia::SerialLine& espia_ser_line)
: m_ser_line(espia_ser_line), m_mis_cb_act(false)
: m_ser_line(espia_ser_line), m_timing_ctrl(m_model, m_ser_line),
m_mis_cb_act(false)
{
DEB_CONSTRUCTOR();
......@@ -150,6 +151,11 @@ Model& Camera::getModel()
return m_model;
}
TimingCtrl& Camera::getTimingCtrl()
{
return m_timing_ctrl;
}
int Camera::getModesAvail()
{
DEB_MEMBER_FUNCT();
......@@ -970,7 +976,8 @@ void Camera::setNbFrames(int nb_frames)
TrigMode trig_mode;
getTrigMode(trig_mode);
int cam_nb_frames = (trig_mode == ExtTrigMult) ? 1 : nb_frames;
bool one_frame = (trig_mode == ExtTrigMult) || (trig_mode == ExtGate);
int cam_nb_frames = one_frame ? 1 : nb_frames;
writeRegister(NbFrames, cam_nb_frames);
m_nb_frames = nb_frames;
}
......@@ -1044,8 +1051,12 @@ void Camera::stop()
TrigMode trig_mode;
getTrigMode(trig_mode);
if (trig_mode != ExtGate) {
DEB_TRACE() << "Aborting current acquisition";
sendCmd(Stop);
int cam_nb_frames;
readRegister(NbFrames, cam_nb_frames);
if (cam_nb_frames > 1) {
DEB_TRACE() << "Aborting current acquisition";
sendCmd(Stop);
}
}
DEB_TRACE() << "Waiting for camera to become idle";
......
#include "FrelonTimingCtrl.h"
using namespace lima;
using namespace lima::Frelon;
using namespace std;
TimingCtrl::TimingCtrl(Model& model, SerialLine& ser_line)
: m_model(model), m_ser_line(ser_line)
{
DEB_CONSTRUCTOR();
}
TimingCtrl::~TimingCtrl()
{
DEB_DESTRUCTOR();
}
......@@ -2,7 +2,7 @@
include ../../common/espia/include/espia.inc
frelon-objs = FrelonBase.o FrelonSerialLine.o FrelonModel.o FrelonCamera.o \
FrelonInterface.o
FrelonTimingCtrl.o FrelonInterface.o
SRCS = $(frelon-objs:.o=.cpp)
......
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