add a compile option for sps image

parent c285bb78
...@@ -114,7 +114,9 @@ private: ...@@ -114,7 +114,9 @@ private:
CtSaving *m_ct_saving; CtSaving *m_ct_saving;
CtImage *m_ct_image; CtImage *m_ct_image;
CtBuffer *m_ct_buffer; CtBuffer *m_ct_buffer;
#ifdef WITH_SPS_IMAGE
CtSpsImage *m_ct_display; CtSpsImage *m_ct_display;
#endif
ImageStatusCallback *m_img_status_cb; ImageStatusCallback *m_img_status_cb;
}; };
...@@ -137,17 +139,19 @@ FrelonAcq::FrelonAcq(int espia_dev_nb) ...@@ -137,17 +139,19 @@ FrelonAcq::FrelonAcq(int espia_dev_nb)
m_ct_saving = ct->saving(); m_ct_saving = ct->saving();
m_ct_image = ct->image(); m_ct_image = ct->image();
m_ct_buffer = ct->buffer(); m_ct_buffer = ct->buffer();
#ifdef WITH_SPS_IMAGE
m_ct_display = ct->display(); m_ct_display = ct->display();
#endif
printDefaults(); printDefaults();
AutoPtr<ImageStatusCallback> img_status_cb; AutoPtr<ImageStatusCallback> img_status_cb;
img_status_cb = new ImageStatusCallback(*ct, m_acq_state); img_status_cb = new ImageStatusCallback(*ct, m_acq_state);
ct->registerImageStatusCallback(*img_status_cb); ct->registerImageStatusCallback(*img_status_cb);
#ifdef WITH_SPS_IMAGE
m_ct_display->setNames("_ccd_ds_", "frelon_live"); m_ct_display->setNames("_ccd_ds_", "frelon_live");
m_ct_display->setActive(true); m_ct_display->setActive(true);
#endif
DEB_TRACE() << "All is OK!"; DEB_TRACE() << "All is OK!";
m_ct = ct.forget(); m_ct = ct.forget();
m_img_status_cb = img_status_cb.forget(); m_img_status_cb = img_status_cb.forget();
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
#include "TaskMgr.h" #include "TaskMgr.h"
#include "TaskEventCallback.h" #include "TaskEventCallback.h"
#include "SoftRoi.h" #include "SoftRoi.h"
#ifdef WITH_SPS_IMAGE
#include "CtSpsImage.h" #include "CtSpsImage.h"
#endif
#include "AcqState.h" #include "AcqState.h"
#include <iostream> #include <iostream>
...@@ -26,8 +28,13 @@ class SoftRoiCallback : public TaskEventCallback ...@@ -26,8 +28,13 @@ class SoftRoiCallback : public TaskEventCallback
DEB_CLASS(DebModTest, "SoftRoiCallback"); DEB_CLASS(DebModTest, "SoftRoiCallback");
public: public:
#ifdef WITH_SPS_IMAGE
SoftRoiCallback(Frelon::Interface& hw_inter, CtSpsImage& m_sps_image, SoftRoiCallback(Frelon::Interface& hw_inter, CtSpsImage& m_sps_image,
HwBufferSave& buffer_save, AcqState& acq_state); HwBufferSave& buffer_save, AcqState& acq_state);
#else
SoftRoiCallback(Frelon::Interface& hw_inter,HwBufferSave& buffer_save,
AcqState& acq_state);
#endif
~SoftRoiCallback(); ~SoftRoiCallback();
virtual void finished(Data& data); virtual void finished(Data& data);
...@@ -36,11 +43,13 @@ private: ...@@ -36,11 +43,13 @@ private:
FrameDim& fdim); FrameDim& fdim);
Frelon::Interface& m_hw_inter; Frelon::Interface& m_hw_inter;
#ifdef WITH_SPS_IMAGE
CtSpsImage& m_sps_image; CtSpsImage& m_sps_image;
#endif
HwBufferSave& m_buffer_save; HwBufferSave& m_buffer_save;
AcqState& m_acq_state; AcqState& m_acq_state;
}; };
#ifdef WITH_SPS_IMAGE
SoftRoiCallback::SoftRoiCallback(Frelon::Interface& hw_inter, SoftRoiCallback::SoftRoiCallback(Frelon::Interface& hw_inter,
CtSpsImage& sps_image, CtSpsImage& sps_image,
HwBufferSave& buffer_save, HwBufferSave& buffer_save,
...@@ -50,7 +59,16 @@ SoftRoiCallback::SoftRoiCallback(Frelon::Interface& hw_inter, ...@@ -50,7 +59,16 @@ SoftRoiCallback::SoftRoiCallback(Frelon::Interface& hw_inter,
{ {
DEB_CONSTRUCTOR(); DEB_CONSTRUCTOR();
} }
#else
SoftRoiCallback::SoftRoiCallback(Frelon::Interface& hw_inter,
HwBufferSave& buffer_save,
AcqState& acq_state)
: m_hw_inter(hw_inter),
m_buffer_save(buffer_save), m_acq_state(acq_state)
{
DEB_CONSTRUCTOR();
}
#endif
SoftRoiCallback::~SoftRoiCallback() SoftRoiCallback::~SoftRoiCallback()
{ {
DEB_DESTRUCTOR(); DEB_DESTRUCTOR();
...@@ -93,9 +111,9 @@ void SoftRoiCallback::data2FrameInfo(Data& data, HwFrameInfoType& finfo, ...@@ -93,9 +111,9 @@ void SoftRoiCallback::data2FrameInfo(Data& data, HwFrameInfoType& finfo,
void SoftRoiCallback::finished(Data& data) void SoftRoiCallback::finished(Data& data)
{ {
DEB_MEMBER_FUNCT(); DEB_MEMBER_FUNCT();
#ifdef WITH_SPS_IMAGE
m_sps_image.frameReady(data); m_sps_image.frameReady(data);
#endif
HwFrameInfoType finfo; HwFrameInfoType finfo;
FrameDim fdim; FrameDim fdim;
data2FrameInfo(data, finfo, fdim); data2FrameInfo(data, finfo, fdim);
...@@ -120,9 +138,15 @@ class TestFrameCallback : public HwFrameCallback ...@@ -120,9 +138,15 @@ class TestFrameCallback : public HwFrameCallback
DEB_CLASS(DebModTest, "TestFrameCallback"); DEB_CLASS(DebModTest, "TestFrameCallback");
public: public:
#ifdef WITH_SPS_IMAGE
TestFrameCallback(Frelon::Interface& hw_inter, Roi& soft_roi, TestFrameCallback(Frelon::Interface& hw_inter, Roi& soft_roi,
CtSpsImage& sps_image, HwBufferSave& buffer_save, CtSpsImage& sps_image, HwBufferSave& buffer_save,
AcqState& acq_state); AcqState& acq_state);
#else
TestFrameCallback(Frelon::Interface& hw_inter, Roi& soft_roi,
HwBufferSave& buffer_save,
AcqState& acq_state);
#endif
~TestFrameCallback(); ~TestFrameCallback();
protected: protected:
...@@ -138,13 +162,20 @@ private: ...@@ -138,13 +162,20 @@ private:
}; };
TestFrameCallback::TestFrameCallback(Frelon::Interface& hw_inter, TestFrameCallback::TestFrameCallback(Frelon::Interface& hw_inter,
Roi& soft_roi, CtSpsImage& sps_image, Roi& soft_roi,
#ifdef WITH_SPS_IMAGE
CtSpsImage& sps_image,
#endif
HwBufferSave& buffer_save, HwBufferSave& buffer_save,
AcqState& acq_state) AcqState& acq_state)
: m_hw_inter(hw_inter), m_soft_roi(soft_roi) : m_hw_inter(hw_inter), m_soft_roi(soft_roi)
{ {
DEB_CONSTRUCTOR(); DEB_CONSTRUCTOR();
m_roi_cb = new SoftRoiCallback(hw_inter, sps_image, buffer_save, m_roi_cb = new SoftRoiCallback(hw_inter,
#ifdef WITH_SPS_IMAGE
sps_image,
#endif
buffer_save,
acq_state); acq_state);
m_roi_task = new SoftRoi(); m_roi_task = new SoftRoi();
} }
...@@ -298,7 +329,12 @@ void set_hw_roi(HwRoiCtrlObj *hw_roi, const Roi& set_roi, Roi& real_roi, ...@@ -298,7 +329,12 @@ void set_hw_roi(HwRoiCtrlObj *hw_roi, const Roi& set_roi, Roi& real_roi,
//********************************************************************* //*********************************************************************
void check_sps_image_frame_dim(HwInterface& hw_inter, void check_sps_image_frame_dim(HwInterface& hw_inter,
Bin& bin, Roi& set_roi, CtSpsImage& sps_image) Bin& bin, Roi& set_roi
#ifdef WITH_SPS_IMAGE
,CtSpsImage& sps_image)
#else
)
#endif
{ {
DEB_GLOBAL_FUNCT(); DEB_GLOBAL_FUNCT();
...@@ -318,8 +354,9 @@ void check_sps_image_frame_dim(HwInterface& hw_inter, ...@@ -318,8 +354,9 @@ void check_sps_image_frame_dim(HwInterface& hw_inter,
hw_buffer->getFrameDim(frame_dim); hw_buffer->getFrameDim(frame_dim);
frame_dim.setSize(size); frame_dim.setSize(size);
DEB_TRACE() << DEB_VAR1(frame_dim); DEB_TRACE() << DEB_VAR1(frame_dim);
#ifdef WITH_SPS_IMAGE
sps_image.prepare(frame_dim); sps_image.prepare(frame_dim);
#endif
} }
...@@ -374,14 +411,19 @@ void test_frelon_hw_inter(bool do_reset) ...@@ -374,14 +411,19 @@ void test_frelon_hw_inter(bool do_reset)
HwBufferSave buffer_save(HwBufferSave::EDF, "img", 0, ".edf", true, 1); HwBufferSave buffer_save(HwBufferSave::EDF, "img", 0, ".edf", true, 1);
#ifdef WITH_SPS_IMAGE
CtSpsImage sps_image; CtSpsImage sps_image;
sps_image.setNames("_ccd_ds_", "frelon_live"); sps_image.setNames("_ccd_ds_", "frelon_live");
#endif
MaxImageSizeCallback mis_cb; MaxImageSizeCallback mis_cb;
Roi soft_roi; Roi soft_roi;
AcqState acq_state; AcqState acq_state;
TestFrameCallback cb(hw_inter, soft_roi, sps_image, buffer_save, TestFrameCallback cb(hw_inter, soft_roi,
#ifdef WITH_SPS_IMAGE
sps_image,
#endif
buffer_save,
acq_state); acq_state);
HwDetInfoCtrlObj *hw_det_info; HwDetInfoCtrlObj *hw_det_info;
...@@ -427,7 +469,12 @@ void test_frelon_hw_inter(bool do_reset) ...@@ -427,7 +469,12 @@ void test_frelon_hw_inter(bool do_reset)
hw_buffer->setFrameDim(effect_frame_dim); hw_buffer->setFrameDim(effect_frame_dim);
hw_buffer->setNbBuffers(10); hw_buffer->setNbBuffers(10);
hw_buffer->registerFrameCallback(cb); hw_buffer->registerFrameCallback(cb);
check_sps_image_frame_dim(hw_inter, bin, set_roi, sps_image); check_sps_image_frame_dim(hw_inter, bin, set_roi
#ifdef WITH_SPS_IMAGE
, sps_image);
#else
);
#endif
print_status(hw_inter); print_status(hw_inter);
acq_state.set(AcqState::Acquiring); acq_state.set(AcqState::Acquiring);
...@@ -479,7 +526,12 @@ void test_frelon_hw_inter(bool do_reset) ...@@ -479,7 +526,12 @@ void test_frelon_hw_inter(bool do_reset)
effect_frame_dim = frame_dim / bin; effect_frame_dim = frame_dim / bin;
hw_buffer->setFrameDim(effect_frame_dim); hw_buffer->setFrameDim(effect_frame_dim);
hw_buffer->setNbBuffers(10); hw_buffer->setNbBuffers(10);
check_sps_image_frame_dim(hw_inter, bin, set_roi, sps_image); check_sps_image_frame_dim(hw_inter, bin, set_roi
#ifdef WITH_SPS_IMAGE
, sps_image);
#else
);
#endif
print_status(hw_inter); print_status(hw_inter);
acq_state.set(AcqState::Acquiring); acq_state.set(AcqState::Acquiring);
...@@ -495,7 +547,13 @@ void test_frelon_hw_inter(bool do_reset) ...@@ -495,7 +547,13 @@ void test_frelon_hw_inter(bool do_reset)
effect_frame_dim.setSize(real_roi.getSize()); effect_frame_dim.setSize(real_roi.getSize());
hw_buffer->setFrameDim(effect_frame_dim); hw_buffer->setFrameDim(effect_frame_dim);
hw_buffer->setNbBuffers(10); hw_buffer->setNbBuffers(10);
check_sps_image_frame_dim(hw_inter, bin, set_roi, sps_image); check_sps_image_frame_dim(hw_inter, bin, set_roi
#ifdef WITH_SPS_IMAGE
, sps_image);
#else
);
#endif
print_status(hw_inter); print_status(hw_inter);
acq_state.set(AcqState::Acquiring); acq_state.set(AcqState::Acquiring);
...@@ -514,7 +572,12 @@ void test_frelon_hw_inter(bool do_reset) ...@@ -514,7 +572,12 @@ void test_frelon_hw_inter(bool do_reset)
effect_frame_dim.setSize(real_roi.getSize()); effect_frame_dim.setSize(real_roi.getSize());
hw_buffer->setFrameDim(effect_frame_dim); hw_buffer->setFrameDim(effect_frame_dim);
hw_buffer->setNbBuffers(10); hw_buffer->setNbBuffers(10);
check_sps_image_frame_dim(hw_inter, bin, set_roi, sps_image); check_sps_image_frame_dim(hw_inter, bin, set_roi
#ifdef WITH_SPS_IMAGE
, sps_image);
#else
);
#endif
print_status(hw_inter); print_status(hw_inter);
acq_state.set(AcqState::Acquiring); acq_state.set(AcqState::Acquiring);
......
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