Manage error message coming from processing

parent 1edfe550
......@@ -81,4 +81,4 @@
url = git://github.com/esrf-bliss/Lima-camera-rayonixhs
[submodule "camera/andor3"]
path = camera/andor3
url = git://github.com:esrf-bliss/Lima-camera-andor3.git
url = git://github.com/esrf-bliss/Lima-camera-andor3.git
Subproject commit 7254a9edc9cc53cc6817e303c4ee7aa193395fb9
Subproject commit 88d5ca852c80b9179040fc0808f1fdd86ce1294c
......@@ -57,7 +57,7 @@ class LIMACORE_API Event
Timestamp rel_timestamp;
Event();
Event(Layer l, Severity s, Domain d, Code c, std::string e);
Event(Layer l, Severity s, Domain d, Code c,const std::string &e);
virtual ~Event();
virtual std::string getMsgStr();
......
......@@ -51,7 +51,7 @@ using namespace lima;
Timestamp rel_timestamp;
Event();
Event(Layer l, Severity s, Domain d, Code c, std::string e);
Event(Layer l, Severity s, Domain d, Code c, const std::string &e);
virtual ~Event();
virtual std::string getMsgStr();
......
......@@ -34,7 +34,7 @@ Event::Event()
abs_timestamp = Timestamp::now();
}
Event::Event(Layer l, Severity s, Domain d, Code c, string e)
Event::Event(Layer l, Severity s, Domain d, Code c, const string &e)
: layer(l), severity(s), domain(d), code(c), desc(e)
{
abs_timestamp = Timestamp::now();
......
......@@ -205,6 +205,8 @@ namespace lima
return d1.frameNumber < d2.frameNumber;
}
};
class SoftOpErrorHandler;
class _LastBaseImageReadyCallback;
friend class _LastBaseImageReadyCallback;
class _LastImageReadyCallback;
......@@ -254,6 +256,7 @@ namespace lima
bool m_display_active_flag;
#endif
ImageStatusCallback *m_img_status_cb;
SoftOpErrorHandler* m_soft_op_error_handler;
inline bool _checkOverrun(Data&);
inline void _calcAcqStatus();
......
......@@ -112,7 +112,21 @@ private:
CtControl &_ctrl;
};
class CtControl::SoftOpErrorHandler : public TaskMgr::EventCallback
{
public:
SoftOpErrorHandler(CtControl &ctr) : m_ct(ctr) {}
virtual void error(Data&,const char *errmsg)
{
Event *anEvent = new Event(Control,Event::Error,Event::Processing,
Event::Default,errmsg);
CtEvent *eventMgr = m_ct.event();
eventMgr->reportEvent(anEvent);
}
private:
CtControl& m_ct;
};
CtControl::CtControl(HwInterface *hw) :
m_hw(hw),
......@@ -148,6 +162,8 @@ CtControl::CtControl(HwInterface *hw) :
#endif
m_op_int = new SoftOpInternalMgr();
m_op_ext = new SoftOpExternalMgr();
m_soft_op_error_handler = new SoftOpErrorHandler(*this);
}
CtControl::~CtControl()
......@@ -174,6 +190,8 @@ CtControl::~CtControl()
delete m_op_int;
delete m_op_ext;
delete m_soft_op_error_handler;
}
void CtControl::setApplyPolicy(ApplyPolicy policy)
......@@ -568,6 +586,7 @@ bool CtControl::newFrameReady(Data& fdata)
aLock.unlock();
TaskMgr *mgr = new TaskMgr();
mgr->setEventCallback(m_soft_op_error_handler);
mgr->setInputData(fdata);
int internal_stage = 0;
......
Subproject commit a5733137c6c38180db09e043419f62dd109ef2ec
Subproject commit 124cff5e1c2accc86071fe217e379b77fcb8af82
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