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

#include <CDeviceDummy.h>

Inheritance diagram for Basda::CoConCDeviceDummy:
Inheritance graph
Collaboration diagram for Basda::CoConCDeviceDummy:
Collaboration graph

Public Member Functions

 CoConCDeviceDummy (const Nice::JointPtr &_config)
 
virtual ~CoConCDeviceDummy ()
 
virtual void open ()
 This method might be called when the service goes in the INIT state. More...
 
virtual void close ()
 This method might be called when the service goes in the OFFLINE state. More...
 
virtual void reset (Basda::DeviceAsync &=Basda::Device::s_async)
 This method might be called when the service will be reseted. More...
 
virtual void version ()
 This method returns the version string of the device. More...
 
virtual void init (DeviceAsync &=Basda::Device::s_async)
 This method initialize the device and set the state to INIT. More...
 
virtual void deinit (DeviceAsync &=Basda::Device::s_async)
 This method deinitialize the device and set the state to OFFLINE. More...
 
virtual void activate (DeviceAsync &=Basda::Device::s_async)
 activate something More...
 
virtual void deactivate (DeviceAsync &=Basda::Device::s_async)
 deactivate something More...
 
virtual bool isReachable ()
 
virtual void resetCollision ()
 
virtual Nice::BitSet read ()
 read from the device all ports. More...
 
virtual void write (Nice::BitSet _collision)
 
virtual enum Basda::DigitalIODevice::PortState readOutputPort (int index)
 
virtual void setOutputPort (int portIndex, enum PortState desiredState)
 
virtual Nice::JointPtrVector description ()
 read description More...
 
void setChatType (Nice::ChatLinePtr _chat)
 
 CoConCDeviceDummy (const Nice::JointPtr &_config)
 
virtual ~CoConCDeviceDummy ()
 
virtual void open ()
 This method might be called when the service goes in the INIT state. More...
 
virtual void close ()
 This method might be called when the service goes in the OFFLINE state. More...
 
virtual void reset (Basda::DeviceAsync &=Basda::Device::s_async)
 This method might be called when the service will be reseted. More...
 
virtual void version ()
 This method returns the version string of the device. More...
 
virtual void init (DeviceAsync &=Basda::Device::s_async)
 This method initialize the device and set the state to INIT. More...
 
virtual void deinit (DeviceAsync &=Basda::Device::s_async)
 This method deinitialize the device and set the state to OFFLINE. More...
 
virtual void activate (DeviceAsync &=Basda::Device::s_async)
 activate something More...
 
virtual void deactivate (DeviceAsync &=Basda::Device::s_async)
 deactivate something More...
 
virtual bool isReachable ()
 
virtual void resetCollision ()
 
virtual Nice::BitSet read ()
 read from the device all ports. More...
 
virtual void write (Nice::BitSet _collision)
 
virtual enum Basda::DigitalIODevice::PortState readOutputPort (int index)
 
virtual void setOutputPort (int portIndex, enum PortState desiredState)
 
virtual Nice::JointPtrVector description ()
 read description More...
 
void setChatType (Nice::ChatLinePtr _chat)
 
- Public Member Functions inherited from Basda::MoccaCDevice
 MoccaCDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaCDevice ()
 Constructor. More...
 
 MoccaCDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaCDevice ()
 Constructor. More...
 
 MoccaCDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaCDevice ()
 Constructor. More...
 
- Public Member Functions inherited from Basda::DigitalIODevice
 DigitalIODevice (const Nice::JointPtr &_config)
 
 DigitalIODevice (const Nice::JointPtr &_config)
 
 DigitalIODevice (const Nice::JointPtr &_config)
 
- Public Member Functions inherited from Basda::Device
 Device (const Nice::JointPtr &_config)
 constructor. This is an elementary (lazy) action which stores the name and gets configuration. More...
 
virtual ~Device ()
 destructor Does nothing More...
 
virtual void setConfig (const Nice::JointPtr &_config)
 init with config tree ptr More...
 
Nice::JointPtrconfig ()
 retrieve the property tree More...
 
std::string & name ()
 retrieve the name set at ctor time. More...
 
 Device (const Nice::JointPtr &_config)
 constructor. This is an elementary (lazy) action which stores the name and gets configuration. More...
 
virtual ~Device ()
 destructor Does nothing More...
 
virtual void setConfig (const Nice::JointPtr &_config)
 init with config tree ptr More...
 
Nice::JointPtrconfig ()
 retrieve the property tree More...
 
std::string & name ()
 retrieve the name set at ctor time. More...
 

Protected Attributes

Nice::Timer m_timer
 
- Protected Attributes inherited from Basda::MoccaCDevice
Nice::Completion m_completion
 
- Protected Attributes inherited from Basda::Device
Nice::JointPtr m_config
 
Nice::JointPtr m_cfg
 
Nice::JointPtr m_var
 
std::string m_name
 

Private Member Functions

void createInstances ()
 
void setIsReachable (const bool _isReachable)
 
void createInstances ()
 
void setIsReachable (const bool _isReachable)
 

Private Attributes

CoConCardDummyPtr m_card
 This member keeps the card object. More...
 
Nice::ChatLinePtr m_chat
 This member keeps the chat object. More...
 
std::string m_address
 
int m_cardNo
 
int m_moduleNo
 
bool m_isReachable
 
Nice::Mutex m_mutex
 

Additional Inherited Members

- Public Types inherited from Basda::DigitalIODevice
enum  PortState {
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1, PORT_STATE_OFF = 0, PORT_STATE_ON = 1,
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1
}
 
enum  PortState {
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1, PORT_STATE_OFF = 0, PORT_STATE_ON = 1,
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1
}
 
enum  PortState {
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1, PORT_STATE_OFF = 0, PORT_STATE_ON = 1,
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1
}
 
- Static Public Attributes inherited from Basda::Device
static DeviceAsyncImpl s_async
 
- Protected Types inherited from Basda::MoccaCDevice
enum  CMDS {
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT
}
 
enum  CMDS {
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT
}
 
enum  CMDS {
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, RESETCOLLISION,
  READ, WRITE, READOUTPUTPORT, SETOUTPUTPORT
}
 

Constructor & Destructor Documentation

◆ CoConCDeviceDummy() [1/2]

Basda::CoConCDeviceDummy::CoConCDeviceDummy ( const Nice::JointPtr _config)

◆ ~CoConCDeviceDummy() [1/2]

Basda::CoConCDeviceDummy::~CoConCDeviceDummy ( )
virtual

◆ CoConCDeviceDummy() [2/2]

Basda::CoConCDeviceDummy::CoConCDeviceDummy ( const Nice::JointPtr _config)

◆ ~CoConCDeviceDummy() [2/2]

virtual Basda::CoConCDeviceDummy::~CoConCDeviceDummy ( )
virtual

Member Function Documentation

◆ activate() [1/2]

void Basda::CoConCDeviceDummy::activate ( DeviceAsync = Basda::Device::s_async)
virtual

activate something

Parameters
_asynchthe call back object
Todo:
implementation of the service activation

Implements Basda::Device.

◆ activate() [2/2]

virtual void Basda::CoConCDeviceDummy::activate ( DeviceAsync = Basda::Device::s_async)
virtual

activate something

Parameters
_asynchthe call back object
Todo:
implementation of the service activation

Implements Basda::Device.

◆ close() [1/2]

virtual void Basda::CoConCDeviceDummy::close ( )
virtual

This method might be called when the service goes in the OFFLINE state.

The connection to the collision controller will be closed.

Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ close() [2/2]

void Basda::CoConCDeviceDummy::close ( void  )
virtual

This method might be called when the service goes in the OFFLINE state.

The connection to the collision controller will be closed.

Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ createInstances() [1/2]

void Basda::CoConCDeviceDummy::createInstances ( )
private

◆ createInstances() [2/2]

void Basda::CoConCDeviceDummy::createInstances ( )
private

◆ deactivate() [1/2]

void Basda::CoConCDeviceDummy::deactivate ( DeviceAsync = Basda::Device::s_async)
virtual

deactivate something

Parameters
_asynchthe call back object
Todo:
implementation of the service deactivation

Implements Basda::Device.

◆ deactivate() [2/2]

virtual void Basda::CoConCDeviceDummy::deactivate ( DeviceAsync = Basda::Device::s_async)
virtual

deactivate something

Parameters
_asynchthe call back object
Todo:
implementation of the service deactivation

Implements Basda::Device.

◆ deinit() [1/2]

virtual void Basda::CoConCDeviceDummy::deinit ( DeviceAsync = Basda::Device::s_async)
virtual

This method deinitialize the device and set the state to OFFLINE.

Parameters
_asynchthe call back object
Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ deinit() [2/2]

void Basda::CoConCDeviceDummy::deinit ( DeviceAsync = Basda::Device::s_async)
virtual

This method deinitialize the device and set the state to OFFLINE.

Parameters
_asynchthe call back object
Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ description() [1/2]

virtual Nice::JointPtrVector Basda::CoConCDeviceDummy::description ( )
inlinevirtual

read description

Implements Basda::DigitalIODevice.

◆ description() [2/2]

virtual Nice::JointPtrVector Basda::CoConCDeviceDummy::description ( )
inlinevirtual

read description

Implements Basda::DigitalIODevice.

◆ init() [1/2]

void Basda::CoConCDeviceDummy::init ( DeviceAsync = Basda::Device::s_async)
virtual

This method initialize the device and set the state to INIT.

Parameters
_asynchthe call back object
Todo:
implementation of the INIT state

Implements Basda::Device.

◆ init() [2/2]

virtual void Basda::CoConCDeviceDummy::init ( DeviceAsync = Basda::Device::s_async)
virtual

This method initialize the device and set the state to INIT.

