TwiceAsNice  2019-02-18
Classes | Public Member Functions | Private Attributes | List of all members
Laos::XineticsServiceWorker Class Reference

#include <LaosWfcXineticsServiceWorker.h>

Inheritance diagram for Laos::XineticsServiceWorker:
Inheritance graph
Collaboration diagram for Laos::XineticsServiceWorker:
Collaboration graph

Classes

struct  DeviceAsyncImpl
 

Public Member Functions

 XineticsServiceWorker (const Nice::JointPtr &_config)
 
virtual ~XineticsServiceWorker ()
 
virtual void init ()
 
virtual void deinit ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual void terminate ()
 schedule EXIT as the next target state. More...
 
virtual void idleOnline ()
 wait for a state change. More...
 
virtual void idleStandby ()
 wait for a state change. More...
 
virtual void stop ()
 does nothing. More...
 
virtual void abort ()
 does nothing. More...
 
virtual void setActuators (const Nice::SeqInt &_actuatorCmd)
 
virtual void getActuators (Nice::SeqInt &_actuatorCmd) const
 retrieve the most recently calculated integer values. More...
 
virtual void resetDSP ()
 
virtual void resetActuators ()
 
virtual void send2DM (bool SEND)
 
 XineticsServiceWorker (const Nice::JointPtr &_config)
 
virtual ~XineticsServiceWorker ()
 
virtual void init ()
 
virtual void deinit ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual void terminate ()
 schedule EXIT as the next target state. More...
 
virtual void idleOnline ()
 wait for a state change. More...
 
virtual void idleStandby ()
 wait for a state change. More...
 
virtual void stop ()
 does nothing. More...
 
virtual void abort ()
 does nothing. More...
 
virtual void setActuators (const Nice::SeqInt &_actuatorCmd)
 
virtual void getActuators (Nice::SeqInt &_actuatorCmd) const
 
virtual void resetDSP ()
 
virtual void resetActuators ()
 
virtual void send2DM (bool SEND)
 
- Public Member Functions inherited from Laos::XineticsServiceWorkerSkeleton
 XineticsServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
virtual ~XineticsServiceWorkerSkeleton ()
 
 XineticsServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
virtual ~XineticsServiceWorkerSkeleton ()
 
- 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 ()
 

Private Attributes

DeviceAsyncImpl m_deviceAsync
 
Laos::XineticsCoreDevicePtr m_device
 
Nice::SeqInt m_actuatorCommand
 

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
 
- Protected Member Functions inherited from Laos::XineticsServiceWorkerSkeleton
const char * setActuatorsNode ()
 
void setActuatorsInit (const Nice::SeqInt &_actuators)
 
const char * resetDSPNode ()
 
const char * resetActuatorsNode ()
 
const char * send2DMNode ()
 
void send2DMInit (bool _send)
 
virtual void work ()
 
const char * setActuatorsNode ()
 
void setActuatorsInit (const Nice::SeqInt &_actuators)
 
const char * resetDSPNode ()
 
const char * resetActuatorsNode ()
 
const char * send2DMNode ()
 
void send2DMInit (bool _send)
 
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 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...
 
 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 errorOffline ()
 
virtual void errorStandby ()
 
virtual void errorOnline ()
 
virtual void errorWorking ()
 
virtual void idleOffline ()
 
- 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
 
- 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...
 

Constructor & Destructor Documentation

◆ XineticsServiceWorker() [1/2]

Laos::XineticsServiceWorker::XineticsServiceWorker ( const Nice::JointPtr _config)

◆ ~XineticsServiceWorker() [1/2]

Laos::XineticsServiceWorker::~XineticsServiceWorker ( )
virtual

◆ XineticsServiceWorker() [2/2]

Laos::XineticsServiceWorker::XineticsServiceWorker ( const Nice::JointPtr _config)

◆ ~XineticsServiceWorker() [2/2]

virtual Laos::XineticsServiceWorker::~XineticsServiceWorker ( )
virtual

Member Function Documentation

◆ abort() [1/2]

void Laos::XineticsServiceWorker::abort ( void  )
virtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ abort() [2/2]

