TwiceAsNice  2019-02-18
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Basda::MoccaLCServiceWorker Class Reference

This class is the implementation of the LC interface. More...

#include <BasdaMoccaLCServiceWorker.h>

Inheritance diagram for Basda::MoccaLCServiceWorker:
Inheritance graph
Collaboration diagram for Basda::MoccaLCServiceWorker:
Collaboration graph

Classes

struct  DeviceAsyncImpl
 This is the implementation of the call back object to update the completion status. More...
 
struct  DeviceCmdAsyncImpl
 This struct is the implementation of the asynchronous command status method. More...
 

Public Member Functions

 MoccaLCServiceWorker (const Nice::JointPtr &_config, const MoccaLCDevicePtr &_device)
 Constructor. More...
 
virtual ~MoccaLCServiceWorker ()
 Destructor. More...
 
virtual void init ()
 This method initiate and open the device. More...
 
virtual void deinit ()
 This method deinit and close the device. More...
 
virtual void activate ()
 This method activate the device. More...
 
virtual void deactivate ()
 This method deactivate the device. More...
 
virtual void terminate ()
 This method shut down the device. More...
 
virtual void errorOffline ()
 set the target state to OFFLINE. More...
 
virtual void errorStandby ()
 set the target state to OFFLINE. More...
 
virtual void errorOnline ()
 set the target state to OFFLINE. More...
 
virtual void errorWorking ()
 set the target state to OFFLINE. More...
 
virtual void idleOffline ()
 wait for a state change. More...
 
virtual void idleOnline ()
 wait for a state change. More...
 
virtual Nice::SeqTime getLinkTimeout ()
 
virtual bool isReachable ()
 
virtual void stop ()
 does nothing. More...
 
virtual void abort ()
 does nothing. More...
 
Nice::NPoint getNamedIntensity (int _namedIntensity)
 
void setNamedIntensity (int _namedIntensity)
 
virtual void setIntensity (std::string lightSource, int _intensity)
 
virtual void switchOn (int _intensity)
 
virtual void switchOff ()
 
virtual void getIntensity ()
 
 MoccaLCServiceWorker (const Nice::JointPtr &_config, const MoccaLCDevicePtr &_device)
 Constructor. More...
 
virtual ~MoccaLCServiceWorker ()
 Destructor. More...
 
virtual void init ()
 This method initiate and open the device. More...
 
virtual void deinit ()
 This method deinit and close the device. More...
 
virtual void activate ()
 This method activate the device. More...
 
virtual void deactivate ()
 This method deactivate the device. More...
 
virtual void terminate ()
 This method shut down the device. More...
 
virtual void errorOffline ()
 set the target state to OFFLINE. More...
 
virtual void errorStandby ()
 set the target state to OFFLINE. More...
 
virtual void errorOnline ()
 set the target state to OFFLINE. More...
 
virtual void errorWorking ()
 set the target state to OFFLINE. More...
 
virtual void idleOffline ()
 wait for a state change. More...
 
virtual void idleOnline ()
 wait for a state change. More...
 
virtual Nice::SeqTime getLinkTimeout ()
 
virtual bool isReachable ()
 
virtual void stop ()
 does nothing. More...
 
virtual void abort ()
 does nothing. More...
 
Nice::NPoint getNamedIntensity (int _namedIntensity)
 
void setNamedIntensity (int _namedIntensity)
 
virtual void setIntensity (std::string lightSource, int _intensity)
 
virtual void switchOn (int _intensity)
 
virtual void switchOff ()
 
virtual void getIntensity ()
 
- Public Member Functions inherited from Basda::MoccaLCServiceWorkerSkeleton
 MoccaLCServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
virtual ~MoccaLCServiceWorkerSkeleton ()
 
 MoccaLCServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
virtual ~MoccaLCServiceWorkerSkeleton ()
 
- Public Member Functions inherited from Basda::ServiceWorkerSkeleton
const Nice::PropertyPtrcmd ()
 
void setCompletion (const Nice::Completion &_c)
 
void cmdStart (const std::string &_action="")
 
