![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Instance of a single line in a parameter window. More...
#include <GUIParameterTableItem.h>
Public Member Functions | |
bool | dynamic () const |
Returns the information whether this item may change over time. More... | |
ValueSource< double > * | getdoubleSourceCopy () const |
Returns a double-typed copy of the source if the value is dynamic. More... | |
const std::string & | getName () const |
Returns the name of this value. More... | |
ValueSource< T > * | getSourceCopy () const |
Returns a copy of the source if the value is dynamic. More... | |
GUIParameterTableItem (FXTable *table, unsigned pos, const std::string &name, bool dynamic, ValueSource< T > *src) | |
Constructor for changing (dynamic) values. More... | |
GUIParameterTableItem (FXTable *table, unsigned pos, const std::string &name, bool dynamic, T value) | |
Constructor for non-changing (static) values. More... | |
void | init (bool dynamic, std::string value) |
Initialises the line. More... | |
void | update () |
Resets the value if it's dynamic. More... | |
~GUIParameterTableItem () | |
Destructor. More... | |
Private Attributes | |
bool | myAmDynamic |
Information whether the value may change. More... | |
std::string | myName |
The name of this value. More... | |
ValueSource< T > * | mySource |
The source to gain new values from; this source is==0 if the values are not dynamic. More... | |
FXTable * | myTable |
The table this entry belongs to. More... | |
FXint | myTablePosition |
The position within the table. More... | |
T | myValue |
A backup of the value to avoid the redrawing when nothing has changed. More... | |
Instance of a single line in a parameter window.
This class represents a single item of a parameter table and is an implementation of the GUIParameterTableItemInterface that allows different value-types.
As some values may change over the simulation, this class holds the information whether they change and how to ask for new values if they do.
Definition at line 99 of file GUIParameterTableItem.h.
|
inline |
Constructor for changing (dynamic) values.
[in] | table | The table this item belongs to |
[in] | pos | The row of the table this item fills |
[in] | name | The name of the represented value |
[in] | dynamic | Information whether this value changes over time |
[in] | src | The value source |
Consider using a reference to the table
Check whether the name should be stored in GUIParameterTableItemInterface
Definition at line 111 of file GUIParameterTableItem.h.
References ValueSource< T >::getValue().
|
inline |
Constructor for non-changing (static) values.
[in] | table | The table this item belongs to |
[in] | pos | The row of the table this item fills |
[in] | name | The name of the represented value |
[in] | dynamic | Information whether this value changes over time |
[in] | value | The value |
Consider using a reference to the table
Check whether the name should be stored in GUIParameterTableItemInterface
Should never be dynamic!?
Definition at line 129 of file GUIParameterTableItem.h.
|
inline |
Destructor.
Definition at line 137 of file GUIParameterTableItem.h.
|
inlinevirtual |
Returns the information whether this item may change over time.
Implements GUIParameterTableItemInterface.
Definition at line 161 of file GUIParameterTableItem.h.
|
inlinevirtual |
Returns a double-typed copy of the source if the value is dynamic.
Implements GUIParameterTableItemInterface.
Definition at line 197 of file GUIParameterTableItem.h.
References ValueSource< T >::makedoubleReturningCopy().
|
inlinevirtual |
Returns the name of this value.
Implements GUIParameterTableItemInterface.
Definition at line 166 of file GUIParameterTableItem.h.
|
inline |
Returns a copy of the source if the value is dynamic.
Definition at line 189 of file GUIParameterTableItem.h.
|
inline |
Initialises the line.
Fills the line using the name, the current value, and the information whether the value changes over time.
[in] | dynamic | Information whether this value changes over time |
[in] | value | The current (initial) value |
Definition at line 149 of file GUIParameterTableItem.h.
References GUIIconSubSys::getIcon(), ICON_NO, and ICON_YES.
|
inlinevirtual |
Resets the value if it's dynamic.
If the value is dynamic, the current value is retrieved from the value source. If it is different from the previous one (stored in myValue), it is stored in myValue and set as the current value text within the according table cell.
Implements GUIParameterTableItemInterface.
Definition at line 177 of file GUIParameterTableItem.h.
References GUIParameterTableItemInterface::dynamic().
|
private |
Information whether the value may change.
Definition at line 206 of file GUIParameterTableItem.h.
|
private |
The name of this value.
Definition at line 209 of file GUIParameterTableItem.h.
|
private |
The source to gain new values from; this source is==0 if the values are not dynamic.
Definition at line 215 of file GUIParameterTableItem.h.
|
private |
The table this entry belongs to.
Definition at line 221 of file GUIParameterTableItem.h.
|
private |
The position within the table.
Definition at line 212 of file GUIParameterTableItem.h.
|
private |
A backup of the value to avoid the redrawing when nothing has changed.
Definition at line 218 of file GUIParameterTableItem.h.