RTXI  3.0.0
The Real-Time eXperiment Interface Reference Manual
Public Member Functions
Widgets::Component Class Reference

#include <widgets.hpp>

Inheritance diagram for Widgets::Component:
Inheritance graph
Collaboration diagram for Widgets::Component:
Collaboration graph

Public Member Functions

 Component (Widgets::Plugin *hplugin, const std::string &mod_name, const std::vector< IO::channel_t > &channels, const std::vector< Widgets::Variable::Info > &variables)
template<typename T >
getValue (const size_t &var_id)
template<typename T >
void setValue (const size_t &var_id, T value)
std::string getDescription (const size_t &var_id)
std::string getValueString (const size_t &var_id)
RT::State::state_t getState () const
void setState (RT::State::state_t state)
std::vector< Widgets::Variable::InfogetParametersInfo ()
Widgets::PlugingetHostPlugin ()
- Public Member Functions inherited from RT::Thread
 Thread (std::string n, const std::vector< IO::channel_t > &c)
 Thread (const Thread &connector)=default
Threadoperator= (const Thread &connector)=default
 Thread (Thread &&)=delete
Threadoperator= (Thread &&)=delete
 ~Thread () override=default
virtual void execute ()=0
- Public Member Functions inherited from IO::Block
 Block (std::string blockname, const std::vector< channel_t > &channels, bool isdependent)
 Block (const Block &block)=default
Blockoperator= (const Block &block)=default
 Block (Block &&)=delete
Blockoperator= (Block &&)=delete
virtual ~Block ()=default
std::string getName () const
size_t getCount (flags_t type) const
std::string getChannelName (IO::flags_t type, size_t index) const
std::string getChannelDescription (IO::flags_t type, size_t index) const
void writeinput (size_t index, const double &data)
const double & readPort (IO::flags_t direction, size_t index)
bool dependent () const
bool getActive () const
void setActive (bool act)
void assignID (size_t block_id)
size_t getID () const

Additional Inherited Members

- Protected Member Functions inherited from IO::Block
double & readinput (size_t index)
void writeoutput (size_t index, const double &data)

Detailed Description

Class responsible for running real-time code.

This is where the magic happens. This class contains the low level logic to interface with the real-time loop, as well as low level facilities for parameter and input/output update. Inherit this class to run a periodic real-time function. It inherits the RT::Thread interface and therefore is considered dependent on inputs from other blocks. It will autoamtically be scheduled to run after dependency Components from other plugins.

Definition at line 183 of file widgets.hpp.

Constructor & Destructor Documentation

◆ Component()

const std::string & mod_name,
const std::vector< IO::channel_t > & channels,
const std::vector< Widgets::Variable::Info > & variables 

Definition at line 98 of file widgets.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ getDescription()

std::string Widgets::Component::getDescription(const size_t & var_id)

This function returns the developer description of the parameter

var_idthe variable id
the variable description

Definition at line 120 of file widgets.cpp.

◆ getHostPlugin()

Widgets::Plugin* Widgets::Component::getHostPlugin()

Get the plugin object that owns this component

Pointerto Widgets::Plugin object that owns this component.

Definition at line 267 of file widgets.hpp.

◆ getParametersInfo()

std::vector<Widgets::Variable::Info> Widgets::Component::getParametersInfo()

Get a list of all parameters for this widget

A vector of Widgets::Variable::Info structs representing widget parameters
See also

Definition at line 257 of file widgets.hpp.

◆ getState()

RT::State::state_t Widgets::Component::getState()const

Obtain Widget realtime state information

RT::State::state_t representing Widgets::Component state
See also

Definition at line 242 of file widgets.hpp.

◆ getValue()

template<typename T >
T Widgets::Component::getValue(const size_t & var_id)

Retrieves value from the component. Typically this function is only called by the real time loop and should not be called from the gui thread.

var_idThe parameter identification number
the value stored

Definition at line 200 of file widgets.hpp.

◆ getValueString()

std::string Widgets::Component::getValueString(const size_t & var_id)

This function automatically converts the value stored as a human readable string

var_idthe variable id
a string representation of the value stored

Definition at line 125 of file widgets.cpp.

◆ setState()

void Widgets::Component::setState(RT::State::state_t state)

set realtime state

statean RT::State::state_t enum representing new state

Definition at line 249 of file widgets.hpp.

◆ setValue()

template<typename T >
void Widgets::Component::setValue(const size_t & var_id,

Changes a parameter value

var_idThe parameter identification number
valuethe value to store

Definition at line 212 of file widgets.hpp.

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