RTXI  2.4
The Real-Time eXperiment Interface Documentation
Data Structures | Public Types | Public Slots | Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Protected Attributes
DefaultGUIModel Class Reference

#include <default_gui_model.h>

Inheritance diagram for DefaultGUIModel:
Inheritance graph
Collaboration diagram for DefaultGUIModel:
Collaboration graph

Data Structures

struct  param_t
 

Public Types

enum  update_flags_t {
  INIT, MODIFY, PERIOD, PAUSE,
  UNPAUSE, EXIT
}
 
typedef Workspace::variable_t variable_t
 
- Public Types inherited from RT::Thread
typedef unsigned long Priority
 
- Public Types inherited from Settings::Object
typedef unsigned long ID
 

Public Slots

void resizeMe ()
 
virtual void exit (void)
 
virtual void refresh (void)
 
virtual void modify (void)
 
virtual void pause (bool)
 

Public Member Functions

QGridLayout * getLayout (void)
 
 DefaultGUIModel (std::string name, variable_t *variables, size_t size)
 
virtual ~DefaultGUIModel (void)
 
virtual void update (update_flags_t flag)
 
void createGUI (DefaultGUIModel::variable_t *var, int size)
 
- Public Member Functions inherited from RT::Thread
 Thread (Priority p=DefaultPriority)
 
virtual ~Thread (void)
 
Priority getPriority (void) const
 
virtual void execute (void)
 
bool getActive (void) const
 
void setActive (bool)
 
- Public Member Functions inherited from RT::List< T >::Node
 Node (void)
 
virtual ~Node (void)
 
bool operator== (const Node &x) const
 
- Public Member Functions inherited from Plugin::Object
 Object (void)
 
virtual ~Object (void)
 
std::string getLibrary (void) const
 
void unload (void)
 
- Public Member Functions inherited from Settings::Object
 Object (void)
 
ID getID (void) const
 
State save (void) const
 
void load (const State &)
 
void deferred (const State &)
 
- Public Member Functions inherited from Workspace::Instance
 Instance (std::string name, variable_t *variables, size_t size)
 
virtual ~Instance (void)
 
size_t getCount (IO::flags_t type) const
 
std::string getName (IO::flags_t type, size_t index) const
 
std::string getDescription (IO::flags_t type, size_t index) const
 
double getValue (IO::flags_t type, size_t index) const
 
std::string getValueString (IO::flags_t type, size_t index) const
 
void setValue (size_t index, double value)
 
void setComment (size_t index, std::string comment)
 
- Public Member Functions inherited from IO::Block
 Block (std::string name, channel_t *channels, size_t size)
 
virtual ~Block (void)
 
std::string getName (void) const
 
double input (size_t index) const
 
double output (size_t index) const
 
- Public Member Functions inherited from Event::Handler
 Handler (void)
 
virtual ~Handler (void)
 

Data Fields

QPushButton * pauseButton
 
QPushButton * modifyButton
 
QPushButton * unloadButton
 
std::map< QString, param_tparameter
 
QPalette palette
 

Static Public Attributes

static const IO::flags_t INPUT = Workspace::INPUT
 
static const IO::flags_t OUTPUT = Workspace::OUTPUT
 
static const IO::flags_t PARAMETER = Workspace::PARAMETER
 
static const IO::flags_t STATE = Workspace::STATE
 
static const IO::flags_t EVENT = Workspace::EVENT
 
static const IO::flags_t COMMENT = Workspace::COMMENT
 
static const IO::flags_t DOUBLE = Workspace::COMMENT<<1
 
static const IO::flags_t INTEGER = Workspace::COMMENT<<2
 
static const IO::flags_t UINTEGER = Workspace::COMMENT<<3
 
- Static Public Attributes inherited from RT::Thread
static const Priority MinimumPriority = 0
 
static const Priority MaximumPriority = 100
 
static const Priority DefaultPriority = MaximumPriority/2
 
- Static Public Attributes inherited from Settings::Object
const static ID INVALID = 0
 

Protected Member Functions

QString getParameter (const QString &name)
 
