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

This basda device fakes a IODeviceWut. More...

#include <IODeviceWutFake.h>

Inheritance diagram for Basda::IODeviceWutFake:
Inheritance graph
Collaboration diagram for Basda::IODeviceWutFake:
Collaboration graph

Classes

struct  PropertyName
 

Public Member Functions

 IODeviceWutFake (const Nice::JointPtr &config)
 
virtual ~IODeviceWutFake ()
 
virtual void open ()
 
virtual void close ()
 
virtual void reset (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void init (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void deinit (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void activate (DeviceAsync &=s_async)
 
virtual void deactivate (DeviceAsync &=s_async)
 
virtual void version ()
 
virtual std::vector< double > read ()
 
virtual enum PortState readOutputPort (int index)
 
virtual void setOutputPort (int portIndex, enum PortState desiredState)
 
void setDeviceCommunicationReadiness (const bool &newState)
 
- Public Member Functions inherited from Basda::IODeviceWut
 IODeviceWut (const Nice::JointPtr &_config)
 
virtual ~IODeviceWut ()
 
virtual void write (std::vector< double >)
 dummy function. Does nothing. More...
 
virtual Nice::JointPtrVector description (void)
 get the part nodes More...
 
virtual bool isReachable ()
 
virtual void hardwareIsReachable ()
 Set the flag for reachability to true. More...
 
virtual void hardwareIsUnreachable ()
 Set the flag for reachability to false. More...
 
- Public Member Functions inherited from Basda::AnalogIODevice
 AnalogIODevice (const Nice::JointPtr &_config)
 
 AnalogIODevice (const Nice::JointPtr &_config)
 
 AnalogIODevice (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 updateOutputPortStatusProperty (int outputPortIndex, enum AnalogIODevice::PortState desiredState)
 
void updateInputPortStatusPropertyToOFF (const int inputPortIndex)
 
void initializeUnsetPortsToOFF ()
 
void initializeInputPortIfAny (const Nice::JointPtr &part)
 
void initializeOutputPortIfAny (const Nice::JointPtr &part)
 

Private Attributes

std::map< int, AnalogIODevice::PortStatem_outputPortStateByPort
 

Additional Inherited Members

- Public Types inherited from Basda::AnalogIODevice
enum  PortState {
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1, PORT_STATE_UNKNOWN = -1, PORT_STATE_OFF = 0,
  PORT_STATE_ON = 1, PORT_STATE_UNKNOWN = -1, PORT_STATE_OFF = 0, PORT_STATE_ON = 1,
  PORT_STATE_UNKNOWN = -1
}
 
enum  PortState {
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1, PORT_STATE_UNKNOWN = -1, PORT_STATE_OFF = 0,
  PORT_STATE_ON = 1, PORT_STATE_UNKNOWN = -1, PORT_STATE_OFF = 0, PORT_STATE_ON = 1,
  PORT_STATE_UNKNOWN = -1
}
 
enum  PortState {
  PORT_STATE_OFF = 0, PORT_STATE_ON = 1, PORT_STATE_UNKNOWN = -1, PORT_STATE_OFF = 0,
  PORT_STATE_ON = 1, PORT_STATE_UNKNOWN = -1, PORT_STATE_OFF = 0, PORT_STATE_ON = 1,
  PORT_STATE_UNKNOWN = -1
}
 
- Static Public Member Functions inherited from Basda::IODeviceWut
static std::string toString (enum Basda::AnalogIODevice::PortState state)
 Convert the enumerated state to a human-readable string. More...
 
- Static Public Attributes inherited from Basda::Device
static DeviceAsyncImpl s_async
 
- Protected Member Functions inherited from Basda::IODeviceWut
void setReachablePropertyTo (bool reachable)
 
void injectWebSocketFactory (WebSocketFactoryPtr newFactory)
 
int cnvrtOutIndexToNodeIndex (const int index)
 reverse lookup of the device index in the vector of PART's More...
 
- Protected Attributes inherited from Basda::IODeviceWut
Nice::JointPtrVector m_partNodes
 
webIOInputVector m_input
 
webIOOutputVector m_output
 
bool readyForDeviceCommunication_
 
Nice::Mutex m_mtx
 
Nice::Mutex m_readMtx
 
Nice::Mutex m_writeMtx
 
unsigned m_maxAllowedNetworkServiceDelayInMicroSec
 
unsigned m_pollCycleTimeInMilliSec
 
Basda::WuT::LogPtr m_log
 
- Protected Attributes inherited from Basda::Device
Nice::JointPtr m_config
 
Nice::JointPtr m_cfg
 
Nice::JointPtr m_var
 
std::string m_name
 

Detailed Description

This basda device fakes a IODeviceWut.

Constructor & Destructor Documentation

◆ IODeviceWutFake()

Basda::IODeviceWutFake::IODeviceWutFake ( const Nice::JointPtr config)
explicit

◆ ~IODeviceWutFake()

Basda::IODeviceWutFake::~IODeviceWutFake ( )
virtual
Note
overridden

Member Function Documentation

◆ activate()

void Basda::IODeviceWutFake::activate ( DeviceAsync = s_async)
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ close()

void Basda::IODeviceWutFake::close ( void  )
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ deactivate()

void Basda::IODeviceWutFake::deactivate ( DeviceAsync = s_async)
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ deinit()

void Basda::IODeviceWutFake::deinit ( Basda::DeviceAsync = Basda::Device::s_async)
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ init()

void Basda::IODeviceWutFake::init ( Basda::DeviceAsync = Basda::Device::s_async)
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ initializeInputPortIfAny()

void Basda::IODeviceWutFake::initializeInputPortIfAny ( const Nice::JointPtr part)
private

◆ initializeOutputPortIfAny()

void Basda::IODeviceWutFake::initializeOutputPortIfAny ( const Nice::JointPtr part)
private

◆ initializeUnsetPortsToOFF()

void Basda::IODeviceWutFake::initializeUnsetPortsToOFF ( )
private

◆ open()

void Basda::IODeviceWutFake::open ( void  )
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ read()

std::vector< double > Basda::IODeviceWutFake::read ( void  )
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ readOutputPort()

enum AnalogIODevice::PortState Basda::IODeviceWutFake::readOutputPort ( int  index)
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ reset()

void Basda::IODeviceWutFake::reset ( Basda::DeviceAsync = Basda::Device::s_async)
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

◆ setDeviceCommunicationReadiness()

void Basda::IODeviceWutFake::setDeviceCommunicationReadiness ( const bool newState)
Note
property bridge member function
thread-safe

◆ setOutputPort()

void Basda::IODeviceWutFake::setOutputPort ( int  portIndex,
enum PortState  desiredState 
)
virtual
Note
thread-safe
overridden

Reimplemented from Basda::IODeviceWut.

◆ updateInputPortStatusPropertyToOFF()

void Basda::IODeviceWutFake::updateInputPortStatusPropertyToOFF ( const int  inputPortIndex)
private

◆ updateOutputPortStatusProperty()

void Basda::IODeviceWutFake::updateOutputPortStatusProperty ( int  outputPortIndex,
enum AnalogIODevice::PortState  desiredState 
)
private

◆ version()

void Basda::IODeviceWutFake::version ( void  )
virtual
Note
overridden

Reimplemented from Basda::IODeviceWut.

Member Data Documentation

◆ m_outputPortStateByPort

std::map<int, AnalogIODevice::PortState> Basda::IODeviceWutFake::m_outputPortStateByPort
private

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