Eclipse SUMO - Simulation of Urban MObility
|
A window containing a gl-object's parameter. More...
#include <GUIParameterTableWindow.h>
Public Member Functions | |
void | checkFont (const std::string &text) |
ensure that the font covers the given text | |
void | closeBuilding (const Parameterised *p=0) |
Closes the building of the table. | |
GUIParameterTableWindow (GUIMainWindow &app, GUIGlObject &o, const std::string &title="") | |
Constructor. | |
void | loadWindowPos () |
void | removeObject (GUIGlObject *const o) |
Lets this window know the object shown is being deleted. | |
void | saveWindowPos () |
~GUIParameterTableWindow () | |
Destructor. | |
Row adding functions | |
template<class T > | |
void | mkItem (const char *name, bool dynamic, ValueSource< T > *src) |
Adds a row which obtains its value from a 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, int value) |
Adds a row which shows a integer-value. | |
void | mkItem (const char *name, bool dynamic, long long int value) |
Adds a row which shows a 64 bit integer-value. | |
void | mkItem (const char *name, bool dynamic, double value) |
Adds a row which shows a double-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. | |
long | onLeftBtnPress (FXObject *, FXSelector, void *) |
directly opens tracker when clicking on last column | |
Static Public Member Functions | |
static void | updateAll () |
Updates all instances. | |
Protected Member Functions | |
void | updateTable () |
Updates the table. | |
Protected Attributes | |
int | myDefaultHeight |
int | myDefaultWidth |
int | myDefaultX |
int | myDefaultY |
int | myMinSize |
int | myMinTitlebarHeight |
FXWindow * | myParent |
The window for which the position is being stored. | |
bool | myStoreSize |
whether window size shall be stored | |
std::string | myWindowName |
Name for storing in the registry. | |
Static Protected Attributes | |
static std::vector< GUIParameterTableWindow * > | myContainer |
The container of items that shall be updated. | |
static FXMutex | myGlobalContainerLock |
The mutex used to avoid concurrent updates of the instance container. | |
Static Private Member Functions | |
static int | numParams (const GUIGlObject *obj) |
returns the number of parameters if obj is Parameterised and 0 otherwise | |
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. | |
FXMutex | myLock |
A lock assuring save updates in case of object deletion. | |
GUIGlObject * | myObject |
The object to get the information from. | |
FXTable * | myTable |
The table to display the information in. | |
int | myTrackerY |
y-position for opening new tracker window | |
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 61 of file GUIParameterTableWindow.h.
GUIParameterTableWindow::GUIParameterTableWindow | ( | GUIMainWindow & | app, |
GUIGlObject & | o, | ||
const std::string & | title = "" |
||
) |
Constructor.
[in] | app | The application this window belongs to |
[in] | o | The gl-object this table describes |
Definition at line 65 of file GUIParameterTableWindow.cpp.
References GUIGlObject::addParameterTable(), APP_TABLE, GUIIconSubSys::getIcon(), GUIPersistentWindowPos::loadWindowPos(), MID_TABLE, myContainer, myGlobalContainerLock, myLock, myObject, myTable, and TL.
GUIParameterTableWindow::~GUIParameterTableWindow | ( | ) |
Destructor.
Definition at line 98 of file GUIParameterTableWindow.cpp.
References myApplication, myContainer, myGlobalContainerLock, myItems, myLock, myObject, GUIMainWindow::removeChild(), and GUIGlObject::removeParameterTable().
void GUIParameterTableWindow::checkFont | ( | const std::string & | text | ) |
ensure that the font covers the given text
Definition at line 280 of file GUIParameterTableWindow.cpp.
References GUIMainWindow::getFallbackFont(), myApplication, and myTable.
Referenced by GUILane::getParameterWindow().
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 252 of file GUIParameterTableWindow.cpp.
References GUIMainWindow::addChild(), Parameterised::getParametersMap(), MAX2(), mkItem(), myApplication, myItems, myObject, and myTable.
Referenced by GUIBusStop::getParameterWindow(), GUICalibrator::getParameterWindow(), GUIChargingStation::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIJunctionWrapper::getParameterWindow(), GUILaneSpeedTrigger::getParameterWindow(), GUIOverheadWire::getParameterWindow(), GUIOverheadWireClamp::getParameterWindow(), GUIParkingArea::getParameterWindow(), GUITrafficLightLogicWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GNEAdditional::getParameterWindow(), GNEGenericData::getParameterWindow(), GNEDemandElement::getParameterWindow(), GNEInternalLane::getParameterWindow(), GNENetworkElement::getParameterWindow(), GNENet::getParameterWindow(), GUIContainer::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GUIEdge::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), GUILane::getParameterWindow(), GUINet::getParameterWindow(), GUIPerson::getParameterWindow(), GUIPointOfInterest::getParameterWindow(), GUIPolygon::getParameterWindow(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), GUIContainer::getTypeParameterWindow(), GUIEdge::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIContainer::GUIContainerPopupMenu::onCmdShowPlan(), and GUIPerson::GUIPersonPopupMenu::onCmdShowPlan().
|
inherited |
Definition at line 84 of file GUIPersistentWindowPos.cpp.
References MAX2(), MIN2(), GUIPersistentWindowPos::myDefaultHeight, GUIPersistentWindowPos::myDefaultWidth, GUIPersistentWindowPos::myDefaultX, GUIPersistentWindowPos::myDefaultY, GUIPersistentWindowPos::myMinSize, GUIPersistentWindowPos::myMinTitlebarHeight, GUIPersistentWindowPos::myParent, GUIPersistentWindowPos::myStoreSize, and GUIPersistentWindowPos::myWindowName.
Referenced by GUIParameterTableWindow().
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 208 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 224 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 232 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 200 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 216 of file GUIParameterTableWindow.cpp.
References myCurrentPos, myItems, and myTable.
|
inline |
Adds a row which obtains its value from a 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 107 of file GUIParameterTableWindow.h.
References myCurrentPos, myItems, and myTable.
Referenced by closeBuilding(), GUIBusStop::getParameterWindow(), GUICalibrator::getParameterWindow(), GUIChargingStation::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIJunctionWrapper::getParameterWindow(), GUILaneSpeedTrigger::getParameterWindow(), GUIOverheadWire::getParameterWindow(), GUIParkingArea::getParameterWindow(), GUITrafficLightLogicWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GNEAdditional::getParameterWindow(), GNEGenericData::getParameterWindow(), GNEDemandElement::getParameterWindow(), GNENetworkElement::getParameterWindow(), GUIContainer::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GUIEdge::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), GUILane::getParameterWindow(), GUINet::getParameterWindow(), GUIPerson::getParameterWindow(), GUIPointOfInterest::getParameterWindow(), GUIPolygon::getParameterWindow(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), GUIContainer::getTypeParameterWindow(), GUIEdge::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIContainer::GUIContainerPopupMenu::onCmdShowPlan(), and GUIPerson::GUIPersonPopupMenu::onCmdShowPlan().
|
staticprivate |
returns the number of parameters if obj is Parameterised and 0 otherwise
Definition at line 298 of file GUIParameterTableWindow.cpp.
References Parameterised::getParametersMap().
long GUIParameterTableWindow::onLeftBtnPress | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | eventData | ||
) |
directly opens tracker when clicking on last column
Definition at line 144 of file GUIParameterTableWindow.cpp.
References GUIParameterTracker::addTracked(), GUIParameterTracker::addTrackedMultiplot(), RGBColor::BLACK, GUIParameterTracker::create(), GUIParameterTableItemInterface::dynamic(), GUIMainWindow::getCurrentSimTime(), GUIParameterTableItemInterface::getdoubleSourceCopy(), GUIGlObject::getFullName(), GUIParameterTableItemInterface::getName(), GUIMainWindow::getTrackerInterval(), myApplication, myItems, myObject, myTable, and myTrackerY.
Referenced by FXDEFMAP().
long GUIParameterTableWindow::onRightButtonPress | ( | FXObject * | , |
FXSelector | , | ||
void * | eventData | ||
) |
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 169 of file GUIParameterTableWindow.cpp.
References GUIDesigns::buildFXMenuCommand(), GUIParameterTableItemInterface::dynamic(), GUIParameterTableItemInterface::getdoubleSourceCopy(), GUIParameterTableItemInterface::getName(), MID_OPENTRACKER, myApplication, myItems, myObject, myTable, and TL.
Referenced by FXDEFMAP().
long GUIParameterTableWindow::onSimStep | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Updates the table due to a simulation step.
Definition at line 124 of file GUIParameterTableWindow.cpp.
References updateTable().
Referenced by FXDEFMAP().
long GUIParameterTableWindow::onTableDeselected | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Does nothing.
Definition at line 139 of file GUIParameterTableWindow.cpp.
Referenced by FXDEFMAP().
long GUIParameterTableWindow::onTableSelected | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Does nothing.
Definition at line 133 of file GUIParameterTableWindow.cpp.
Referenced by FXDEFMAP().
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 117 of file GUIParameterTableWindow.cpp.
|
inherited |
Definition at line 71 of file GUIPersistentWindowPos.cpp.
References GUIPersistentWindowPos::myParent, GUIPersistentWindowPos::myStoreSize, and GUIPersistentWindowPos::myWindowName.
Referenced by GUIDialog_ViewSettings::hide(), and GUIPersistentWindowPos::~GUIPersistentWindowPos().
|
inlinestatic |
Updates all instances.
Definition at line 201 of file GUIParameterTableWindow.h.
References myContainer, and myGlobalContainerLock.
|
protected |
Updates the table.
Goes through all entries and updates them using GUIParameterTableItemInterface::update.
Definition at line 240 of file GUIParameterTableWindow.cpp.
References myItems, myLock, and myObject.
Referenced by onSimStep().
|
private |
The main application window.
Definition at line 231 of file GUIParameterTableWindow.h.
Referenced by checkFont(), closeBuilding(), onLeftBtnPress(), onRightButtonPress(), and ~GUIParameterTableWindow().
|
staticprotected |
The container of items that shall be updated.
Definition at line 221 of file GUIParameterTableWindow.h.
Referenced by GUIParameterTableWindow(), updateAll(), and ~GUIParameterTableWindow().
|
private |
|
protectedinherited |
Definition at line 65 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 64 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 61 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 62 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
staticprotected |
The mutex used to avoid concurrent updates of the instance container.
Definition at line 218 of file GUIParameterTableWindow.h.
Referenced by GUIParameterTableWindow(), updateAll(), and ~GUIParameterTableWindow().
|
private |
The list of table rows.
Definition at line 234 of file GUIParameterTableWindow.h.
Referenced by closeBuilding(), mkItem(), mkItem(), mkItem(), mkItem(), mkItem(), mkItem(), onLeftBtnPress(), onRightButtonPress(), updateTable(), and ~GUIParameterTableWindow().
|
mutableprivate |
A lock assuring save updates in case of object deletion.
Definition at line 243 of file GUIParameterTableWindow.h.
Referenced by GUIParameterTableWindow(), removeObject(), updateTable(), and ~GUIParameterTableWindow().
|
protectedinherited |
Definition at line 67 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 68 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
private |
The object to get the information from.
Definition at line 225 of file GUIParameterTableWindow.h.
Referenced by closeBuilding(), GUIParameterTableWindow(), onLeftBtnPress(), onRightButtonPress(), removeObject(), updateTable(), and ~GUIParameterTableWindow().
|
protectedinherited |
The window for which the position is being stored.
Definition at line 53 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().
|
protectedinherited |
whether window size shall be stored
Definition at line 59 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().
|
private |
The table to display the information in.
Definition at line 228 of file GUIParameterTableWindow.h.
Referenced by checkFont(), closeBuilding(), GUIParameterTableWindow(), mkItem(), mkItem(), mkItem(), mkItem(), mkItem(), mkItem(), onLeftBtnPress(), and onRightButtonPress().
|
private |
y-position for opening new tracker window
Definition at line 237 of file GUIParameterTableWindow.h.
Referenced by onLeftBtnPress().
|
protectedinherited |
Name for storing in the registry.
Definition at line 56 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().