SUMO - Simulation of Urban MObility
|
A window containing a gl-object's parameter. More...
#include <GUIParameterTableWindow.h>
Public Member Functions | |
void | closeBuilding () |
Closes the building of the table. | |
GUIParameterTableWindow (GUIMainWindow &app, GUIGlObject &o, size_t noRows) | |
Constructor. | |
void | removeObject (GUIGlObject *const o) |
Lets this window know the object shown is being deleted. | |
~GUIParameterTableWindow () | |
Destructor. | |
Row adding functions | |
void | mkItem (const char *name, bool dynamic, ValueSource< unsigned > *src) |
Adds a row which obtains its value from an unsigned-ValueSource. | |
void | mkItem (const char *name, bool dynamic, ValueSource< SUMOReal > *src) |
Adds a row which obtains its value from an SUMOReal-ValueSource. | |
void | mkItem (const char *name, bool dynamic, ValueSource< SUMOTime > *src) |
Adds a row which obtains its value from an SUMOTime-ValueSource. | |
void | mkItem (const char *name, bool dynamic, std::string value) |
Adds a row which shows a string-value. | |
void | mkItem (const char *name, bool dynamic, unsigned value) |
Adds a row which shows a unsigned-value. | |
void | mkItem (const char *name, bool dynamic, SUMOReal value) |
Adds a row which shows a SUMOReal-value. | |
void | mkItem (const char *name, bool dynamic, SUMOTime value) |
Adds a row which shows a SUMOTime-value. | |
FOX-callbacks | |
long | onSimStep (FXObject *, FXSelector, void *) |
Updates the table due to a simulation step. | |
long | onTableSelected (FXObject *, FXSelector, void *) |
Does nothing. | |
long | onTableDeselected (FXObject *, FXSelector, void *) |
Does nothing. | |
long | onRightButtonPress (FXObject *, FXSelector, void *) |
Shows a popup. |
Protected Member Functions | |
GUIParameterTableWindow () | |
FOX needs this. | |
void | updateTable () |
Updates the table. |
Private Attributes | |
GUIMainWindow * | myApplication |
The main application window. | |
unsigned | myCurrentPos |
The index of the next row to add - used while building. | |
std::vector < GUIParameterTableItemInterface * > | myItems |
The list of table rows. | |
MFXMutex | myLock |
A lock assuring save updates in cse of object deletion. | |
GUIGlObject * | myObject |
The object to get the information from. | |
FXTable * | myTable |
The table to display the information in. |
A window containing a gl-object's parameter.
This class realises a view on some parameter of a gl-object. The gl-object itself is responsible for filling this table.
After allocating such a table, the object should fill the rows by calling one of the mkItem-methods for each. The building is closed using closeBuilding what forces the table to be displayed.
Each row is represented using an instance of GUIParameterTableItemInterface.
Definition at line 66 of file GUIParameterTableWindow.h.
GUIParameterTableWindow::GUIParameterTableWindow | ( | GUIMainWindow & | app, |
GUIGlObject & | o, | ||
size_t | noRows | ||
) |
Constructor.
[in] | app | The application this window belongs to |
[in] | o | The gl-object this table describes |
[in] | noRows | Number of rows to allocate |
Definition at line 65 of file GUIParameterTableWindow.cpp.
References GUIIconSubSys::getIcon(), ICON_APP_TABLE, and MID_TABLE.
GUIParameterTableWindow::~GUIParameterTableWindow | ( | ) |
Destructor.
Definition at line 94 of file GUIParameterTableWindow.cpp.
References MFXMutex::lock(), myApplication, myItems, myLock, myObject, GUIMainWindow::removeChild(), GUIGlObject::removeParameterTable(), and MFXMutex::unlock().
|
inlineprotected |
FOX needs this.
Definition at line 237 of file GUIParameterTableWindow.h.
void GUIParameterTableWindow::closeBuilding | ( | ) |
Closes the building of the table.
Adds the table to the list of child windows of the applications also telling the application that the window should be updated in each simulation step. Shows the table.
Definition at line 239 of file GUIParameterTableWindow.cpp.
References GUIMainWindow::addChild(), and myApplication.
Referenced by GUILaneSpeedTrigger::getParameterWindow(), GUILaneWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUI_E2_ZS_CollectorOverLanes::MyWrapper::getParameterWindow(), GUI_E2_ZS_Collector::MyWrapper::getParameterWindow(), GUIEdge::getParameterWindow(), GUINet::getParameterWindow(), and GUIInductLoop::MyWrapper::getParameterWindow().
void GUIParameterTableWindow::mkItem | ( | const char * | name, |
bool | dynamic, | ||
ValueSource< unsigned > * | src | ||
) |
Adds a row which obtains its value from an unsigned-ValueSource.
[in] | name | The name of the row entry |
[in] | dynamic | Information whether the entry is dynamic |
[in] | src | The value source to use |
Definition at line 164 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
Referenced by GUILaneSpeedTrigger::getParameterWindow(), GUILaneWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUI_E2_ZS_CollectorOverLanes::MyWrapper::getParameterWindow(), GUI_E2_ZS_Collector::MyWrapper::getParameterWindow(), GUIEdge::getParameterWindow(), GUINet::getParameterWindow(), and GUIInductLoop::MyWrapper::getParameterWindow().
void GUIParameterTableWindow::mkItem | ( | const char * | name, |
bool | dynamic, | ||
ValueSource< SUMOReal > * | src | ||
) |
Adds a row which obtains its value from an SUMOReal-ValueSource.
[in] | name | The name of the row entry |
[in] | dynamic | Information whether the entry is dynamic |
[in] | src | The value source to use |
Definition at line 172 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
void GUIParameterTableWindow::mkItem | ( | const char * | name, |
bool | dynamic, | ||
ValueSource< SUMOTime > * | src | ||
) |
Adds a row which obtains its value from an SUMOTime-ValueSource.
[in] | name | The name of the row entry |
[in] | dynamic | Information whether the entry is dynamic |
[in] | src | The value source to use |
Definition at line 181 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
void GUIParameterTableWindow::mkItem | ( | const char * | name, |
bool | dynamic, | ||
std::string | value | ||
) |
Adds a row which shows a string-value.
[in] | name | The name of the row entry |
[in] | dynamic | Information whether the entry is dynamic |
[in] | value | The value to show |
Definition at line 190 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
void GUIParameterTableWindow::mkItem | ( | const char * | name, |
bool | dynamic, | ||
unsigned | value | ||
) |
Adds a row which shows a unsigned-value.
[in] | name | The name of the row entry |
[in] | dynamic | Information whether the entry is dynamic |
[in] | value | The value to show |
Definition at line 207 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
Adds a row which shows a SUMOReal-value.
[in] | name | The name of the row entry |
[in] | dynamic | Information whether the entry is dynamic |
[in] | value | The value to show |
Definition at line 199 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
Adds a row which shows a SUMOTime-value.
[in] | name | The name of the row entry |
[in] | dynamic | Information whether the entry is dynamic |
[in] | value | The value to show |
Definition at line 216 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
Shows a popup.
Callback for right-mouse-button pressing event. Obtains the selected row and determines whether it is dynamic. If so, a popup-menu which allows to open a tracker for this value is built and shown.
Definition at line 136 of file GUIParameterTableWindow.cpp.
References GUIParameterTableItemInterface::dynamic(), GUIParameterTableItemInterface::getName(), GUIParameterTableItemInterface::getSUMORealSourceCopy(), MID_OPENTRACKER, myApplication, myItems, myObject, and myTable.
Updates the table due to a simulation step.
Definition at line 116 of file GUIParameterTableWindow.cpp.
References updateTable().
Does nothing.
Definition at line 130 of file GUIParameterTableWindow.cpp.
Does nothing.
Definition at line 124 of file GUIParameterTableWindow.cpp.
void GUIParameterTableWindow::removeObject | ( | GUIGlObject *const | o | ) |
Lets this window know the object shown is being deleted.
[in] | o | The deleted (shown) object |
Definition at line 108 of file GUIParameterTableWindow.cpp.
References MFXMutex::lock(), myLock, myObject, and MFXMutex::unlock().
|
protected |
Updates the table.
Goes through all entries and updates them using GUIParameterTableItemInterface::update.
Definition at line 225 of file GUIParameterTableWindow.cpp.
References MFXMutex::lock(), myItems, myLock, myObject, and MFXMutex::unlock().
Referenced by onSimStep().
|
private |
The main application window.
Definition at line 224 of file GUIParameterTableWindow.h.
Referenced by closeBuilding(), onRightButtonPress(), and ~GUIParameterTableWindow().
|
private |
The index of the next row to add - used while building.
Definition at line 230 of file GUIParameterTableWindow.h.
Referenced by mkItem().
|
private |
The list of table rows.
Definition at line 227 of file GUIParameterTableWindow.h.
Referenced by mkItem(), onRightButtonPress(), updateTable(), and ~GUIParameterTableWindow().
|
mutableprivate |
A lock assuring save updates in cse of object deletion.
Definition at line 233 of file GUIParameterTableWindow.h.
Referenced by removeObject(), updateTable(), and ~GUIParameterTableWindow().
|
private |
The object to get the information from.
Definition at line 218 of file GUIParameterTableWindow.h.
Referenced by onRightButtonPress(), removeObject(), updateTable(), and ~GUIParameterTableWindow().
|
private |
The table to display the information in.
Definition at line 221 of file GUIParameterTableWindow.h.
Referenced by mkItem(), and onRightButtonPress().