Parameters
_asynchthe call back object
Todo:
implementation of the INIT state

Implements Basda::Device.

◆ isReachable() [1/2]

bool Basda::CoConCDeviceDummy::isReachable ( )
virtual

Implements Basda::MoccaCDevice.

◆ isReachable() [2/2]

virtual bool Basda::CoConCDeviceDummy::isReachable ( )
virtual

Implements Basda::MoccaCDevice.

◆ open() [1/2]

virtual void Basda::CoConCDeviceDummy::open ( )
virtual

This method might be called when the service goes in the INIT state.

It connects to the collision controller.

Todo:
implementation of the INIT state

Implements Basda::Device.

◆ open() [2/2]

void Basda::CoConCDeviceDummy::open ( void  )
virtual

This method might be called when the service goes in the INIT state.

It connects to the collision controller.

Todo:
implementation of the INIT state

Implements Basda::Device.

◆ read() [1/2]

Nice::BitSet Basda::CoConCDeviceDummy::read ( )
virtual

read from the device all ports.

Implements Basda::DigitalIODevice.

◆ read() [2/2]

virtual Nice::BitSet Basda::CoConCDeviceDummy::read ( )
virtual

read from the device all ports.

Implements Basda::DigitalIODevice.

◆ readOutputPort() [1/2]

virtual enum Basda::DigitalIODevice::PortState Basda::CoConCDeviceDummy::readOutputPort ( int  index)
virtual

◆ readOutputPort() [2/2]

enum Basda::DigitalIODevice::PortState Basda::CoConCDeviceDummy::readOutputPort ( int  index)
virtual

◆ reset() [1/2]

virtual void Basda::CoConCDeviceDummy::reset ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

This method might be called when the service will be reseted.

The connection to the CoCon will be closed and opened again.

Parameters
_asynchthe call back object
Todo:
implementation to reset the service

Implements Basda::Device.

◆ reset() [2/2]

void Basda::CoConCDeviceDummy::reset ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

This method might be called when the service will be reseted.

The connection to the CoCon will be closed and opened again.

Parameters
_asynchthe call back object
Todo:
implementation to reset the service

Implements Basda::Device.

◆ resetCollision() [1/2]

void Basda::CoConCDeviceDummy::resetCollision ( )
virtual

Implements Basda::MoccaCDevice.

◆ resetCollision() [2/2]

virtual void Basda::CoConCDeviceDummy::resetCollision ( )
virtual

Implements Basda::MoccaCDevice.

◆ setChatType() [1/2]

void Basda::CoConCDeviceDummy::setChatType ( Nice::ChatLinePtr  _chat)

◆ setChatType() [2/2]

void Basda::CoConCDeviceDummy::setChatType ( Nice::ChatLinePtr  _chat)

◆ setIsReachable() [1/2]

void Basda::CoConCDeviceDummy::setIsReachable ( const bool  _isReachable)
private

◆ setIsReachable() [2/2]

void Basda::CoConCDeviceDummy::setIsReachable ( const bool  _isReachable)
private

◆ setOutputPort() [1/2]

virtual void Basda::CoConCDeviceDummy::setOutputPort ( int  portIndex,
enum PortState  desiredState 
)
virtual

◆ setOutputPort() [2/2]

void Basda::CoConCDeviceDummy::setOutputPort ( int  portIndex,
enum PortState  desiredState 
)
virtual

◆ version() [1/2]

virtual void Basda::CoConCDeviceDummy::version ( )
virtual

This method returns the version string of the device.

Todo:
implementation of the version string

Implements Basda::Device.

◆ version() [2/2]

void Basda::CoConCDeviceDummy::version ( void  )
virtual

This method returns the version string of the device.

Todo:
implementation of the version string

Implements Basda::Device.

◆ write() [1/2]

virtual void Basda::CoConCDeviceDummy::write ( Nice::BitSet  _collision)
virtual

◆ write() [2/2]

void Basda::CoConCDeviceDummy::write ( Nice::BitSet  _collision)
virtual

Member Data Documentation

◆ m_address

std::string Basda::CoConCDeviceDummy::m_address
private

◆ m_card

CoConCardDummyPtr Basda::CoConCDeviceDummy::m_card
private

This member keeps the card object.

◆ m_cardNo

int Basda::CoConCDeviceDummy::m_cardNo
private

◆ m_chat

Nice::ChatLinePtr Basda::CoConCDeviceDummy::m_chat
private

This member keeps the chat object.

The original Nice::Chat::Line object can be exchanged with a Chat::LineMock object to simulate the MoCon behavior.

◆ m_isReachable

bool Basda::CoConCDeviceDummy::m_isReachable
private

◆ m_moduleNo

int Basda::CoConCDeviceDummy::m_moduleNo
private

◆ m_mutex

Nice::Mutex Basda::CoConCDeviceDummy::m_mutex
private

◆ m_timer

Nice::Timer Basda::CoConCDeviceDummy::m_timer
protected

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