virtual void Laos::XineticsServiceWorker::abort ( void  )
virtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ activate() [1/2]

virtual void Laos::XineticsServiceWorker::activate ( )
virtual

Implements Basda::ServiceWorker.

◆ activate() [2/2]

void Laos::XineticsServiceWorker::activate ( )
virtual

Implements Basda::ServiceWorker.

◆ deactivate() [1/2]

void Laos::XineticsServiceWorker::deactivate ( )
virtual

Implements Basda::ServiceWorker.

◆ deactivate() [2/2]

virtual void Laos::XineticsServiceWorker::deactivate ( )
virtual

Implements Basda::ServiceWorker.

◆ deinit() [1/2]

virtual void Laos::XineticsServiceWorker::deinit ( )
virtual

Implements Basda::ServiceWorker.

◆ deinit() [2/2]

void Laos::XineticsServiceWorker::deinit ( )
virtual

Implements Basda::ServiceWorker.

◆ getActuators() [1/2]

void Laos::XineticsServiceWorker::getActuators ( Nice::SeqInt _actuatorCmd) const
virtual

retrieve the most recently calculated integer values.


Parameters
[out]_actuatorCmdThe vector of the most recently calculated commands. Obtained by un-applying offsets, sensitivities and non-linearties to the most recently stored voltages. Note that the values have not necessarily been forwarded to the DM by setActuators() if some overvoltage/bias checks failed.
Since
2018-11-06

◆ getActuators() [2/2]

virtual void Laos::XineticsServiceWorker::getActuators ( Nice::SeqInt _actuatorCmd) const
virtual

◆ idleOnline() [1/2]

virtual void Laos::XineticsServiceWorker::idleOnline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ idleOnline() [2/2]

void Laos::XineticsServiceWorker::idleOnline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ idleStandby() [1/2]

virtual void Laos::XineticsServiceWorker::idleStandby ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ idleStandby() [2/2]

void Laos::XineticsServiceWorker::idleStandby ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ init() [1/2]

void Laos::XineticsServiceWorker::init ( )
virtual

Implements Basda::ServiceWorker.

◆ init() [2/2]

virtual void Laos::XineticsServiceWorker::init ( )
virtual

Implements Basda::ServiceWorker.

◆ resetActuators() [1/2]

virtual void Laos::XineticsServiceWorker::resetActuators ( )
virtual

◆ resetActuators() [2/2]

void Laos::XineticsServiceWorker::resetActuators ( )
virtual

◆ resetDSP() [1/2]

void Laos::XineticsServiceWorker::resetDSP ( )
virtual

◆ resetDSP() [2/2]

virtual void Laos::XineticsServiceWorker::resetDSP ( )
virtual

◆ send2DM() [1/2]

virtual void Laos::XineticsServiceWorker::send2DM ( bool  SEND)
virtual

◆ send2DM() [2/2]

void Laos::XineticsServiceWorker::send2DM ( bool  SEND)
virtual

◆ setActuators() [1/2]

void Laos::XineticsServiceWorker::setActuators ( const Nice::SeqInt _actuatorCmd)
virtual

◆ setActuators() [2/2]

virtual void Laos::XineticsServiceWorker::setActuators ( const Nice::SeqInt _actuatorCmd)
virtual

◆ stop() [1/2]

virtual void Laos::XineticsServiceWorker::stop ( )
virtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ stop() [2/2]

void Laos::XineticsServiceWorker::stop ( )
virtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ terminate() [1/2]

void Laos::XineticsServiceWorker::terminate ( )
virtual

schedule EXIT as the next target state.


Reimplemented from Basda::ServiceWorker.

◆ terminate() [2/2]

virtual void Laos::XineticsServiceWorker::terminate ( )
virtual

schedule EXIT as the next target state.


Reimplemented from Basda::ServiceWorker.

Member Data Documentation

◆ m_actuatorCommand

Nice::SeqInt Laos::XineticsServiceWorker::m_actuatorCommand
private

◆ m_device

Laos::XineticsCoreDevicePtr Laos::XineticsServiceWorker::m_device
private

◆ m_deviceAsync

DeviceAsyncImpl Laos::XineticsServiceWorker::m_deviceAsync
private

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