Commit 21863ac7 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron

* Updated SoftBufferCtrlObj usage in Mythen plugin:

  removed unused Mythen::BufferCtrlObj and using good one in Interface::reset
parent f929f858
......@@ -49,7 +49,7 @@ namespace lima
int cam_sim_mode;
HwBufferCtrlObj* getBufferMgr();
HwBufferCtrlObj* getBufferCtrlObj();
int getTrigMode();
......@@ -140,7 +140,7 @@ namespace lima
void _allocBuffer();
SoftBufferCtrlMgr m_buffer_ctrl_mgr;
SoftBufferCtrlObj m_buffer_ctrl_obj;
bool m_cam_connected;
......
......@@ -57,43 +57,6 @@ private:
};
/*******************************************************************
* \class BufferCtrlObj
* \brief Control object providing Mythen buffering interface
*******************************************************************/
class BufferCtrlObj : public HwBufferCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "BufferCtrlObj", "Mythen");
public:
BufferCtrlObj(Camera& cam);
virtual ~BufferCtrlObj();
virtual void setFrameDim(const FrameDim& frame_dim);
virtual void getFrameDim( FrameDim& frame_dim);
virtual void setNbBuffers(int nb_buffers);
virtual void getNbBuffers(int& nb_buffers);
virtual void setNbConcatFrames(int nb_concat_frames);
virtual void getNbConcatFrames(int& nb_concat_frames);
virtual void getMaxNbBuffers(int& max_nb_buffers);
virtual void *getBufferPtr(int buffer_nb, int concat_frame_nb = 0);
virtual void *getFramePtr(int acq_frame_nb);
virtual void getStartTimestamp(Timestamp& start_ts);
virtual void getFrameInfo(int acq_frame_nb, HwFrameInfoType& info);
virtual void registerFrameCallback(HwFrameCallback& frame_cb);
virtual void unregisterFrameCallback(HwFrameCallback& frame_cb);
private:
// BufferCtrlMgr m_buffer_mgr;
Camera& m_cam;
};
/*******************************************************************
* \class SyncCtrlObj
* \brief Control object providing Mythen synchronization interface
......@@ -104,7 +67,7 @@ class SyncCtrlObj : public HwSyncCtrlObj
DEB_CLASS_NAMESPC(DebModCamera, "SyncCtrlObj", "Mythen");
public:
SyncCtrlObj(Camera& cam, HwBufferCtrlObj& buffer_ctrl, DetInfoCtrlObj& det);
SyncCtrlObj(Camera& cam, DetInfoCtrlObj& det);
virtual ~SyncCtrlObj();
virtual bool checkTrigMode(TrigMode trig_mode);
......@@ -175,7 +138,6 @@ private:
Camera& m_cam;
CapList m_cap_list;
DetInfoCtrlObj m_det_info;
BufferCtrlObj m_buffer;
SyncCtrlObj m_sync;
BinCtrlObj m_bin;
};
......
......@@ -70,7 +70,7 @@ void Camera::CameraThread::execStartAcq()
setStatus(Exposure);
StdBufferCbMgr& buffer_mgr = m_cam->m_buffer_ctrl_mgr.getBuffer();
StdBufferCbMgr& buffer_mgr = m_cam->m_buffer_ctrl_obj.getBuffer();
buffer_mgr.setStartTimestamp(Timestamp::now());
int nb_frames = m_cam->m_nb_frames;
......@@ -379,11 +379,11 @@ Camera::~Camera()
}
HwBufferCtrlObj* Camera::getBufferMgr()
HwBufferCtrlObj* Camera::getBufferCtrlObj()
{
DEB_MEMBER_FUNCT();
return &m_buffer_ctrl_mgr;
return &m_buffer_ctrl_obj;
}
Camera::Status Camera::getStatus()
......
......@@ -129,175 +129,11 @@ void DetInfoCtrlObj::
{
}
/*******************************************************************
* \brief BufferCtrlObj constructor
*******************************************************************/
BufferCtrlObj::BufferCtrlObj(Camera& cam)
:
m_cam(cam)
// ,m_buffer_mgr(cam.getBufferMgr())
{
DEB_CONSTRUCTOR();
////m_reader = new Reader(com,*this);
////m_reader->go(2000);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
BufferCtrlObj::~BufferCtrlObj()
{
DEB_DESTRUCTOR();
////m_reader->stop();
////m_reader->exit();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setFrameDim(const FrameDim& frame_dim)
{
DEB_MEMBER_FUNCT();
// m_buffer_mgr.setFrameDim(frame_dim);
return;
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getFrameDim(FrameDim& frame_dim)
{
DEB_MEMBER_FUNCT();
/*
Size image_size;
m_det.getMaxImageSize(image_size);
frame_dim.setSize(image_size);
ImageType image_type;
m_det.getDefImageType(image_type);
frame_dim.setImageType(image_type);
*/
// m_buffer_mgr.getFrameDim(frame_dim);//remove or not ??
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setNbBuffers(int nb_buffers)
{
DEB_MEMBER_FUNCT();
// m_buffer_mgr.setNbBuffers(nb_buffers);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getNbBuffers(int& nb_buffers)
{
DEB_MEMBER_FUNCT();
// m_buffer_mgr.getNbBuffers(nb_buffers);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setNbConcatFrames(int nb_concat_frames)
{
DEB_MEMBER_FUNCT();
// m_buffer_mgr.setNbConcatFrames(nb_concat_frames);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getNbConcatFrames(int& nb_concat_frames)
{
DEB_MEMBER_FUNCT();
// m_buffer_mgr.getNbConcatFrames(nb_concat_frames);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getMaxNbBuffers(int& max_nb_buffers)
{
DEB_MEMBER_FUNCT();
Size imageSize;
// m_det.getMaxImageSize(imageSize);
// max_nb_buffers = ( (Communication::DEFAULT_TMPFS_SIZE)/(imageSize.getWidth() * imageSize.getHeight() * 4) )/2; //4 == image 32bits
//cout<<"> max_nb_buffers = "<<max_nb_buffers<<endl;
////m_buffer_mgr.getMaxNbBuffers(max_nb_buffers);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void *BufferCtrlObj::getBufferPtr(int buffer_nb, int concat_frame_nb)
{
DEB_MEMBER_FUNCT();
// return m_buffer_mgr.getBufferPtr(buffer_nb, concat_frame_nb);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void *BufferCtrlObj::getFramePtr(int acq_frame_nb)
{
DEB_MEMBER_FUNCT();
// return m_buffer_mgr.getFramePtr(acq_frame_nb);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getStartTimestamp(Timestamp& start_ts)
{
DEB_MEMBER_FUNCT();
// m_buffer_mgr.getStartTimestamp(start_ts);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getFrameInfo(int acq_frame_nb, HwFrameInfoType& info)
{
DEB_MEMBER_FUNCT();
// m_buffer_mgr.getFrameInfo(acq_frame_nb, info);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::registerFrameCallback(HwFrameCallback& frame_cb)
{
DEB_MEMBER_FUNCT();
//@TODO
// m_buffer_mgr.registerFrameCallback(frame_cb);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::unregisterFrameCallback(HwFrameCallback& frame_cb)
{
DEB_MEMBER_FUNCT();
//@TODO
// m_buffer_mgr.unregisterFrameCallback(frame_cb);
}
/*******************************************************************
* \brief SyncCtrlObj constructor
*******************************************************************/
SyncCtrlObj::SyncCtrlObj(Camera& cam, HwBufferCtrlObj& buffer_ctrl, DetInfoCtrlObj& det)
SyncCtrlObj::SyncCtrlObj(Camera& cam, DetInfoCtrlObj& det)
: HwSyncCtrlObj(), m_cam(cam)
{
DEB_CONSTRUCTOR();
......@@ -503,8 +339,7 @@ void BinCtrlObj::checkBin(Bin& bin)
Interface::Interface(Camera& cam)
: m_cam(cam),
m_det_info(cam),
m_buffer(cam),
m_sync(cam, m_buffer, m_det_info),
m_sync(cam, m_det_info),
m_bin(cam)
{
DEB_CONSTRUCTOR();
......@@ -512,7 +347,8 @@ Interface::Interface(Camera& cam)
HwDetInfoCtrlObj *det_info = &m_det_info;
m_cap_list.push_back(HwCap(det_info));
m_cap_list.push_back(HwCap(cam.getBufferMgr()));
HwBufferCtrlObj *buffer = cam.getBufferCtrlObj();
m_cap_list.push_back(HwCap(buffer));
HwSyncCtrlObj *sync = &m_sync;
m_cap_list.push_back(HwCap(sync));
......@@ -555,10 +391,12 @@ void Interface::reset(ResetLevel reset_level)
ImageType image_type;
m_det_info.getDefImageType(image_type);
FrameDim frame_dim(image_size, image_type);
m_buffer.setFrameDim(frame_dim);
m_buffer.setNbConcatFrames(1);
m_buffer.setNbBuffers(1);
HwBufferCtrlObj *buffer = m_cam.getBufferCtrlObj();
buffer->setFrameDim(frame_dim);
buffer->setNbConcatFrames(1);
buffer->setNbBuffers(1);
}
//-----------------------------------------------------
......
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