void cmdDone ()
 
void cmdWarning (const std::string &_l)
 
void cmdWarning (const Nice::LoggerObject &_o)
 
void cmdError (const std::string &_l)
 
void cmdError (const Nice::LoggerObject &_o)
 
void cmdError (const Nice::SeqLoggerObject &_oo)
 
void cmdPercent (Nice::Int _v)
 
void cmdAction (Nice::Int _v, const std::string &_s)
 
virtual void cmd (const Nice::Completion &_c)
 
template<typename DataType >
Nice::Completion exec (const Nice::Completion &_c, DataType &_localdata, const DataType &_indata=DataType())
 if currently online, push the state into WORKING More...
 
template<typename DataType >
void execCommand (DataType _cmd)
 
const Nice::PropertyPtrcmd ()
 
void setCompletion (const Nice::Completion &_c)
 
void cmdStart (const std::string &_action="")
 
void cmdDone ()
 
void cmdWarning (const std::string &_l)
 
void cmdWarning (const Nice::LoggerObject &_o)
 
void cmdError (const std::string &_l)
 
void cmdError (const Nice::LoggerObject &_o)
 
void cmdError (const Nice::SeqLoggerObject &_oo)
 
void cmdPercent (Nice::Int _v)
 
void cmdAction (Nice::Int _v, const std::string &_s)
 
virtual void cmd (const Nice::Completion &_c)
 
template<typename DataType >
Nice::Completion exec (const Nice::Completion &_c, DataType &_localdata, const DataType &_indata=DataType())
 
template<typename DataType >
void execCommand (DataType _cmd)
 
- Public Member Functions inherited from Basda::ServiceWorker
const Nice::JointPtrconfig ()
 
Nice::JointPtr cfg ()
 
Nice::JointPtr var ()
 
virtual const std::string & name ()
 
virtual WorkerThreadPtr worker ()
 
virtual Nice::Monitormonitor ()
 
virtual void lock ()
 
virtual void unlock ()
 
bool stateIsSettled ()
 
bool stateHasChanged ()
 
void changeState (Basda::ServiceState _state)
 change state to a new state If the state is the current state, or a negative state, do nothing. Otherwise change the "next" state in the state machine and notify all threads. More...
 
bool tryChangeState (Basda::ServiceState _state, const Nice::Time &_timeout=Nice::Time::seconds(0.0))
 change state to a new state More...
 
void waitForState (Basda::ServiceState _state)
 wait (indefinitely) until the worker has reached a spcifici state More...
 
bool timedWaitForState (Basda::ServiceState _state, const Nice::Time &_timeout)
 wait (indefinitely) until the worker has reached a specific state More...
 
bool changeStateOnlyFromTo (Basda::ServiceState _from, Basda::ServiceState _to)
 wait (indefinitely) until the worker has reached a spcifici state More...
 
Basda::ServiceState state ()
 
Basda::ServiceState stateNow ()
 
Basda::ServiceState stateNext ()
 
Basda::ServiceState stateLast ()
 
bool isTransit ()
 
bool isTerminated ()
 
const Nice::JointPtrconfig ()
 
Nice::JointPtr cfg ()
 
Nice::JointPtr var ()
 
virtual const std::string & name ()
 
virtual WorkerThreadPtr worker ()
 
virtual Nice::Monitormonitor ()
 
virtual void lock ()
 
virtual void unlock ()
 
bool stateIsSettled ()
 
bool stateHasChanged ()
 
void changeState (Basda::ServiceState _state)
 
bool tryChangeState (Basda::ServiceState _state, const Nice::Time &_timeout=Nice::Time::seconds(0.0))
 
void waitForState (Basda::ServiceState _state)
 
bool timedWaitForState (Basda::ServiceState _state, const Nice::Time &_timeout)
 
bool changeStateOnlyFromTo (Basda::ServiceState _from, Basda::ServiceState _to)
 
Basda::ServiceState state ()
 
Basda::ServiceState stateNow ()
 
Basda::ServiceState stateNext ()
 
