rec::robotino::api2 C++ interface
Public Member Functions | Static Public Member Functions | Friends | List of all members
rec::robotino::api2::DigitalInput Class Reference

Represents a digital input device. More...

#include <DigitalInput.h>

Inheritance diagram for rec::robotino::api2::DigitalInput:
rec::robotino::api2::ComObject

Public Member Functions

void setComId (const ComId &id)
 
void processEvents ()
 
void setInputNumber (unsigned int n)
 
bool value () const
 
virtual void valueChangedEvent (bool value)
 
- Public Member Functions inherited from rec::robotino::api2::ComObject
 ComObject ()
 
virtual ~ComObject ()
 
ComId comId () const
 

Static Public Member Functions

static unsigned int numDigitalInputs ()
 

Friends

class DigitalInputImpl
 

Additional Inherited Members

- Protected Attributes inherited from rec::robotino::api2::ComObject
ComId _comID
 

Detailed Description

Represents a digital input device.

Member Function Documentation

static unsigned int rec::robotino::api2::DigitalInput::numDigitalInputs ( )
static
Returns
Returns the number of digital inputs
Exceptions
nothing
void rec::robotino::api2::DigitalInput::processEvents ( )

Call this function from your main thread to get the virtual DigitalInput functions called. The virtual functions are called directly by a call of this function

Exceptions
nothing
See also
Com::processEvents
void rec::robotino::api2::DigitalInput::setComId ( const ComId id)

Sets the associated communication object.

Parameters
idThe id of the associated communication object.
Exceptions
RobotinoExceptionIf the given communication object doesn't provide a camera.
void rec::robotino::api2::DigitalInput::setInputNumber ( unsigned int  n)

Sets the number of this digital input device.

Parameters
nThe input number. Range [0; Robotstate::numDigitalInputs-1]
Exceptions
RobotinoExceptionif the given input number is invalid.
bool rec::robotino::api2::DigitalInput::value ( ) const

Returns the current value of the specified input device.

Returns
The current value of the specified digital input
Exceptions
RobotinoExceptionif the underlying communication object is invalid
See also
setInputNumber(), ComObject::setComId
virtual void rec::robotino::api2::DigitalInput::valueChangedEvent ( bool  value)
virtual

Called when value changed

Parameters
valueThe current value
Exceptions
nothing.
Remarks
This function is called from the thread in which Com::processEvents() is called.
See also
Com::processEvents

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