![]() |
SUMO - Simulation of Urban MObility
|
A window containing a gl-object's parameter. More...
#include <GUIParameterTableWindow.h>


Public Member Functions | |
| void | closeBuilding (const Parameterised *p=0) |
| Closes the building of the table. More... | |
| GUIParameterTableWindow (GUIMainWindow &app, GUIGlObject &o, int noRows) | |
| Constructor. More... | |
| void | removeObject (GUIGlObject *const o) |
| Lets this window know the object shown is being deleted. More... | |
| ~GUIParameterTableWindow () | |
| Destructor. More... | |
Row adding functions | |
| void | mkItem (const char *name, bool dynamic, ValueSource< unsigned > *src) |
| Adds a row which obtains its value from an unsigned-ValueSource. More... | |
| void | mkItem (const char *name, bool dynamic, ValueSource< int > *src) |
| Adds a row which obtains its value from an integer-ValueSource. More... | |
| void | mkItem (const char *name, bool dynamic, ValueSource< double > *src) |
| Adds a row which obtains its value from an double-ValueSource. More... | |
| void | mkItem (const char *name, bool dynamic, std::string value) |
| Adds a row which shows a string-value. More... | |
| void | mkItem (const char *name, bool dynamic, unsigned value) |
| Adds a row which shows a unsigned-value. More... | |
| void | mkItem (const char *name, bool dynamic, int value) |
| Adds a row which shows a integer-value. More... | |
| void | mkItem (const char *name, bool dynamic, long long int value) |
| Adds a row which shows a 64 bit integer-value. More... | |
| void | mkItem (const char *name, bool dynamic, double value) |
| Adds a row which shows a double-value. More... | |
FOX-callbacks | |
| long | onSimStep (FXObject *, FXSelector, void *) |
| Updates the table due to a simulation step. More... | |
| long | onTableSelected (FXObject *, FXSelector, void *) |
| Does nothing. More... | |
| long | onTableDeselected (FXObject *, FXSelector, void *) |
| Does nothing. More... | |
| long | onRightButtonPress (FXObject *, FXSelector, void *) |
| Shows a popup. More... | |
Static Public Member Functions | |
| static void | updateAll () |
| Updates all instances. More... | |
Protected Member Functions | |
| GUIParameterTableWindow () | |
| FOX needs this. More... | |
| void | updateTable () |
| Updates the table. More... | |
Static Protected Attributes | |
| static std::vector< GUIParameterTableWindow * > | myContainer |
| The container of items that shall be updated. More... | |
| static MFXMutex | myGlobalContainerLock |
| The mutex used to avoid concurrent updates of the instance container. More... | |
Static Private Member Functions | |
| static int | numParams (const GUIGlObject *obj) |
| returns the number of parameters if obj is Parameterised and 0 otherwise More... | |
Private Attributes | |
| GUIMainWindow * | myApplication |
| The main application window. More... | |
| unsigned | myCurrentPos |
| The index of the next row to add - used while building. More... | |
| std::vector< GUIParameterTableItemInterface * > | myItems |
| The list of table rows. More... | |
| MFXMutex | myLock |
| A lock assuring save updates in case of object deletion. More... | |
| GUIGlObject * | myObject |
| The object to get the information from. More... | |
| FXTable * | myTable |
| The table to display the information in. More... | |
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 70 of file GUIParameterTableWindow.h.
| GUIParameterTableWindow::GUIParameterTableWindow | ( | GUIMainWindow & | app, |
| GUIGlObject & | o, | ||
| int | 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 69 of file GUIParameterTableWindow.cpp.
References GUIIconSubSys::getIcon(), ICON_APP_TABLE, and MID_TABLE.
| GUIParameterTableWindow::~GUIParameterTableWindow | ( | ) |
Destructor.
Definition at line 100 of file GUIParameterTableWindow.cpp.
References MFXMutex::lock(), myApplication, myContainer, myGlobalContainerLock, myItems, myLock, myObject, GUIMainWindow::removeChild(), GUIGlObject::removeParameterTable(), and MFXMutex::unlock().
|
inlineprotected |
FOX needs this.
Definition at line 263 of file GUIParameterTableWindow.h.
| void GUIParameterTableWindow::closeBuilding | ( | const Parameterised * | p = 0 | ) |
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 255 of file GUIParameterTableWindow.cpp.
References GUIMainWindow::addChild(), Parameterised::getMap(), mkItem(), myApplication, and myObject.
Referenced by GNEInternalLane::getParameterWindow(), GUITrafficLightLogicWrapper::getParameterWindow(), GUIContainer::getParameterWindow(), GNECrossing::getParameterWindow(), GUIPerson::getParameterWindow(), GUIPolygon::getParameterWindow(), GUILaneSpeedTrigger::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUICalibrator::getParameterWindow(), GUIPointOfInterest::getParameterWindow(), GNELane::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUIContainerStop::getParameterWindow(), GUIChargingStation::getParameterWindow(), GUIBusStop::getParameterWindow(), GUIParkingArea::getParameterWindow(), GUIEdge::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), GUINet::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GNEAdditional::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), GUILane::getParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), and GUIVehicle::getTypeParameterWindow().
| 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 178 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
Referenced by closeBuilding(), GUITrafficLightLogicWrapper::getParameterWindow(), GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), GUIPolygon::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUILaneSpeedTrigger::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIPointOfInterest::getParameterWindow(), GUICalibrator::getParameterWindow(), GNELane::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUIChargingStation::getParameterWindow(), GUIContainerStop::getParameterWindow(), GUIBusStop::getParameterWindow(), GUIParkingArea::getParameterWindow(), GUIEdge::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), GUINet::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), GNEAdditional::getParameterWindow(), GUILane::getParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), and GUIVehicle::getTypeParameterWindow().
| void GUIParameterTableWindow::mkItem | ( | const char * | name, |
| bool | dynamic, | ||
| ValueSource< int > * | src | ||
| ) |
Adds a row which obtains its value from an integer-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 186 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
| void GUIParameterTableWindow::mkItem | ( | const char * | name, |
| bool | dynamic, | ||
| ValueSource< double > * | src | ||
| ) |
Adds a row which obtains its value from an double-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 194 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 202 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 219 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
| void GUIParameterTableWindow::mkItem | ( | const char * | name, |
| bool | dynamic, | ||
| int | value | ||
| ) |
Adds a row which shows a integer-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 227 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
| void GUIParameterTableWindow::mkItem | ( | const char * | name, |
| bool | dynamic, | ||
| long long int | value | ||
| ) |
Adds a row which shows a 64 bit integer-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 235 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
| void GUIParameterTableWindow::mkItem | ( | const char * | name, |
| bool | dynamic, | ||
| double | value | ||
| ) |
Adds a row which shows a double-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 211 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
|
staticprivate |
returns the number of parameters if obj is Parameterised and 0 otherwise
Definition at line 272 of file GUIParameterTableWindow.cpp.
References Parameterised::getMap().
| long GUIParameterTableWindow::onRightButtonPress | ( | FXObject * | sender, |
| FXSelector | sel, | ||
| void * | data | ||
| ) |
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 147 of file GUIParameterTableWindow.cpp.
References GUIParameterTableItemInterface::dynamic(), GUIParameterTableItemInterface::getdoubleSourceCopy(), GUIParameterTableItemInterface::getName(), MID_OPENTRACKER, myApplication, myItems, myObject, and myTable.
| long GUIParameterTableWindow::onSimStep | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Updates the table due to a simulation step.
Definition at line 126 of file GUIParameterTableWindow.cpp.
References updateTable().
| long GUIParameterTableWindow::onTableDeselected | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Does nothing.
Definition at line 141 of file GUIParameterTableWindow.cpp.
| long GUIParameterTableWindow::onTableSelected | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Does nothing.
Definition at line 135 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 119 of file GUIParameterTableWindow.cpp.
|
inlinestatic |
Updates all instances.
Definition at line 219 of file GUIParameterTableWindow.h.
References myContainer, myGlobalContainerLock, and updateTable().
|
protected |
Updates the table.
Goes through all entries and updates them using GUIParameterTableItemInterface::update.
Definition at line 243 of file GUIParameterTableWindow.cpp.
References myItems, myLock, and myObject.
Referenced by onSimStep(), and updateAll().
|
private |
The main application window.
Definition at line 247 of file GUIParameterTableWindow.h.
Referenced by closeBuilding(), onRightButtonPress(), and ~GUIParameterTableWindow().
|
staticprotected |
The container of items that shall be updated.
Definition at line 237 of file GUIParameterTableWindow.h.
Referenced by updateAll(), and ~GUIParameterTableWindow().
|
private |
The index of the next row to add - used while building.
Definition at line 253 of file GUIParameterTableWindow.h.
Referenced by mkItem().
|
staticprotected |
The mutex used to avoid concurrent updates of the instance container.
Definition at line 234 of file GUIParameterTableWindow.h.
Referenced by updateAll(), and ~GUIParameterTableWindow().
|
private |
The list of table rows.
Definition at line 250 of file GUIParameterTableWindow.h.
Referenced by mkItem(), onRightButtonPress(), updateTable(), and ~GUIParameterTableWindow().
|
mutableprivate |
A lock assuring save updates in case of object deletion.
Definition at line 256 of file GUIParameterTableWindow.h.
Referenced by removeObject(), updateTable(), and ~GUIParameterTableWindow().
|
private |
The object to get the information from.
Definition at line 241 of file GUIParameterTableWindow.h.
Referenced by closeBuilding(), onRightButtonPress(), removeObject(), updateTable(), and ~GUIParameterTableWindow().
|
private |
The table to display the information in.
Definition at line 244 of file GUIParameterTableWindow.h.
Referenced by mkItem(), and onRightButtonPress().