Basda::ServiceState stateLast ()
 
bool isTransit ()
 
bool isTerminated ()
 

Protected Member Functions

virtual void status ()
 The method calls different commands in order to update the status. More...
 
virtual void status ()
 The method calls different commands in order to update the status. More...
 
- Protected Member Functions inherited from Basda::MoccaLCServiceWorkerSkeleton
const char * isReachableNode ()
 
const char * getNamedIntensityNode ()
 
void getNamedIntensityInit (int _named_intensity)
 
const char * setNamedIntensityNode ()
 
void setNamedIntensityInit (int _named_intensity)
 
const char * setIntensityNode ()
 
void setIntensityInit (std::string _light_source, int _intensity)
 
const char * switchOnNode ()
 
void switchOnInit (int _intensity)
 
const char * switchOffNode ()
 
virtual void work ()
 
const char * isReachableNode ()
 
const char * getNamedIntensityNode ()
 
void getNamedIntensityInit (int _named_intensity)
 
const char * setNamedIntensityNode ()
 
void setNamedIntensityInit (int _named_intensity)
 
const char * setIntensityNode ()
 
void setIntensityInit (std::string _light_source, int _intensity)
 
const char * switchOnNode ()
 
void switchOnInit (int _intensity)
 
const char * switchOffNode ()
 
virtual void work ()
 
- Protected Member Functions inherited from Basda::ServiceWorkerSkeleton
 ServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
 ServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
- Protected Member Functions inherited from Basda::ServiceWorker
 ServiceWorker (const Nice::JointPtr &_jointPtr)
 ctor More...
 
virtual ~ServiceWorker ()
 dtor Does nothing (in this base class) More...
 
void triggerState (const Basda::ServiceStateMachine &_state)
 change state to a new state More...
 
void sendStateStatus (const std::string &_action, int _percent)
 
void setState (Basda::ServiceState _next)
 
virtual void waitForNewState ()
 
virtual bool timedWaitForNewState (const Nice::Time &_timeout)
 
virtual void preinit ()
 
virtual void packin ()
 schedule ONLINE as the next target state. More...
 
virtual void idleStandby ()
 wait for a state change. More...
 
 ServiceWorker (const Nice::JointPtr &_jointPtr)
 
virtual ~ServiceWorker ()
 
void triggerState (const Basda::ServiceStateMachine &_state)
 
void sendStateStatus (const std::string &_action, int _percent)
 
void setState (Basda::ServiceState _next)
 
virtual void waitForNewState ()
 
virtual bool timedWaitForNewState (const Nice::Time &_timeout)
 
virtual void preinit ()
 
virtual void packin ()
 
virtual void idleStandby ()
 

Protected Attributes

MoccaLCDevicePtr m_device
 the object to call the xy device More...
 
DeviceAsyncImpl m_deviceAsync
 the call back object for the devices More...
 
DeviceCmdAsyncImpl m_deviceCmdAsync
 the call back object for the devices More...
 
Nice::SeqNPoint m_namedIntensityValueSeq
 
Nice::SeqSeqString m_namedIntensityLabelSeq
 
Nice::SeqString m_namedIntensityNameSeq
 
- Protected Attributes inherited from Basda::ServiceWorkerSkeleton
Nice::Completion m_completion
 
Nice::I64 m_id
 
Nice::PropertyPtr m_cmd
 
- Protected Attributes inherited from Basda::ServiceWorker
Nice::JointPtr m_config
 
Nice::PropertyPtr m_state
 
std::string m_name
 

Additional Inherited Members

- Protected Types inherited from Basda::ServiceWorker
typedef void(ServiceWorker::* ServiceWorkerMemFn) ()
 
typedef Branch BranchTable[6][6]
 
typedef IceUtil::Handle< WorkerThreadWorkerThreadPtr
 
typedef void(ServiceWorker::* ServiceWorkerMemFn) ()
 
typedef Branch BranchTable[6][6]
 
typedef IceUtil::Handle< WorkerThreadWorkerThreadPtr
 
