RTXI 1.3
DefaultGUIModel Class Reference

#include <default_gui_model.h>

Inheritance diagram for DefaultGUIModel:
RT::Thread Plugin::Object Workspace::Instance Event::Handler RT::List< T >::Node Settings::Object IO::Block Settings::Object FIRwindow IIRfilter Mimic MyPlugin MyPluginGUI Neuron NoiseGen SigGen Synch WaveMaker

List of all members.

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_tparameter

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)

Detailed Description

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

Definition at line 53 of file default_gui_model.h.


Member Typedef Documentation

Structure used to pass variable information to the constructor

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

Definition at line 115 of file default_gui_model.h.


Member Enumeration Documentation

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 122 of file default_gui_model.h.


Constructor & Destructor Documentation

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.

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

Definition at line 65 of file default_gui_model.cpp.

DefaultGUIModel::~DefaultGUIModel ( void  ) [virtual]

Definition at line 77 of file default_gui_model.cpp.


Member Function Documentation

void DefaultGUIModel::createGUI ( DefaultGUIModel::variable_t var,
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

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.

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

Definition at line 220 of file default_gui_model.cpp.

void DefaultGUIModel::modify ( void  ) [slot]

Function that calls DefaultGUIModel::update with the MODIFY flag

See also:
DefaultGUIModel::update_flags_t

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.

See also:
DefaultGUIModel::update_flags_t

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().

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

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.

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

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.

Parameters:
nameThe parameter's name.
valueThe 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().

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

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.

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

Reimplemented in MyPlugin, MyPluginGUI, FIRwindow, IIRfilter, Mimic, Neuron, NoiseGen, SigGen, Synch, and WaveMaker.

Definition at line 155 of file default_gui_model.cpp.


Member Data Documentation

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

Flag that marks a variable as a comment.

See also:
Workspace::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.

See also:
Workspace::STATE

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.

See also:
Workspace::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.

See also:
Workspace::OUTPUT

Definition at line 71 of file default_gui_model.h.

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.

See also:
Workspace::PARAMETER

Definition at line 77 of file default_gui_model.h.

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.

See also:
Workspace::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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines