14 #ifndef SAFTDABC_Device
15 #define SAFTDABC_Device
17 #include "dabc/Device.h"
33 #ifndef DABC_SAFT_USE_2_0
39 #include <saftlib/SAFTd.h>
40 #include <saftlib/TimingReceiver.h>
41 #include <saftlib/SoftwareActionSink.h>
42 #include <saftlib/SoftwareCondition.h>
44 #include <saftlib/Input.h>
84 return "saftdabc::Device";
104 #ifdef DABC_SAFT_USE_2_0
112 #ifdef DABC_SAFT_USE_2_0
122 void SetInfo(
const std::string &info,
bool forceinfo=
true);
151 #ifdef DABC_SAFT_USE_2_0
156 std::vector<std::shared_ptr<saftlib::SoftwareCondition_Proxy> >
fConditionProxies;
159 std::vector<std::shared_ptr<saftlib::SoftwareActionSink_Proxy> >
fActionSinks;
176 std::vector<Glib::RefPtr<saftlib::SoftwareActionSink_Proxy> >
fActionSinks;
216 #ifdef DABC_SAFT_USE_2_0
225 #ifdef DABC_SAFT_USE_2_0
240 void SetInfo(
const std::string &info,
bool forceinfo=
true)
253 #ifdef DABC_SAFT_USE_2_0
#define DABC_REFERENCE(RefClass, ParentClass, T)
Represents command with its arguments.
Reference on dabc::Device class
Base class for device implementation.
Reference on the arbitrary object
Object * GetObject() const
Return pointer on the object.
Base class for transport implementations.
const std::string GetInputDescription(guint64 event)
bool ClearConditions() const
cleanup conditions
bool RegisterEventCondition(saftdabc::Input *receiver, guint64 id, guint64 mask, gint64 offset, unsigned char acceptflags)
void AddEventStatistics(unsigned numevents)
bool RegisterInputCondition(saftdabc::Input *receiver, std::string &ioname)
void SetInfo(const std::string &info, bool forceinfo=true)
std::string fBoardName
name of the saftd attached board name, e.g.
void RunGlibMainLoop()
this function keeps glib main loop alive.
dabc::Mutex fConditionMutex
Mutex to protect list of condition proxies.
virtual bool DestroyByOwnThread()
here we may insert some actions to the device cleanup methods
virtual const char * ClassName() const
Returns class name of the object instance.
const std::string GetInputDescription(guint64 event)
Return text description of input belonging to given event id, e.g.
void SetDevInfoParName(const std::string &name)
virtual void ObjectCleanup()
Central cleanup method for worker.
std::string fDevInfoName
Name of info parameter for device messages.
Device(const std::string &name, dabc::Command cmd)
Glib::RefPtr< saftlib::TimingReceiver_Proxy > fTimingReceiver
handle for the timing receiver instance
bool ClearConditions()
clean up all existing saftlib conditions
std::map< Glib::ustring, guint64 > fMap_PrefixName
Translation table IO name <> prefix like in saft-io-ctl implementation.
void OnThreadAssigned()
need to start timeout here
void SetInfo(const std::string &info, bool forceinfo=true)
set info parameter.
bool RegisterEventCondition(saftdabc::Input *receiver, guint64 id, guint64 mask, gint64 offset, unsigned char acceptflags)
Register input event per id to snoop on NewCondition(bool active, guint64 id, guint64 mask,...
virtual dabc::Transport * CreateTransport(dabc::Command cmd, const dabc::Reference &port)
virtual int ExecuteCommand(dabc::Command cmd)
Main method where commands are executed.
std::vector< Glib::RefPtr< saftlib::SoftwareActionSink_Proxy > > fActionSinks
Helper vector to connect action sinks.
Glib::RefPtr< Glib::MainLoop > fGlibMainloop
the glib main loop
std::vector< Glib::RefPtr< saftlib::SoftwareCondition_Proxy > > fConditionProxies
Helper vector to connect conditions.
void AddEventStatistics(unsigned numevents)
add numevents to the event ratemeter.
bool RegisterInputCondition(saftdabc::Input *receiver, std::string &ioname)
Register input of name to snoop on NewCondition(bool active, guint64 id, guint64 mask,...
GSI Simplified API for Timing Library (saftlib) plug-in for dabc.
std::string tr_formatActionParam(guint64 param, guint32 evtNo, guint32 pmode)
const guint32 PMODE_VERBOSE
std::string tr_formatDate(guint64 time, guint32 pmode)
std::string tr_formatActionEvent(guint64 id, guint32 pmode)
std::string tr_formatActionFlags(guint16 flags, guint64 delay, guint32 pmode)