- Static Protected Attributes inherited from Basda::ServiceWorker
static BranchTable s_stateTable
 A table which tells which state should go via which intermediate state to a target state. The 6 states are SHUTDOWN, OFFLINE, STANDBY, ONLINE, WORKING and ERROR. The principles are that. More...
 

Detailed Description

This class is the implementation of the LC interface.

Constructor & Destructor Documentation

◆ MoccaLCServiceWorker() [1/2]

Basda::MoccaLCServiceWorker::MoccaLCServiceWorker ( const Nice::JointPtr _config,
const MoccaLCDevicePtr _device 
)

Constructor.

◆ ~MoccaLCServiceWorker() [1/2]

Basda::MoccaLCServiceWorker::~MoccaLCServiceWorker ( )
virtual

Destructor.

◆ MoccaLCServiceWorker() [2/2]

Basda::MoccaLCServiceWorker::MoccaLCServiceWorker ( const Nice::JointPtr _config,
const MoccaLCDevicePtr _device 
)

Constructor.

◆ ~MoccaLCServiceWorker() [2/2]

virtual Basda::MoccaLCServiceWorker::~MoccaLCServiceWorker ( )
virtual

Destructor.

Member Function Documentation

◆ abort() [1/2]

virtual void Basda::MoccaLCServiceWorker::abort ( void  )
inlinevirtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ abort() [2/2]

virtual void Basda::MoccaLCServiceWorker::abort ( void  )
inlinevirtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ activate() [1/2]

void Basda::MoccaLCServiceWorker::activate ( )
virtual

This method activate the device.

Implements Basda::ServiceWorker.

◆ activate() [2/2]

virtual void Basda::MoccaLCServiceWorker::activate ( )
virtual

This method activate the device.

Implements Basda::ServiceWorker.

◆ deactivate() [1/2]

void Basda::MoccaLCServiceWorker::deactivate ( )
virtual

This method deactivate the device.

Implements Basda::ServiceWorker.

◆ deactivate() [2/2]

virtual void Basda::MoccaLCServiceWorker::deactivate ( )
virtual

This method deactivate the device.

Implements Basda::ServiceWorker.

◆ deinit() [1/2]

void Basda::MoccaLCServiceWorker::deinit ( )
virtual

This method deinit and close the device.

Implements Basda::ServiceWorker.

◆ deinit() [2/2]

virtual void Basda::MoccaLCServiceWorker::deinit ( )
virtual

This method deinit and close the device.

Implements Basda::ServiceWorker.

◆ errorOffline() [1/2]

void Basda::MoccaLCServiceWorker::errorOffline ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorOffline() [2/2]

virtual void Basda::MoccaLCServiceWorker::errorOffline ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorOnline() [1/2]

void Basda::MoccaLCServiceWorker::errorOnline ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorOnline() [2/2]

virtual void Basda::MoccaLCServiceWorker::errorOnline ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorStandby() [1/2]

void Basda::MoccaLCServiceWorker::errorStandby ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorStandby() [2/2]

virtual void Basda::MoccaLCServiceWorker::errorStandby ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorWorking() [1/2]

virtual void Basda::MoccaLCServiceWorker::errorWorking ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorWorking() [2/2]

void Basda::MoccaLCServiceWorker::errorWorking ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ getIntensity() [1/2]

void Basda::MoccaLCServiceWorker::getIntensity ( )
virtual

◆ getIntensity() [2/2]

virtual void Basda::MoccaLCServiceWorker::getIntensity ( )
virtual

◆ getLinkTimeout() [1/2]

virtual Nice::SeqTime Basda::MoccaLCServiceWorker::getLinkTimeout ( )
virtual

◆ getLinkTimeout() [2/2]

Nice::SeqTime Basda::MoccaLCServiceWorker::getLinkTimeout ( )
virtual

◆ getNamedIntensity() [1/2]

Nice::NPoint Basda::MoccaLCServiceWorker::getNamedIntensity ( int  _namedIntensity)
virtual

◆ getNamedIntensity() [2/2]

