Commit d73d1fcb authored by Roberto Arturo Homs-Regojo's avatar Roberto Arturo Homs-Regojo
Browse files

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