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

#include <widgets.hpp>

Inheritance diagram for Widgets::Plugin:
Inheritance graph
Collaboration diagram for Widgets::Plugin:
Collaboration graph

Public Member Functions

 Plugin (Event::Manager *ev_manager, std::string mod_name)
 
 Plugin (const Plugin &plugin)=delete
 
Pluginoperator= (const Plugin &plugin)=delete
 
 Plugin (Plugin &&)=delete
 
Pluginoperator= (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 &parameter_id)
 
uint64_t getComponentUIntParameter (const Variable::Id &parameter_id)
 
double getComponentDoubleParameter (const Variable::Id &parameter_id)
 
template<typename T >
int setComponentParameter (const Variable::Id &parameter_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::InfogetComponentParametersInfo ()
 
- Public Member Functions inherited from Event::Handler
 Handler ()=default
 
 Handler (const Handler &)=default
 
 Handler (Handler &&)=delete
 
Handleroperator= (const Handler &)=default
 
Handleroperator= (Handler &&)=delete
 
virtual ~Handler ()=default
 

Protected Member Functions

Widgets::ComponentgetComponent ()
 
Event::ManagergetEventManager ()
 
QMainWindow * getQMainWindow ()
 
Widgets::PanelgetPanel ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Plugin() [1/3]

Widgets::Plugin::Plugin(Event::Managerev_manager,
std::string mod_name 
)

Definition at line 457 of file widgets.cpp.

◆ Plugin() [2/3]

Widgets::Plugin::Plugin(const Pluginplugin)
delete

◆ Plugin() [3/3]

Widgets::Plugin::Plugin(Plugin && )
delete

◆ ~Plugin()

Widgets::Plugin::~Plugin()
override

Definition at line 463 of file widgets.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ attachComponent()

void Widgets::Plugin::attachComponent(std::unique_ptr< Widgets::Componentcomponent)

Attaches a component to this plugin

Parameters
componenta unique pointer to the component object

Definition at line 504 of file widgets.cpp.

◆ attachPanel()

void Widgets::Plugin::attachPanel(Widgets::Panelpanel)

Attaches a panel to this plugin

Parameters
panela pointer to the panel object

Definition at line 519 of file widgets.cpp.

Here is the call graph for this function:

◆ getActive()

bool Widgets::Plugin::getActive()

Checks whether the component is active

Returns
true if active, false otherwise

Definition at line 557 of file widgets.cpp.

◆ getComponent()

Widgets::Component * Widgets::Plugin::getComponent()
protected

Definition at line 584 of file widgets.cpp.

◆ getComponentDoubleParameter()

double Widgets::Plugin::getComponentDoubleParameter(const Variable::Idparameter_id)

Retrieves a double parameter from the component object. Usually called from a non-realtime context

Parameters
parameter_idIdentification number of the parameter
Returns
the double value

Definition at line 537 of file widgets.cpp.

◆ getComponentIntParameter()

int64_t Widgets::Plugin::getComponentIntParameter(const Variable::Idparameter_id)

Retrieves an integer parameter from the component object. Usually called from a non-realtime context

Parameters
parameter_idIdentification number of the parameter
Returns
the integer value

Definition at line 525 of file widgets.cpp.

◆ getComponentParametersInfo()

std::vector< Widgets::Variable::Info > Widgets::Plugin::getComponentParametersInfo()
virtual

Get the list of all widget parameters information

Returns
A vector of Widgets::Variable::Info representing parameter information

Definition at line 499 of file widgets.cpp.

◆ getComponentUIntParameter()

uint64_t Widgets::Plugin::getComponentUIntParameter(const Variable::Idparameter_id)

Retrieves an unsigned integer parameter from the component object. Usually called from a non-realtime context

Parameters
parameter_idIdentification number of the parameter
Returns
the unsigned integer value

Definition at line 531 of file widgets.cpp.

◆ getEventManager()

Event::Manager * Widgets::Plugin::getEventManager()
protected

Definition at line 589 of file widgets.cpp.

◆ getID()

size_t Widgets::Plugin::getID()

get the component ID

Returns
ID of the widget assigned by the realtime system

◆ getLibrary()

std::string Widgets::Plugin::getLibrary()const
inline

Get the name of the library from which the object was loaded.

Returns
The library file the object from which the object was created.

Definition at line 616 of file widgets.hpp.

◆ getName()

std::string Widgets::Plugin::getName()const
inline

Retrieves the name of the plugin

Returns
a string with the module name

Definition at line 586 of file widgets.hpp.

◆ getPanel()

Widgets::Panel * Widgets::Plugin::getPanel()
protected

Definition at line 594 of file widgets.cpp.

◆ getQMainWindow()

QMainWindow* Widgets::Plugin::getQMainWindow()
protected

◆ operator=() [1/2]

Plugin& Widgets::Plugin::operator=(const Pluginplugin)
delete

◆ operator=() [2/2]

Plugin& Widgets::Plugin::operator=(Plugin && )
delete

◆ receiveEvent()

void Widgets::Plugin::receiveEvent(Event::Objectevent)
overridevirtual

Function called when a new event is fired

Parameters
eventpointer to Qt event object

Implements Event::Handler.

Reimplemented in Oscilloscope::Plugin, DataRecorder::Plugin, and Connector::Plugin.

Definition at line 543 of file widgets.cpp.

Here is the call graph for this function:

◆ registerComponent()

void Widgets::Plugin::registerComponent()

Register the internal component to RT::System registry

Definition at line 474 of file widgets.cpp.

◆ setActive()

int Widgets::Plugin::setActive(bool state)

sets the activity state of the component

Parameters
stateBoolean representing activity state
Returns
0 if successful, -1 otherwise

Definition at line 567 of file widgets.cpp.

◆ setComponentParameter()

template<typename T >
int Widgets::Plugin::setComponentParameter(const Variable::Idparameter_id,
value 
)
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.

Parameters
parameter_idThe id of the widget's parameter to change
valueThe new value to change the parameter to. accepted value types are: int, double, uint64_t, and std::string. Anything else is considered an error.
Returns
an error code 0 for success, and -1 for failure

Definition at line 554 of file widgets.hpp.

Here is the call graph for this function:

◆ setComponentState()

void Widgets::Plugin::setComponentState(RT::State::state_t state)

Set the internal component state

Parameters
statean RT::State::state_t value to set the component to

Definition at line 485 of file widgets.cpp.

◆ setLibrary()

void Widgets::Plugin::setLibrary(const std::string & lib)
inline

Sets the library location from which this widget was created.

Parameters
libThe library location

Definition at line 623 of file widgets.hpp.


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