void setParameter (const QString &name, double value)
 
void setParameter (const QString &name, const QString value)
 
QString getComment (const QString &name)
 
void setComment (const QString &name, const QString comment)
 
void setState (const QString &name, double &ref)
 
void setEvent (const QString &name, double &ref)
 
- Protected Member Functions inherited from Workspace::Instance
double * getData (IO::flags_t type, size_t index)
 
void setData (IO::flags_t type, size_t index, double *value)
 
- Protected Member Functions inherited from IO::Block
double & output (size_t index)
 

Protected Attributes

QGridLayout * layout
 

Detailed Description

A class that provides a simplified C++ interface for model creation.

Definition at line 52 of file default_gui_model.h.

Member Typedef Documentation

◆ variable_t

Structure used to pass variable information to the constructor

See also
DefaultGUIModel::DefaultGUIModel()
Workspace::variable_t

Definition at line 124 of file default_gui_model.h.

Member Enumeration Documentation

◆ update_flags_t

Flag passed to DefaultGUIModel::update to signal the kind of update.

See also
DefaultGUIModel::update()
Enumerator
INIT 

The parameters need to be initialized.

MODIFY 

The parameters have been modified by the user.

PERIOD 

The system period has changed.

PAUSE 

The Pause button has been activated

UNPAUSE 

When the pause button has been deactivated

EXIT 

When the module has been told to exit

Definition at line 131 of file default_gui_model.h.

Constructor & Destructor Documentation

◆ DefaultGUIModel()

DefaultGUIModel::DefaultGUIModel(std::string name,
DefaultGUIModel::variable_tvar,
size_t size 
)

The constructor needs to be provided with a specification of the variables that will be embedded in the enclosed workspace.

See also
Workspace::Instance::Instance()
DefaultGUIModel::variable_t

Definition at line 61 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ ~DefaultGUIModel()

DefaultGUIModel::~DefaultGUIModel(void )
virtual

Definition at line 72 of file default_gui_model.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ createGUI()

void DefaultGUIModel::createGUI(DefaultGUIModel::variable_tvar,
int size 
)

Function that builds the Qt GUI.

Parameters
varThe structure defining the module's parameters, states, inputs, and outputs.
sizeThe size of the structure vars.
See also
DefaultGUIModel::update_flags_t

Definition at line 85 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ exit

void DefaultGUIModel::exit(void )
virtualslot

Function that allows the object to safely delete and unload itself.

Definition at line 213 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ getComment()

QString DefaultGUIModel::getComment(const QString & name)
protected

Definition at line 272 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ getLayout()

QGridLayout* DefaultGUIModel::getLayout(void )
inline

Definition at line 64 of file default_gui_model.h.

◆ getParameter()

QString DefaultGUIModel::getParameter(const QString & name)
protected

Get the value of the parameter in the GUI, and update the value within the Workspace.

Parameters
nameThe parameter's name.
Returns
The value of the parameter.

Definition at line 292 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ modify

void DefaultGUIModel::modify(void )
virtualslot

Function that calls DefaultGUIModel::update with the MODIFY flag

See also
DefaultGUIModel::update_flags_t

Definition at line 249 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ pause

void DefaultGUIModel::pause(bool p)
virtualslot

Function that pauses/unpauses the model.

Definition at line 346 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ refresh

void DefaultGUIModel::refresh(void )
virtualslot

Function that updates the GUI with new parameter values.

See also
DefaultGUIModel::update_flags_t

Definition at line 225 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ resizeMe

void DefaultGUIModel::resizeMe()
slot

Function that resizes widgets to properly fit layouts after overloading

Definition at line 208 of file default_gui_model.cpp.

◆ setComment()

void DefaultGUIModel::setComment(const QString & name,
const QString comment 
)
protected

Definition at line 280 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ setEvent()

void DefaultGUIModel::setEvent(const QString & name,
double & ref 
)
protected

Set the reference to this event within the Workspace via Workspace::setData().

Parameters
nameThe event name.
refA reference to the event.
See also
Workspace::setData()

