TwiceAsNice
2019-02-18
|
#include <IODeviceWut.h>
Classes | |
struct | PropertyName |
struct | PropertyValue |
class | SetOutputPortCommand |
Public Member Functions | |
IODeviceWut (const Nice::JointPtr &_config) | |
virtual | ~IODeviceWut () |
virtual void | open () |
initialize fundamental communication parameters. Define hostname, password and polling cycle. More... | |
virtual void | close () |
toggle an internal flag to disable further use. More... | |
virtual void | reset (Basda::DeviceAsync &=Basda::Device::s_async) |
Tells the basda status to assume a reset state. More... | |
virtual void | init (Basda::DeviceAsync &=Basda::Device::s_async) |
Initialize counters and values to an unknown status. More... | |
virtual void | deinit (Basda::DeviceAsync &=Basda::Device::s_async) |
Tells the basda status to assume a de-initialized status. More... | |
virtual void | activate (DeviceAsync &=s_async) |
dummy function which does nothing. More... | |
virtual void | deactivate (DeviceAsync &=s_async) |
dummy function which does nothing. More... | |
virtual void | version () |
logs a version number into the logger. More... | |
virtual std::vector< double > | read () |
Reads out the device and updates the property tree. More... | |
virtual void | write (std::vector< double >) |
dummy function. Does nothing. More... | |
virtual enum PortState | readOutputPort (int index) |
Obtain a single port's status. More... | |
virtual void | setOutputPort (int portIndex, enum PortState desiredState) |
Set a single output port to on or off. 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... | |
![]() | |
AnalogIODevice (const Nice::JointPtr &_config) | |
AnalogIODevice (const Nice::JointPtr &_config) | |
AnalogIODevice (const Nice::JointPtr &_config) | |
![]() | |
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::JointPtr & | config () |
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::JointPtr & | config () |
retrieve the property tree More... | |
std::string & | name () |
retrieve the name set at ctor time. More... | |
Static Public Member Functions | |
static std::string | toString (enum Basda::AnalogIODevice::PortState state) |
Convert the enumerated state to a human-readable string. More... | |
Protected Member Functions | |
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 | |
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 |
![]() | |
Nice::JointPtr | m_config |
Nice::JointPtr | m_cfg |
Nice::JointPtr | m_var |
std::string | m_name |
Private Types | |
typedef SetOutputPortCommand< PORT_STATE_OFF > | SetOffOutputPortCommand |
typedef SetOutputPortCommand< PORT_STATE_ON > | SetOnOutputPortCommand |
Private Attributes | |
std::vector< SetOffOutputPortCommand * > | m_setOffOutputPortCommands |
std::vector< SetOnOutputPortCommand * > | m_setOnOutputPortCommands |
WebSocketFactoryPtr | m_webSocketFactory |
WebSocketPtr | m_readRequestWebSocket |
WebSocketPtr | m_writeRequestWebSocket |
std::string | m_hostname |
std::string | m_httpPasswd |
int | m_portNumber |
Additional Inherited Members | |
![]() | |
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 DeviceAsyncImpl | s_async |
|
private |
Basda::IODeviceWut::IODeviceWut | ( | const Nice::JointPtr & | _config | ) |
|
virtual |
|
virtual |
dummy function which does nothing.
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
private |
define a black-on-yellow and black-on-grey color scheme for the two port states.
statusProperty |
|
private |
|
private |
define a socket by port and host.
|
virtual |
toggle an internal flag to disable further use.
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
protected |
reverse lookup of the device index in the vector of PART's
[in] | index | One of the OUTPUT index of the confguration tree. |
|
private |
|
private |
|
private |
Convert the human-readable on or off string to a local enumerated state.
[in] | portState | A string "ON" or "OFF". |
|
private |
|
private |
|
virtual |
dummy function which does nothing.
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
virtual |
Tells the basda status to assume a de-initialized status.
_async | The state keeper of the device status. |
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
private |
|
private |
|
virtual |
|
private |
Actually forward the desired state to the device. The information which of the ports is set to which state is obtained from the local property tree and not forwarded by function arguments here.
|
private |
|
private |
|
virtual |
Set the flag for reachability to true.
|
virtual |
Set the flag for reachability to false.
|
virtual |
Initialize counters and values to an unknown status.
_async | The state keeper of the status. This is put into the INIT state here. |
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
protected |
|
private |
config |
|
private |
|
private |
|
virtual |
|
private |
|
private |
|
private |
|
virtual |
initialize fundamental communication parameters. Define hostname, password and polling cycle.
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
virtual |
Reads out the device and updates the property tree.
Try to read all INPUT and OUTPUT ports.
Implements Basda::AnalogIODevice.
Reimplemented in Basda::IODeviceWutFake.
|
virtual |
Obtain a single port's status.
[in] | index | The individual index into the property tree of ports. |
Implements Basda::AnalogIODevice.
Reimplemented in Basda::IODeviceWutFake.
|
private |
webSocket | |
index |
|
private |
webSocket |
|
virtual |
Tells the basda status to assume a reset state.
_async | The state keeper of the device status. |
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
private |
|
virtual |
Set a single output port to on or off.
portIndex | The output port number. This is not the index in the local C++ vector of ports but the one on the device. |
desiredState | The desired new on or off state. |
Implements Basda::AnalogIODevice.
Reimplemented in Basda::IODeviceWutFake.
|
private |
Set a single output port to on or off.
webSocket | |
portIndex | The output port number. This is not the index in the local C++ vector of ports but the one on the device. |
desiredState | The desired new on or off state. |
|
protected |
|
static |
Convert the enumerated state to a human-readable string.
[in] | state | One of the on, off or unknown states. |
|
private |
|
virtual |
logs a version number into the logger.
Implements Basda::Device.
Reimplemented in Basda::IODeviceWutFake.
|
virtual |
|
private |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
protected |