Commit d5077a74 authored by ahoms's avatar ahoms

* modified global.inc and Makefiles to first build all

  the src directories and then all the test directories
* updated to changes in control (requiring software_operation incl)
* fixed the final frame Timestamp in frame acc. mode
* fixed the acq. (sync) number of frames in frame acc. mode
* added frame acc. test in testfreloninterface
* avoid deleting the HwInterface in CtControl, which did not create it.



git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@121 45c4679d-1946-429d-baad-37912b19538b
parent a01f49d3
sub-dirs = third-party control common hardware camera build
sub-dirs = third-party common hardware control camera build
all: src test
include global.inc
......@@ -17,6 +17,11 @@ LDFLAGS += -L../third-party/Processlib/build \
LDLIBS += -lprocesslib -lespia
src: liblima.so
test:
@true
liblima.so: $(lima-objs)
$(CXX) -shared -o $@ -fPIC $+ $(LDFLAGS) $(LDLIBS)
......
sub-dirs = src test
src-dirs = src
test-dirs = test
include ../../../global.inc
......@@ -10,6 +10,7 @@ LDLIBS = -lespia
CXXFLAGS = -I../include \
-I../../../../hardware/include -I../../../../common/include \
-I../../../../control/include/ \
-I../../../../control/software_operation/include/ \
-I../../../../third-party/Processlib/core/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread
......
sub-dirs = src test
src-dirs = src
test-dirs = test
include ../../global.inc
......@@ -91,7 +91,7 @@ class BufferCtrlObj : public HwBufferCtrlObj
class SyncCtrlObj : public HwSyncCtrlObj
{
public:
SyncCtrlObj(Espia::Acq& acq, Camera& cam);
SyncCtrlObj(Espia::Acq& acq, Camera& cam, BufferCtrlObj& buffer_ctrl);
virtual ~SyncCtrlObj();
virtual void setTrigMode(TrigMode trig_mode);
......@@ -111,6 +111,7 @@ class SyncCtrlObj : public HwSyncCtrlObj
private:
Espia::Acq& m_acq;
Camera& m_cam;
BufferCtrlObj& m_buffer_ctrl;
};
......
......@@ -181,8 +181,8 @@ void BufferCtrlObj::unregisterFrameCallback(HwFrameCallback& frame_cb)
* \brief SyncCtrlObj constructor
*******************************************************************/
SyncCtrlObj::SyncCtrlObj(Acq& acq, Camera& cam)
: m_acq(acq), m_cam(cam)
SyncCtrlObj::SyncCtrlObj(Acq& acq, Camera& cam, BufferCtrlObj& buffer_ctrl)
: m_acq(acq), m_cam(cam), m_buffer_ctrl(buffer_ctrl)
{
}
......@@ -222,13 +222,19 @@ void SyncCtrlObj::getLatTime(double& lat_time)
void SyncCtrlObj::setNbFrames(int nb_frames)
{
m_acq.setNbFrames(nb_frames);
m_cam.setNbFrames(nb_frames);
int nb_acc_frames;
m_buffer_ctrl.getNbAccFrames(nb_acc_frames);
int real_nb_frames = nb_frames * nb_acc_frames;
m_acq.setNbFrames(real_nb_frames);
m_cam.setNbFrames(real_nb_frames);
}
void SyncCtrlObj::getNbFrames(int& nb_frames)
{
m_acq.getNbFrames(nb_frames);
int nb_acc_frames;
m_buffer_ctrl.getNbAccFrames(nb_acc_frames);
nb_frames /= nb_acc_frames;
}
void SyncCtrlObj::getValidRanges(ValidRangesType& valid_ranges)
......@@ -301,7 +307,7 @@ void RoiCtrlObj::getRoi(Roi& roi)
Interface::Interface(Acq& acq, BufferCtrlMgr& buffer_mgr,
Camera& cam)
: m_acq(acq), m_buffer_mgr(buffer_mgr), m_cam(cam),
m_det_info(cam), m_buffer(buffer_mgr), m_sync(acq, cam),
m_det_info(cam), m_buffer(buffer_mgr), m_sync(acq, cam, m_buffer),
m_bin(cam), m_roi(cam)
{
HwDetInfoCtrlObj *det_info = &m_det_info;
......@@ -366,6 +372,7 @@ void Interface::prepareAcq()
void Interface::startAcq()
{
m_buffer_mgr.setStartTimestamp(Timestamp::now());
m_acq.start();
m_cam.start();
}
......
......@@ -10,6 +10,7 @@ LDLIBS = -lespia
CXXFLAGS = -I../include -I../../common/espia/include \
-I../../../hardware/include -I../../../common/include \
-I../../../control/include/ \
-I../../../control/software_operation/include/ \
-I../../../third-party/Processlib/core/include \
-I../../../third-party/Processlib/tasks/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread
......
......@@ -153,7 +153,7 @@ void test_frelon_hw_inter(bool do_reset)
Frelon::Interface hw_inter(acq, buffer_mgr, cam);
cout << " Done!" << endl;
CtControl aControl(NULL);
CtControl aControl(&hw_inter);
CtSaving buffer_save(aControl);
CtSaving::Parameters saving_par;
saving_par.directory = ".";
......@@ -290,6 +290,20 @@ void test_frelon_hw_inter(bool do_reset)
print_status(hw_inter);
hw_inter.stopAcq();
print_status(hw_inter);
hw_buffer->setFrameDim(effect_frame_dim);
hw_buffer->setNbAccFrames(5);
hw_buffer->setNbBuffers(10);
hw_sync->setNbFrames(3);
print_status(hw_inter);
hw_inter.startAcq();
acq_finished.wait();
PoolThreadMgr::get().wait();
print_status(hw_inter);
hw_inter.stopAcq();
print_status(hw_inter);
}
int main(int argc, char *argv[])
......
sub-dirs = src test
src-dirs = src
test-dirs = test
include ../../global.inc
sub-dirs = src test
src-dirs = src
test-dirs = test
include ../global.inc
sub-dirs = software_operation src test
src-dirs = software_operation src
test-dirs = test
include ../global.inc
......
......@@ -26,7 +26,6 @@ CtControl::CtControl(HwInterface *hw) :
CtControl::~CtControl()
{
delete m_hw;
delete m_ct_saving;
delete m_ct_acq;
delete m_ct_image;
......
sub-dirs-clean = $(sub-dirs:%=%.clean)
.PHONY: src test clean
.PHONY: $(sub-dirs)
ifneq ($(sub-dirs),)
src-targets += $(sub-dirs:%=%.src)
test-targets += $(sub-dirs:%=%.test)
clean-targets += $(sub-dirs:%=%.clean)
all: $(sub-dirs)
$(src-targets):
make -C $(@:%.src=%) src
clean: $(sub-dirs-clean)
$(test-targets):
make -C $(@:%.test=%) test
$(sub-dirs):
make -C $(@)
$(clean-targets):
make -C $(@:%.clean=%) clean
else
ifneq ($(src-dirs),)
src-targets += $(src-dirs:%=%.src)
clean-targets += $(src-dirs:%=%.clean)
endif
ifneq ($(test-dirs),)
test-targets += $(test-dirs:%=%.test)
clean-targets += $(test-dirs:%=%.clean)
endif
$(src-targets):
make -C $(@:%.src=%)
$(sub-dirs-clean):
$(test-targets):
make -C $(@:%.test=%)
$(clean-targets):
make -C $(@:%.clean=%) clean
endif
src: $(src-targets)
test: $(test-targets)
clean: $(clean-targets)
sub-dirs = src
src-dirs = src
include ../global.inc
......@@ -463,8 +463,8 @@ BufferCbMgr& BufferCtrlMgr::getAcqBufferMgr()
void BufferCtrlMgr::setStartTimestamp(Timestamp start_ts)
{
m_acq_buffer_mgr.setStartTimestamp(start_ts);
if (m_effect_buffer_mgr != &m_acq_buffer_mgr)
m_effect_buffer_mgr->setStartTimestamp(start_ts);
if (getAcqMode() == Acc)
m_aux_buffer_mgr.setStartTimestamp(start_ts);
}
void BufferCtrlMgr::getStartTimestamp(Timestamp& start_ts)
......@@ -531,10 +531,13 @@ bool BufferCtrlMgr::acqFrameReady(const HwFrameInfoType& acq_frame_info)
aux_frame_ptr, aux_frame_dim, valid_pixels);
if ((acc_idx == m_nb_acc_frames - 1) && (m_frame_cb_act)) {
Timestamp start_ts;
aux_mgr.getStartTimestamp(start_ts);
Timestamp frame_ts = Timestamp::now() - start_ts;
HwFrameInfoType aux_frame_info(aux_frame_nb,
aux_frame_ptr,
&aux_frame_dim,
Timestamp::now(),
frame_ts,
valid_pixels);
return newFrameReady(aux_frame_info);
}
......
all: src test
all:Processlib/sip/Makefile Processlib/sip/processlib.so
src: Processlib/sip/Makefile Processlib/sip/processlib.so
test:
@echo
Processlib/sip/Makefile:
cd Processlib/sip/ && python configure.py
......
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