Definition at line 336 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ setParameter() [1/2]

void DefaultGUIModel::setParameter(const QString & name,
const QString value 
)
protected

Set the value of this parameter within the Workspace and GUI.

Parameters
nameThe parameter's name.
valueThe parameter's new value.

Definition at line 315 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ setParameter() [2/2]

void DefaultGUIModel::setParameter(const QString & name,
double value 
)
protected

Set the value of this parameter within the Workspace and GUI.

Parameters
nameThe name of the parameter.
refA reference to the parameter.
See also
Workspace::setData()

Definition at line 304 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ setState()

void DefaultGUIModel::setState(const QString & name,
double & ref 
)
protected

Set the reference to this state within the Workspace via Workspace::setData().

Parameters
nameThe state's name.
refA reference to the state.
See also
Workspace::setData()

Definition at line 326 of file default_gui_model.cpp.

Here is the call graph for this function:

◆ update()

void DefaultGUIModel::update(DefaultGUIModel::update_flags_t flag)
virtual

Callback function that is called when the system state changes.

Parameters
flagThe kind of update to signal.
See also
DefaultGUIModel::update_flags_t

Definition at line 204 of file default_gui_model.cpp.

Field Documentation

◆ COMMENT

const IO::flags_t DefaultGUIModel::COMMENT = Workspace::COMMENT
static

Flag that marks a variable as a comment.

See also
Workspace::COMMENT

Definition at line 104 of file default_gui_model.h.

◆ DOUBLE

const IO::flags_t DefaultGUIModel::DOUBLE = Workspace::COMMENT<<1
static

Flag that marks a parameter as being of double type.

Definition at line 108 of file default_gui_model.h.

◆ EVENT

const IO::flags_t DefaultGUIModel::EVENT = Workspace::EVENT
static

Flag that marks a variable as an event.

See also
Workspace::STATE

Definition at line 98 of file default_gui_model.h.

◆ INPUT

const IO::flags_t DefaultGUIModel::INPUT = Workspace::INPUT
static

Flag that marks a variable as an input.

See also
Workspace::INPUT

Definition at line 74 of file default_gui_model.h.

◆ INTEGER

const IO::flags_t DefaultGUIModel::INTEGER = Workspace::COMMENT<<2
static

Flag that marks a parameter as being of integer type.

Definition at line 112 of file default_gui_model.h.

◆ layout

QGridLayout* DefaultGUIModel::layout
protected

Definition at line 215 of file default_gui_model.h.

◆ modifyButton

QPushButton* DefaultGUIModel::modifyButton

Definition at line 172 of file default_gui_model.h.

◆ OUTPUT

const IO::flags_t DefaultGUIModel::OUTPUT = Workspace::OUTPUT
static

Flag that marks a variable as an output.

See also
Workspace::OUTPUT

Definition at line 80 of file default_gui_model.h.

◆ palette

QPalette DefaultGUIModel::palette

Definition at line 184 of file default_gui_model.h.

◆ PARAMETER

const IO::flags_t DefaultGUIModel::PARAMETER = Workspace::PARAMETER
static

Flag that marks a variable as a parameter.

See also
Workspace::PARAMETER

Definition at line 86 of file default_gui_model.h.

◆ parameter

std::map<QString,param_t> DefaultGUIModel::parameter

Definition at line 183 of file default_gui_model.h.

◆ pauseButton

QPushButton* DefaultGUIModel::pauseButton

Definition at line 171 of file default_gui_model.h.

◆ STATE

const IO::flags_t DefaultGUIModel::STATE = Workspace::STATE
static

Flag that marks a variable as a state.

See also
Workspace::STATE

Definition at line 92 of file default_gui_model.h.

◆ UINTEGER

const IO::flags_t DefaultGUIModel::UINTEGER = Workspace::COMMENT<<3
static

Flag that marks a parameter as being of unsigned integer type.

Definition at line 116 of file default_gui_model.h.

◆ unloadButton

QPushButton* DefaultGUIModel::unloadButton

Definition at line 173 of file default_gui_model.h.


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