Nice::NPoint Basda::MoccaLCServiceWorker::getNamedIntensity ( int  _namedIntensity)
virtual

◆ idleOffline() [1/2]

virtual void Basda::MoccaLCServiceWorker::idleOffline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ idleOffline() [2/2]

void Basda::MoccaLCServiceWorker::idleOffline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ idleOnline() [1/2]

void Basda::MoccaLCServiceWorker::idleOnline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ idleOnline() [2/2]

virtual void Basda::MoccaLCServiceWorker::idleOnline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ init() [1/2]

virtual void Basda::MoccaLCServiceWorker::init ( )
virtual

This method initiate and open the device.

Implements Basda::ServiceWorker.

◆ init() [2/2]

void Basda::MoccaLCServiceWorker::init ( )
virtual

This method initiate and open the device.

Implements Basda::ServiceWorker.

◆ isReachable() [1/2]

virtual bool Basda::MoccaLCServiceWorker::isReachable ( )
virtual

◆ isReachable() [2/2]

bool Basda::MoccaLCServiceWorker::isReachable ( )
virtual

◆ setIntensity() [1/2]

virtual void Basda::MoccaLCServiceWorker::setIntensity ( std::string  lightSource,
int  _intensity 
)
virtual

◆ setIntensity() [2/2]

void Basda::MoccaLCServiceWorker::setIntensity ( std::string  lightSource,
int  _intensity 
)
virtual

◆ setNamedIntensity() [1/2]

void Basda::MoccaLCServiceWorker::setNamedIntensity ( int  _namedIntensity)
virtual

◆ setNamedIntensity() [2/2]

void Basda::MoccaLCServiceWorker::setNamedIntensity ( int  _namedIntensity)
virtual

◆ status() [1/2]

virtual void Basda::MoccaLCServiceWorker::status ( )
protectedvirtual

The method calls different commands in order to update the status.

◆ status() [2/2]

void Basda::MoccaLCServiceWorker::status ( )
protectedvirtual

The method calls different commands in order to update the status.

◆ stop() [1/2]

virtual void Basda::MoccaLCServiceWorker::stop ( )
inlinevirtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ stop() [2/2]

virtual void Basda::MoccaLCServiceWorker::stop ( )
inlinevirtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ switchOff() [1/2]

virtual void Basda::MoccaLCServiceWorker::switchOff ( )
virtual

◆ switchOff() [2/2]

void Basda::MoccaLCServiceWorker::switchOff ( )
virtual

◆ switchOn() [1/2]

virtual void Basda::MoccaLCServiceWorker::switchOn ( int  _intensity)
virtual

◆ switchOn() [2/2]

void Basda::MoccaLCServiceWorker::switchOn ( int  _intensity)
virtual

◆ terminate() [1/2]

void Basda::MoccaLCServiceWorker::terminate ( )
virtual

This method shut down the device.

Reimplemented from Basda::ServiceWorker.

◆ terminate() [2/2]

virtual void Basda::MoccaLCServiceWorker::terminate ( )
virtual

This method shut down the device.

Reimplemented from Basda::ServiceWorker.

Member Data Documentation

◆ m_device

MoccaLCDevicePtr Basda::MoccaLCServiceWorker::m_device
protected

the object to call the xy device

◆ m_deviceAsync

DeviceAsyncImpl Basda::MoccaLCServiceWorker::m_deviceAsync
protected

the call back object for the devices

◆ m_deviceCmdAsync

DeviceCmdAsyncImpl Basda::MoccaLCServiceWorker::m_deviceCmdAsync
protected

the call back object for the devices

◆ m_namedIntensityLabelSeq

Nice::SeqSeqString Basda::MoccaLCServiceWorker::m_namedIntensityLabelSeq
protected

◆ m_namedIntensityNameSeq

Nice::SeqString Basda::MoccaLCServiceWorker::m_namedIntensityNameSeq
protected

◆ m_namedIntensityValueSeq

Nice::SeqNPoint Basda::MoccaLCServiceWorker::m_namedIntensityValueSeq
protected

The documentation for this class was generated from the following files: