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

#include <CDevice.h>

Inheritance diagram for Basda::CoConCDevice:
Inheritance graph
Collaboration diagram for Basda::CoConCDevice:
Collaboration graph

Public Member Functions

 CoConCDevice (const Nice::JointPtr &_config)
 ctor More...
 
virtual ~CoConCDevice ()
 dtor Does nothing. More...
 
virtual void open ()
 Open a communication channel with the device. More...
 
virtual void close ()
 Close the communication channel with the device. 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 ()
 read the reachability status from the property tree. More...
 
virtual void resetCollision ()
 Reset the status of the collisions on the board. More...
 
virtual Nice::BitSet read ()
 obtain the collision bits from the board. 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)
 Fix a communication type of the protocol for future use. More...
 
 CoConCDevice (const Nice::JointPtr &_config)
 
virtual ~CoConCDevice ()
 
virtual void open ()
 open device More...
 
virtual void close ()
 close device More...
 
virtual void reset (Basda::DeviceAsync &=Basda::Device::s_async)
 reset the device More...
 
virtual void version ()
 version More...
 
virtual void init (DeviceAsync &=Basda::Device::s_async)
 init the device More...
 
virtual void deinit (DeviceAsync &=Basda::Device::s_async)
 deinit the device More...
 
virtual void activate (DeviceAsync &=Basda::Device::s_async)
 activate the device More...
 
virtual void deactivate (DeviceAsync &=Basda::Device::s_async)
 deactivate the device 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...
 

Private Member Functions

void createInstances ()
 Populate the property tree at the MOD node. This does not involve any interaction with electronics. More...
 
void setIsReachable (const bool _isReachable)
 Set the reachability status in the property tree. More...
 
void createInstances ()
 
void setIsReachable (const bool _isReachable)
 

Private Attributes

MPIACoreProtocolPtr m_protocol
 This member upholds the connection to the MoCon. More...
 
CoConCardPtr m_card
 This member keeps the card object. More...
 
std::string m_address
 
int m_cardNo
 
int m_moduleNo
 
bool m_isReachable
 
Nice::Mutex m_mutex
 
Nice::Completion m_completion
 

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
}
 
- 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
 

Constructor & Destructor Documentation

◆ CoConCDevice() [1/2]

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

ctor


Parameters
_configTAN configuration set.

◆ ~CoConCDevice() [1/2]

Basda::CoConCDevice::~CoConCDevice ( )
virtual

dtor Does nothing.


◆ CoConCDevice() [2/2]

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

◆ ~CoConCDevice() [2/2]

virtual Basda::CoConCDevice::~CoConCDevice ( )
virtual

Member Function Documentation

◆ activate() [1/2]

void Basda::CoConCDevice::activate ( DeviceAsync _async = Basda::Device::s_async)
virtual

activate something


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

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

Implements Basda::Device.

◆ activate() [2/2]

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

activate the device

Implements Basda::Device.

◆ close() [1/2]

virtual void Basda::CoConCDevice::close ( )
virtual

close device

Implements Basda::Device.

◆ close() [2/2]

void Basda::CoConCDevice::close ( void  )
virtual

Close the communication channel with the device.


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

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::CoConCDevice::createInstances ( )
private

◆ createInstances() [2/2]

void Basda::CoConCDevice::createInstances ( )
private

Populate the property tree at the MOD node. This does not involve any interaction with electronics.


◆ deactivate() [1/2]

void Basda::CoConCDevice::deactivate ( DeviceAsync _async = Basda::Device::s_async)
virtual

deactivate something


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

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

Implements Basda::Device.

◆ deactivate() [2/2]

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

deactivate the device

Implements Basda::Device.

◆ deinit() [1/2]

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

deinit the device

Implements Basda::Device.

◆ deinit() [2/2]

void Basda::CoConCDevice::deinit ( DeviceAsync _async = 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

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

Implements Basda::Device.

◆ description() [1/2]

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

read description

Implements Basda::DigitalIODevice.

◆ description() [2/2]

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

read description

Implements Basda::DigitalIODevice.

◆ init() [1/2]

void Basda::CoConCDevice::init ( DeviceAsync _async = 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

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

Implements Basda::Device.

◆ init() [2/2]

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

init the device

Implements Basda::Device.

◆ isReachable() [1/2]

bool Basda::CoConCDevice::isReachable ( )
virtual

read the reachability status from the property tree.


Implements Basda::MoccaCDevice.

◆ isReachable() [2/2]

virtual bool Basda::CoConCDevice::isReachable ( )
virtual

Implements Basda::MoccaCDevice.

◆ open() [1/2]

virtual void Basda::CoConCDevice::open ( )
virtual

open device

Implements Basda::Device.

◆ open() [2/2]

void Basda::CoConCDevice::open ( void  )
virtual

Open a communication channel with the device.


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

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::CoConCDevice::read ( void  )
virtual

obtain the collision bits from the board.


Returns
The bit set of the current status.

Implements Basda::DigitalIODevice.

◆ read() [2/2]

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

read from the device all ports.

Implements Basda::DigitalIODevice.

◆ readOutputPort() [1/2]

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

◆ readOutputPort() [2/2]

enum Basda::DigitalIODevice::PortState Basda::CoConCDevice::readOutputPort ( int  _index)
virtual

Parameters
_index

Implements Basda::DigitalIODevice.

◆ reset() [1/2]

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

reset the device

Implements Basda::Device.

◆ reset() [2/2]

void Basda::CoConCDevice::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

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::CoConCDevice::resetCollision ( )
virtual

Reset the status of the collisions on the board.


Implements Basda::MoccaCDevice.

◆ resetCollision() [2/2]

virtual void Basda::CoConCDevice::resetCollision ( )
virtual

Implements Basda::MoccaCDevice.

◆ setChatType() [1/2]

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

Fix a communication type of the protocol for future use.


Parameters
_chat

◆ setChatType() [2/2]

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

◆ setIsReachable() [1/2]

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

◆ setIsReachable() [2/2]

void Basda::CoConCDevice::setIsReachable ( const bool  _state)
private

Set the reachability status in the property tree.


Parameters
_stateThe new state on return.

◆ setOutputPort() [1/2]

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

◆ setOutputPort() [2/2]

void Basda::CoConCDevice::setOutputPort ( int  _portIndex,
enum PortState  desiredState 
)
virtual

Parameters
_index
_desiredState

Implements Basda::DigitalIODevice.

◆ version() [1/2]

virtual void Basda::CoConCDevice::version ( )
virtual

version

Implements Basda::Device.

◆ version() [2/2]

void Basda::CoConCDevice::version ( void  )
virtual

This method returns the version string of the device.


Todo:
implementation of the version string

Todo:
implementation of the version string

Implements Basda::Device.

◆ write() [1/2]

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

◆ write() [2/2]

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

Parameters
_collision

Implements Basda::DigitalIODevice.

Member Data Documentation

◆ m_address

std::string Basda::CoConCDevice::m_address
private

◆ m_card

CoConCardPtr Basda::CoConCDevice::m_card
private

This member keeps the card object.

◆ m_cardNo

int Basda::CoConCDevice::m_cardNo
private

◆ m_completion

Nice::Completion Basda::CoConCDevice::m_completion
private

◆ m_isReachable

bool Basda::CoConCDevice::m_isReachable
private

◆ m_moduleNo

int Basda::CoConCDevice::m_moduleNo
private

◆ m_mutex

Nice::Mutex Basda::CoConCDevice::m_mutex
private

◆ m_protocol

MPIACoreProtocolPtr Basda::CoConCDevice::m_protocol
private

This member upholds the connection to the MoCon.


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