Disable some part of the code for windows (HardwareSaving) which is not available yet (SEB)

parent c935fcb6
......@@ -414,6 +414,7 @@ CtSaving::CtSaving(CtControl &aCtrl) :
resetLastFrameNb();
HwInterface *hw = aCtrl.hwInterface();
#ifdef __linux__
m_has_hwsaving = hw->getHwCtrlObj(m_hwsaving);
if(m_has_hwsaving)
{
......@@ -422,6 +423,10 @@ CtSaving::CtSaving(CtControl &aCtrl) :
}
else
m_new_frame_save_cbk = NULL;
#else
m_has_hwsaving = false;
m_new_frame_save_cbk = NULL;
#endif
}
//@brief destructor
......
......@@ -29,7 +29,6 @@
#include "HwFrameInfo.h"
#include "DirectoryEventUtils.h"
#ifdef __linux__
namespace lima
{
class LIMACORE_API HwSavingCtrlObj
......@@ -78,8 +77,10 @@ namespace lima
{
public:
virtual ~Callback() {}
#ifdef __linux__
virtual void prepare(const DirectoryEvent::Parameters &) {};
virtual bool newFrameWritten(int frame_id) = 0;
#endif
};
void registerCallback(Callback *cbk);
......@@ -107,9 +108,10 @@ namespace lima
class DirectoryCallback;
Callback* m_callback;
#ifdef __linux__
DirectoryCallback* m_dir_cbk;
DirectoryEvent m_dir_event;
#endif
};
}
#endif
#endif
......@@ -62,8 +62,10 @@ public:
{
public:
virtual ~Callback();
%If (POSIX_PLATFORM)
virtual void prepare(const DirectoryEvent::Parameters &);
virtual bool newFrameWritten(int frame_id) = 0;
%End
};
void registerCallback(Callback *cbk);
......
......@@ -28,7 +28,7 @@ using namespace lima;
const char* HwSavingCtrlObj::RAW_FORMAT_STR = "RAW"; ///< Raw format (no header)
const char* HwSavingCtrlObj::EDF_FORMAT_STR = "EDF"; ///< EDF format (Esrf Data Format)
const char* HwSavingCtrlObj::CBF_FORMAT_STR = "CBF"; ///< CBF format
#ifdef __linux__
class HwSavingCtrlObj::DirectoryCallback : public DirectoryEvent::Callback
{
public:
......@@ -80,19 +80,24 @@ private:
int m_start_file_number;
std::deque<int> m_image_ids;
};
#endif
HwSavingCtrlObj::HwSavingCtrlObj(int capabilities) :
m_caps(capabilities),
m_active(false),
m_callback(NULL),
m_dir_cbk(new HwSavingCtrlObj::DirectoryCallback(*this)),
m_callback(NULL)
#ifdef __linux__
,m_dir_cbk(new HwSavingCtrlObj::DirectoryCallback(*this)),
m_dir_event(true,*m_dir_cbk)
#endif
{
}
HwSavingCtrlObj::~HwSavingCtrlObj()
{
#ifdef __linux__
delete m_dir_cbk;
#endif
}
void HwSavingCtrlObj::setActive(bool flag)
......@@ -170,7 +175,7 @@ void HwSavingCtrlObj::prepare()
if(m_active)
{
_prepare();
#ifdef __linux__
DirectoryEvent::Parameters params;
params.watch_path = m_directory;
params.file_pattern = m_prefix;
......@@ -181,6 +186,7 @@ void HwSavingCtrlObj::prepare()
if(m_callback)
m_callback->prepare(params);
#endif
}
}
......@@ -191,13 +197,16 @@ void HwSavingCtrlObj::start()
if(m_active)
{
_start();
#ifdef __linux__
m_dir_event.start();
#endif
}
}
void HwSavingCtrlObj::stop()
{
#ifdef __linux__
m_dir_event.stop();
#endif
}
int HwSavingCtrlObj::getCapabilities() const
......
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