RTXI 3.0.0 The Real-Time eXperiment Interface Reference Manual |
#include <widgets.hpp>
Public Member Functions | |
Plugin (Event::Manager *ev_manager, std::string mod_name) | |
Plugin (const Plugin &plugin)=delete | |
Plugin & | operator= (const Plugin &plugin)=delete |
Plugin (Plugin &&)=delete | |
Plugin & | operator= (Plugin &&)=delete |
~Plugin () override | |
size_t | getID () |
void | attachComponent (std::unique_ptr< Widgets::Component > component) |
void | attachPanel (Widgets::Panel *panel) |
int64_t | getComponentIntParameter (const Variable::Id ¶meter_id) |
uint64_t | getComponentUIntParameter (const Variable::Id ¶meter_id) |
double | getComponentDoubleParameter (const Variable::Id ¶meter_id) |
template<typename T > | |
int | setComponentParameter (const Variable::Id ¶meter_id, T value) |
std::string | getName () const |
bool | getActive () |
int | setActive (bool state) |
void | receiveEvent (Event::Object *event) override |
std::string | getLibrary () const |
void | setLibrary (const std::string &lib) |
void | registerComponent () |
void | setComponentState (RT::State::state_t state) |
virtual std::vector< Widgets::Variable::Info > | getComponentParametersInfo () |
Public Member Functions inherited from Event::Handler | |
Handler ()=default | |
Handler (const Handler &)=default | |
Handler (Handler &&)=delete | |
Handler & | operator= (const Handler &)=default |
Handler & | operator= (Handler &&)=delete |
virtual | ~Handler ()=default |
Protected Member Functions | |
Widgets::Component * | getComponent () |
Event::Manager * | getEventManager () |
QMainWindow * | getQMainWindow () |
Widgets::Panel * | getPanel () |
This class handles the isntantiation and deletion of Component and Plugin classes.
The responsibility is mainly the proper creation and deletion of the Component and Plugin classes, as well as the communication between the two. This class acts as a mediator between the two objects. Finally, it handles events pertaining to the module. This class, together with the Component and Panel classes, forms the Widget.
Definition at line 479 of file widgets.hpp.
Widgets::Plugin::Plugin | ( | Event::Manager * | ev_manager, |
std::string | mod_name | ||
) |
Definition at line 457 of file widgets.cpp.
| delete |
| delete |
| override |
void Widgets::Plugin::attachComponent | ( | std::unique_ptr< Widgets::Component > | component | ) |
Attaches a component to this plugin
component | a unique pointer to the component object |
Definition at line 504 of file widgets.cpp.
void Widgets::Plugin::attachPanel | ( | Widgets::Panel * | panel | ) |
Attaches a panel to this plugin
panel | a pointer to the panel object |
Definition at line 519 of file widgets.cpp.
bool Widgets::Plugin::getActive | ( | ) |
Checks whether the component is active
Definition at line 557 of file widgets.cpp.
| protected |
Definition at line 584 of file widgets.cpp.
double Widgets::Plugin::getComponentDoubleParameter | ( | const Variable::Id & | parameter_id | ) |
Retrieves a double parameter from the component object. Usually called from a non-realtime context
parameter_id | Identification number of the parameter |
Definition at line 537 of file widgets.cpp.
int64_t Widgets::Plugin::getComponentIntParameter | ( | const Variable::Id & | parameter_id | ) |
Retrieves an integer parameter from the component object. Usually called from a non-realtime context
parameter_id | Identification number of the parameter |
Definition at line 525 of file widgets.cpp.
| virtual |
Get the list of all widget parameters information
Definition at line 499 of file widgets.cpp.
uint64_t Widgets::Plugin::getComponentUIntParameter | ( | const Variable::Id & | parameter_id | ) |
Retrieves an unsigned integer parameter from the component object. Usually called from a non-realtime context
parameter_id | Identification number of the parameter |
Definition at line 531 of file widgets.cpp.
| protected |
Definition at line 589 of file widgets.cpp.
size_t Widgets::Plugin::getID | ( | ) |
get the component ID
| inline |
Get the name of the library from which the object was loaded.
Definition at line 616 of file widgets.hpp.
| inline |
Retrieves the name of the plugin
Definition at line 586 of file widgets.hpp.
| protected |
Definition at line 594 of file widgets.cpp.
| protected |
| overridevirtual |
Function called when a new event is fired
event | pointer to Qt event object |
Implements Event::Handler.
Reimplemented in Oscilloscope::Plugin, DataRecorder::Plugin, and Connector::Plugin.
Definition at line 543 of file widgets.cpp.
void Widgets::Plugin::registerComponent | ( | ) |
Register the internal component to RT::System registry
Definition at line 474 of file widgets.cpp.
int Widgets::Plugin::setActive | ( | bool | state | ) |
sets the activity state of the component
state | Boolean representing activity state |
Definition at line 567 of file widgets.cpp.
| inline |
Sets the component parameter
This function sends an event that will be handled by the realtime system. The event comprises with the parameter to change and the new value.
parameter_id | The id of the widget's parameter to change |
value | The new value to change the parameter to. accepted value types are: int, double, uint64_t, and std::string. Anything else is considered an error. |
Definition at line 554 of file widgets.hpp.
void Widgets::Plugin::setComponentState | ( | RT::State::state_t | state | ) |
Set the internal component state
state | an RT::State::state_t value to set the component to |
Definition at line 485 of file widgets.cpp.
| inline |
Sets the library location from which this widget was created.
lib | The library location |
Definition at line 623 of file widgets.hpp.