![]() |
RTXI 1.3
|
#include <default_gui_model.h>
Classes | |
| struct | param_t |
Public Types | |
| enum | update_flags_t { INIT, MODIFY, PERIOD, PAUSE, UNPAUSE, EXIT } |
| typedef Workspace::variable_t | variable_t |
Public Slots | |
| void | exit (void) |
| void | refresh (void) |
| void | modify (void) |
| void | pause (bool) |
Public Member Functions | |
| 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 Attributes | |
| QPushButton * | pauseButton |
| std::map< QString, param_t > | parameter |
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 |
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) |
A class that provides a simplified C++ interface for model creation.
Definition at line 53 of file default_gui_model.h.
Structure used to pass variable information to the constructor
Definition at line 115 of file default_gui_model.h.
Flag passed to DefaultGUIModel::update to signal the kind of update.
Definition at line 122 of file default_gui_model.h.
| DefaultGUIModel::DefaultGUIModel | ( | std::string | name, |
| DefaultGUIModel::variable_t * | var, | ||
| size_t | size | ||
| ) |
The constructor needs to be provided with a specification of the variables that will be embedded in the enclosed workspace.
Definition at line 65 of file default_gui_model.cpp.
| DefaultGUIModel::~DefaultGUIModel | ( | void | ) | [virtual] |
Definition at line 77 of file default_gui_model.cpp.
| void DefaultGUIModel::createGUI | ( | DefaultGUIModel::variable_t * | var, |
| int | size | ||
| ) |
Function that builds the Qt GUI.
| var | The structure defining the module's parameters, states, inputs, and outputs. |
| size | The size of the structure vars. |
Reimplemented in MyPluginGUI, FIRwindow, IIRfilter, NoiseGen, SigGen, and WaveMaker.
Definition at line 84 of file default_gui_model.cpp.
| void DefaultGUIModel::exit | ( | void | ) | [slot] |
Function that allows the object to safely delete and unload itself.
Definition at line 158 of file default_gui_model.cpp.
| QString DefaultGUIModel::getComment | ( | const QString & | name | ) | [protected] |
Definition at line 205 of file default_gui_model.cpp.
| QString DefaultGUIModel::getParameter | ( | const QString & | name | ) | [protected] |
Get the value of the parameter in the GUI, and update the value within the Workspace.
| name | The parameter's name. |
Definition at line 220 of file default_gui_model.cpp.
| void DefaultGUIModel::modify | ( | void | ) | [slot] |
Function that calls DefaultGUIModel::update with the MODIFY flag
Definition at line 182 of file default_gui_model.cpp.
| void DefaultGUIModel::pause | ( | bool | p | ) | [slot] |
Function that pauses/unpauses the model.
Definition at line 264 of file default_gui_model.cpp.
| void DefaultGUIModel::refresh | ( | void | ) | [slot] |
Function that updates the GUI with new parameter values.
Definition at line 163 of file default_gui_model.cpp.
| void DefaultGUIModel::setComment | ( | const QString & | name, |
| const QString | comment | ||
| ) | [protected] |
Definition at line 212 of file default_gui_model.cpp.
| void DefaultGUIModel::setEvent | ( | const QString & | name, |
| double & | ref | ||
| ) | [protected] |
Set the reference to this event within the Workspace via Workspace::setData().
| name | The event name. |
| ref | A reference to the event. |
Definition at line 256 of file default_gui_model.cpp.
| void DefaultGUIModel::setParameter | ( | const QString & | name, |
| double | value | ||
| ) | [protected] |
Set the value of this parameter within the Workspace and GUI.
| name | The name of the parameter. |
| ref | A reference to the parameter. |
Definition at line 230 of file default_gui_model.cpp.
| void DefaultGUIModel::setParameter | ( | const QString & | name, |
| const QString | value | ||
| ) | [protected] |
Set the value of this parameter within the Workspace and GUI.
| name | The parameter's name. |
| value | The parameter's new value. |
Definition at line 239 of file default_gui_model.cpp.
| void DefaultGUIModel::setState | ( | const QString & | name, |
| double & | ref | ||
| ) | [protected] |
Set the reference to this state within the Workspace via Workspace::setData().
| name | The state's name. |
| ref | A reference to the state. |
Definition at line 248 of file default_gui_model.cpp.
| void DefaultGUIModel::update | ( | DefaultGUIModel::update_flags_t | flag | ) | [virtual] |
Callback function that is called when the system state changes.
| flag | The kind of update to signal. |
Reimplemented in MyPlugin, MyPluginGUI, FIRwindow, IIRfilter, Mimic, Neuron, NoiseGen, SigGen, Synch, and WaveMaker.
Definition at line 155 of file default_gui_model.cpp.
const IO::flags_t DefaultGUIModel::COMMENT = Workspace::COMMENT [static] |
Flag that marks a variable as a comment.
Definition at line 95 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::DOUBLE = Workspace::COMMENT<<1 [static] |
Flag that marks a parameter as being of double type.
Definition at line 99 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::EVENT = Workspace::EVENT [static] |
Flag that marks a variable as an event.
Definition at line 89 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::INPUT = Workspace::INPUT [static] |
Flag that marks a variable as an input.
Definition at line 65 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::INTEGER = Workspace::COMMENT<<2 [static] |
Flag that marks a parameter as being of integer type.
Definition at line 103 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::OUTPUT = Workspace::OUTPUT [static] |
Flag that marks a variable as an output.
Definition at line 71 of file default_gui_model.h.
| std::map<QString,param_t> DefaultGUIModel::parameter |
Reimplemented from Workspace::Instance.
Definition at line 169 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::PARAMETER = Workspace::PARAMETER [static] |
Flag that marks a variable as a parameter.
Definition at line 77 of file default_gui_model.h.
| QPushButton* DefaultGUIModel::pauseButton |
Definition at line 161 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::STATE = Workspace::STATE [static] |
Flag that marks a variable as a state.
Definition at line 83 of file default_gui_model.h.
const IO::flags_t DefaultGUIModel::UINTEGER = Workspace::COMMENT<<3 [static] |
Flag that marks a parameter as being of unsigned integer type.
Definition at line 107 of file default_gui_model.h.