19 #include <coil/stringutil.h> 21 #include "ComponentObserverSkel.h" 36 m_compstat(*this), m_portaction(*this),
37 m_ecaction(*this), m_configMsg(*this),
38 m_interval(0, 100000), m_heartbeat(false),
42 for (
size_t i(0); i < OpenRTM::STATUS_KIND_NUM; ++i)
74 const SDOPackage::ServiceProfile& profile)
126 const SDOPackage::ServiceProfile&
161 if (prop[
"observed_status"].empty())
163 prop[
"observed_status"] =
"ALL";
167 bool flags[OpenRTM::STATUS_KIND_NUM];
168 for (
int i(0); i < OpenRTM::STATUS_KIND_NUM; ++i)
172 for (
size_t i(0); i < observed.size(); ++i)
175 if (observed[i] ==
"COMPONENT_PROFILE")
177 flags[OpenRTM::COMPONENT_PROFILE] = 1;
179 else if (observed[i] ==
"RTC_STATUS")
181 flags[OpenRTM::RTC_STATUS] = 1;
183 else if (observed[i] ==
"EC_STATUS")
185 flags[OpenRTM::EC_STATUS] = 1;
187 else if (observed[i] ==
"PORT_PROFILE")
189 flags[OpenRTM::PORT_PROFILE] = 1;
191 else if (observed[i] ==
"CONFIGURATION")
193 flags[OpenRTM::CONFIGURATION] = 1;
195 else if (observed[i] ==
"ALL")
197 for (
int j(0);
j < OpenRTM::STATUS_KIND_NUM; ++
j)
245 else if (pre && !next)
247 (this->*unsetfunc)();
276 if (
coil::toBool(prop[
"heartbeat.enable"],
"YES",
"NO",
false))
278 std::string interval(prop[
"heartbeat.interval"]);
279 if (interval.empty())
687 factory.
addFactory(CORBA_Util::toRepositoryId<OpenRTM::ComponentObserver>(),
PostComponentActionListener * deactivatedListener
virtual void releaseObject()
Clear CORBA object setting.
PortConnectRetListener * portConnectListener
PostComponentActionListener * ecShutdown
void toUpper(std::string &str)
Uppercase String Transformation.
void switchListeners(bool &next, bool &pre, void(ComponentObserverConsumer::*setfunc)(), void(ComponentObserverConsumer::*unsetfunc)())
Switching listeners connecting/disconnecting.
ConfigurationSetNameListener * removeConfigSetListener
void onDisconnect(const char *portname,::RTC::ConnectorProfile &pprof, ReturnCode_t ret)
bool stringTo(To &val, const char *str)
Convert the given std::string to object.
ConfigurationSetListener * addConfigSetListener
void unsetComponentProfileListeners()
Unsetting ComponentProfile listener.
AbstractClass * Creator()
Creator template.
void unsetHeartbeat()
Unsetting heartbeat.
void addPortConnectRetListener(PortConnectRetListenerType listener_type, PortConnectRetListener *listener, bool autoclean=true)
Adding PortConnectRet type listener.
void removeConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener)
Removing ConfigurationSetListener.
PostComponentActionListener * abortingListener
void addConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener, bool autoclean=true)
Adding ConfigurationSetListener.
RTC::RTObject_impl * m_rtobj
ExecutionContextActionListener * ecAttached
PortConnectRetListener * portDisconnectListener
PostComponentActionListener * resetListener
void removePortConnectRetListener(PortConnectRetListenerType listener_type, PortConnectRetListener *listener)
Removing PortConnectRet type listener.
PortActionListener * portRemoveListener
PostComponentActionListener * ecRatechanged
ReturnCode addFactory(const Identifier &id, Creator creator, Destructor destructor)
Add factory.
void removeConfigSet(const char *config_set_name)
virtual bool init(RTObject_impl &rtobj, const SDOPackage::ServiceProfile &profile)
Initialization.
vstring split(const std::string &input, const std::string &delimiter, bool ignore_empty)
Split string by delimiter.
void onRateChanged(UniqueId ec_id, ReturnCode_t ret)
void onReset(UniqueId ec_id, ReturnCode_t ret)
void addExecutionContextActionListener(ECActionListenerType listener_type, ECActionListener *listener, bool autoclean=true)
Adding ExecutionContextAction type listener.
void updateConfigParam(const char *configsetname, const char *configparamname)
SDOPackage::ServiceProfile m_profile
void unsetExecutionContextListeners()
Unsetting EC status listener.
void heartbeat()
Sending a heartbeart signal to observer.
ConfigurationSetNameListener * activateConfigSetListener
coil::TimeValue m_interval
static GlobalFactory< AbstractClass, Identifier, Compare, Creator, Destructor > & instance()
Create instance.
void ComponentObserverConsumerInit()
GlobalFactory template class.
virtual const SDOPackage::ServiceProfile & getProfile() const
getting ServiceProfile
void addConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener, bool autoclean=true)
Adding ConfigurationSetNameListener.
void onRemovePort(const ::RTC::PortProfile &pprof)
ConfigurationParamListener * updateConfigParamListener
ConfigurationSetListener * setConfigSetListener
void setComponentProfileListeners()
Setting ComponentProfile listener.
void onAddPort(const ::RTC::PortProfile &pprof)
virtual bool reinit(const SDOPackage::ServiceProfile &profile)
Re-initialization.
Component observer SDO service consumer implementation.
std::vector< std::string > vstring
void onDeactivated(UniqueId ec_id, ReturnCode_t ret)
void setPortProfileListeners()
Setting port profile listener.
void addConfigSet(const coil::Properties &config_set)
void stop()
Stop Timer task.
virtual bool setObject(CORBA::Object_ptr obj)
Set Object.
void setListeners(coil::Properties &prop)
Connectiong listeners to RTObject.
PortActionListener * portAddListener
void onFinalize(UniqueId ec_id, ReturnCode_t ret)
void onShutdown(UniqueId ec_id, ReturnCode_t ret)
void copyToProperties(coil::Properties &prop, const SDOPackage::NVList &nv)
Copy NVList to the Proeprties.
CorbaConsumer< OpenRTM::ComponentObserver > m_observer
def j(str, encoding="cp932")
void setConfigurationListeners()
Setting Configuration listener.
void removePortActionListener(PortActionListenerType listener_type, PortActionListener *listener)
Removing PortAction type listener.
ListenerId m_hblistenerid
void addConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener *listener, bool autoclean=true)
Adding ConfigurationParamListener.
ObjectTypePtr _ptr()
Get Object reference narrowed as ObjectType.
void removePostComponentActionListener(PostComponentActionListenerType listener_type, PostComponentActionListener *listener)
Removing PostComponentAction type listener.
PostComponentActionListener * finalizeListener
void removeConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener)
Removing ConfigurationSetNameListener.
prop
Organization::get_organization_property ();.
void unsetComponentStatusListeners()
Unsetting RTC status listeners.
void removeExecutionContextActionListener(ECActionListenerType listener_type, ECActionListener *listener)
Removing ExecutionContextAction type listener.
void Destructor(AbstractClass *&obj)
Destructor template.
void onConnect(const char *portname,::RTC::ConnectorProfile &pprof, ReturnCode_t ret)
ConfigurationSetNameListener * updateConfigSetListener
Class represents a set of properties.
void onDetached(UniqueId ec_id)
bool toBool(std::string str, std::string yes, std::string no, bool default_value)
Convert given string into bool value.
void start()
Start Timer task.
void onStartup(UniqueId ec_id, ReturnCode_t ret)
void setExecutionContextListeners()
Setting EC status listener.
void setComponentStatusListeners()
Setting RTC status listeners.
void activateConfigSet(const char *config_set_name)
void unsetPortProfileListeners()
Unsetting port profile listener.
virtual ~ComponentObserverConsumer()
dtor
void onAttached(UniqueId ec_id)
ExecutionContextActionListener * ecDetached
virtual void finalize()
Finalization.
void updateStatus(OpenRTM::StatusKind statuskind, const char *msg)
Calling remote object.
bool m_observed[OpenRTM::STATUS_KIND_NUM]
bool unregisterListener(ListenerId id)
Unregister listener.
void addPostComponentActionListener(PostComponentActionListenerType listener_type, PostComponentActionListener *listener, bool autoclean=true)
Adding PostComponentAction type listener.
PostComponentActionListener * activatedListener
void unsetConfigurationListeners()
Unsetting Configurationlistener.
void setConfigSet(const coil::Properties &config_set)
void onActivated(UniqueId ec_id, ReturnCode_t ret)
void onAborting(UniqueId ec_id, ReturnCode_t ret)
void setHeartbeat(coil::Properties &prop)
Setting heartbeat.
ComponentObserverConsumer()
ctor of ComponentObserverConsumer
PostComponentActionListener * ecStartup
void updateConfigSet(const char *config_set_name)
void addPortActionListener(PortActionListenerType listener_type, PortActionListener *listener, bool autoclean=true)
Adding PortAction type listener.