Commit d1306d1d authored by seb's avatar seb
Browse files

testfreloninterface link now with CtSave and processlib, next the test


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@84 45c4679d-1946-429d-baad-37912b19538b
parent b7e2ee14
sub-dirs = common hardware camera control
sub-dirs = third-party control common hardware camera
include global.inc
frelon-objs = ../src/Frelon.o ../../common/espia/src/Espia.o \
../../../hardware/src/Hw.o ../../../common/src/Common.o
../../../hardware/src/Hw.o ../../../common/src/Common.o
include ../../common/espia/include/espia.inc
LDFLAGS = -pthread -L$(ESPIA_DRV_LIB)
LDLIBS = -lespia
LDLIBS = -lespia
CXXFLAGS = -I../include -I../../common/espia/include \
-I../../../hardware/include -I../../../common/include \
-I../../../control/include/ \
-I../../../third-party/Processlib/core/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread
all: clean testfrelon testfreloninterface
......@@ -17,7 +19,7 @@ testfrelon: testfrelon.o $(frelon-objs)
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
testfreloninterface: testfreloninterface.o $(frelon-objs)
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS) ../../../control/src/Ct.o -L../../../third-party/Processlib/build -lprocesslib
clean:
rm -f *.o testfrelon testfreloninterface
#include "FrelonInterface.h"
#include "BufferSave.h"
#include "PoolThreadMgr.h"
#include "CtSaving.h"
#include "Data.h"
#include <iostream>
......@@ -10,7 +12,7 @@ using namespace std;
class TestFrameCallback : public HwFrameCallback
{
public:
TestFrameCallback(Interface& hw_inter, BufferSave& buffer_save,
TestFrameCallback(Interface& hw_inter, CtSaving& buffer_save,
Cond& acq_finished)
: m_hw_inter(hw_inter), m_buffer_save(buffer_save),
m_acq_finished(acq_finished) {}
......@@ -18,7 +20,7 @@ protected:
virtual bool newFrameReady(const HwFrameInfoType& frame_info);
private:
Interface& m_hw_inter;
BufferSave& m_buffer_save;
CtSaving& m_buffer_save;
Cond& m_acq_finished;
};
......@@ -32,7 +34,21 @@ bool TestFrameCallback::newFrameReady(const HwFrameInfoType& frame_info)
<< " frame_info=" << frame_info << endl
<< " nb_acq_frames=" << nb_acq_frames << endl
<< " status=" << status << endl;
m_buffer_save.writeFrame(frame_info);
Data aNewData = Data();
aNewData.frameNumber = frame_info.acq_frame_nb;
const Size &aSize = frame_info.frame_dim->getSize();
aNewData.width = aSize.getWidth();
aNewData.height = aSize.getHeight();
aNewData.type = Data::UINT16;
Buffer *aNewBuffer = new Buffer();
aNewBuffer->owner = Buffer::MAPPED;
aNewBuffer->data = (void*)frame_info.frame_ptr;
aNewData.setBuffer(aNewBuffer);
aNewBuffer->unref();
m_buffer_save.frameReady(aNewData);
HwSyncCtrlObj *hw_sync;
m_hw_inter.getHwCtrlObj(hw_sync);
......@@ -65,8 +81,18 @@ void test_frelon_hw_inter(bool do_reset)
Interface hw_inter(acq, buffer_mgr, cam);
cout << " Done!" << endl;
BufferSave buffer_save(BufferSave::EDF);
CtControl aControl(NULL);
CtSaving buffer_save(aControl);
CtSaving::Parameters saving_par;
saving_par.directory = ".";
saving_par.prefix = "img";
saving_par.suffix = ".edf";
saving_par.nextNumber = 0;
saving_par.savingMode = CtSaving::AutoFrame;
saving_par.overwritePolicy = CtSaving::Overwrite;
saving_par.framesPerFile = 1;
buffer_save.setParameters(saving_par);
Cond acq_finished;
TestFrameCallback cb(hw_inter, buffer_save, acq_finished);
......@@ -149,6 +175,7 @@ void test_frelon_hw_inter(bool do_reset)
print_status(hw_inter);
hw_inter.startAcq();
acq_finished.wait();
PoolThreadMgr::get().wait();
print_status(hw_inter);
hw_inter.stopAcq();
print_status(hw_inter);
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
MAKE_CMD1 = $(MAKE) -C software_operation
MAKE_CMD2 = $(MAKE) -C src
sub-dirs = software_operation src
all:
$(MAKE_CMD1) all
$(MAKE_CMD2) all
clean:
$(MAKE_CMD1) clean
$(MAKE_CMD2) clean
depend:
$(MAKE_CMD1) depend
$(MAKE_CMD2) depend
\ No newline at end of file
include ../global.inc
......@@ -12,6 +12,9 @@ namespace lima {
public:
struct ImageStatus {
ImageStatus();
void reset();
long LastImageAcquired;
long LastBaseImageReady;
long LastImageReady;
......@@ -32,7 +35,7 @@ namespace lima {
void reset();
private:
HwInterface m_hw;
HwInterface *m_hw;
mutable Cond m_cond;
ImageStatus m_img_status;
CtSaving *m_ct_saving;
......
......@@ -8,6 +8,8 @@
#include "ThreadUtils.h"
#include "CtControl.h"
class Data;
namespace lima {
......@@ -101,6 +103,7 @@ namespace lima {
void removeFrameHeader(long frame_nr);
void removeAllFrameHeaders();
void frameReady(Data &);
private:
class _SaveTask;
......@@ -122,7 +125,6 @@ namespace lima {
void _get_common_header(HeaderMap&);
void _takeHeader(std::map<long,HeaderMap>::iterator&, HeaderMap& header);
void _frame_ready(Data &);
void _post_save_task(Data&,_SaveTask*);
void _save_finnished(Data&);
};
......
ct-objs := SoftOpInternalMgr.o
SRC=SoftOpInternalMgr.cpp
SRCS=SoftOpInternalMgr.cpp
INCLUDES=-I../include -I../../../third-party/Processlib/core/include -I../../../third-party/Processlib/tasks/include
CXXFLAGS += $(INCLUDES) -Wall -pthread
CXXFLAGS += $(INCLUDES) -fPIC -Wall -pthread
all: CtSoftwareOperation.o
depend :
makedepend $(INCLUDES) $(SRC)
CtSoftwareOperation.o: $(ct-objs)
ld -o $@ -r $+
clean:
rm -f CtSoftwareOperation.o $(ct-objs)
rm -f CtSoftwareOperation.o $(ct-objs) *.P
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
#include "CtControl.h"
#include "CtSaving.h"
using namespace lima;
CtControl::CtControl(HwInterface *hw) :
m_hw(hw),m_ct_saving(NULL)
{
}
CtControl::~CtControl()
{
delete m_hw;
delete m_ct_saving;
}
void CtControl::prepareAcq()
{
}
void CtControl::startAcq()
{
}
void CtControl::stopAcq()
{
}
void CtControl::getAcqStatus()
{
}
void CtControl::getImageStatus(ImageStatus& status) const
{
}
void CtControl::reset()
{
}
//Struct ImageStatus
CtControl::ImageStatus::ImageStatus()
{
reset();
}
void CtControl::ImageStatus::reset()
{
LastImageAcquired = -1;
LastBaseImageReady = -1;
LastImageReady = -1;
LastImageSaved = -1;
LastCounterReady = -1;
}
......@@ -305,7 +305,7 @@ void CtSaving::_takeHeader(std::map<long,HeaderMap>::iterator &headerIter, Heade
}
void CtSaving::_frame_ready(Data &aData)
void CtSaving::frameReady(Data &aData)
{
AutoMutex aLock(m_cond.mutex());
switch(m_pars.savingMode)
......
ct-objs := CtSaving.o
ct-objs := CtSaving.o CtControl.o
SRC=CtSaving.cpp
SRCS=CtSaving.cpp CtControl.cpp
INCLUDES=-I../include -I../../common/include -I../../third-party/Processlib/core/include -I../../hardware/include
CXXFLAGS += $(INCLUDES) -fPIC -Wall -pthread
INCLUDES=-I../include -I../../common/include -I../../third-party/Processlib/core/include
CXXFLAGS += $(INCLUDES) -Wall -pthread
all: Ct.o
depend :
makedepend $(INCLUDES) $(SRC)
Ct.o: $(ct-objs) ../software_operation/src/CtSoftwareOperation.o
ld -o $@ -r $+
clean:
rm -f Ct.o $(ct-objs)
rm -f Ct.o $(ct-objs) *.P
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
all:Processlib/sip/Makefile Processlib/sip/processlib.so
Processlib/sip/Makefile:
cd Processlib/sip/ && python configure.py
Processlib/build/libprocesslib.so:
make -C Processlib/build -j2
Processlib/sip/processlib.so: Processlib/build/libprocesslib.so
make -C Processlib/sip -j2
clean:
cd Processlib/sip/ && python clean.py
make -C Processlib/build clean
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