Eclipse SUMO - Simulation of Urban MObility
GUIParameterTableWindow Class Reference

A window containing a gl-object's parameter. More...

#include <GUIParameterTableWindow.h>

Inheritance diagram for GUIParameterTableWindow:
[legend]
Collaboration diagram for GUIParameterTableWindow:
[legend]

Public Member Functions

void closeBuilding (const Parameterised *p=0)
 Closes the building of the table. More...
 
 GUIParameterTableWindow (GUIMainWindow &app, GUIGlObject &o)
 Constructor. More...
 
void removeObject (GUIGlObject *const o)
 Lets this window know the object shown is being deleted. More...
 
 ~GUIParameterTableWindow ()
 Destructor. More...
 
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. 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...
 
long onLeftBtnPress (FXObject *, FXSelector, void *)
 directly opens tracker when clicking on last column More...
 

Static Public Member Functions

static void updateAll ()
 Updates all instances. More...
 

Protected Member Functions

void updateTable ()
 Updates the table. More...
 

Static Protected Attributes

static std::vector< GUIParameterTableWindow * > myContainer
 The container of items that shall be updated. More...
 
static FXMutex 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

GUIMainWindowmyApplication
 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...
 
FXMutex myLock
 A lock assuring save updates in case of object deletion. More...
 
GUIGlObjectmyObject
 The object to get the information from. More...
 
FXTable * myTable
 The table to display the information in. More...
 
int myTrackerY
 y-position for opening new tracker window More...
 

Detailed Description

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 60 of file GUIParameterTableWindow.h.

Constructor & Destructor Documentation

◆ GUIParameterTableWindow()

GUIParameterTableWindow::GUIParameterTableWindow ( GUIMainWindow app,
GUIGlObject o 
)

Constructor.

Parameters
[in]appThe application this window belongs to
[in]oThe gl-object this table describes

Definition at line 63 of file GUIParameterTableWindow.cpp.

References GUIGlObject::addParameterTable(), APP_TABLE, GUIIconSubSys::getIcon(), MID_TABLE, myContainer, myGlobalContainerLock, myLock, myObject, and myTable.

◆ ~GUIParameterTableWindow()

GUIParameterTableWindow::~GUIParameterTableWindow ( )

Member Function Documentation

◆ closeBuilding()

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.

See also
GUIMainWindow::addChild

Definition at line 246 of file GUIParameterTableWindow.cpp.

References GUIMainWindow::addChild(), Parameterised::getParametersMap(), mkItem(), myApplication, myItems, myObject, and myTable.

Referenced by GUIBusStop::getParameterWindow(), GUICalibrator::getParameterWindow(), GUIChargingStation::getParameterWindow(), GUIContainer::getParameterWindow(), GUIContainerStop::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUIEdge::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIJunctionWrapper::getParameterWindow(), GUILane::getParameterWindow(), GUILaneSpeedTrigger::getParameterWindow(), GUIOverheadWire::getParameterWindow(), GUIOverheadWireClamp::getParameterWindow(), GUIParkingArea::getParameterWindow(), GUIPerson::getParameterWindow(), GUITrafficLightLogicWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GNEAdditional::getParameterWindow(), GNEPOI::getParameterWindow(), GNEPoly::getParameterWindow(), GNETAZElement::getParameterWindow(), GNEGenericData::getParameterWindow(), GNEDemandElement::getParameterWindow(), GNEInternalLane::getParameterWindow(), GNENetworkElement::getParameterWindow(), GNENet::getParameterWindow(), GUIPointOfInterest::getParameterWindow(), GUIPolygon::getParameterWindow(), GUINet::getParameterWindow(), GUIContainer::getTypeParameterWindow(), GUIEdge::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), GUIContainer::GUIContainerPopupMenu::onCmdShowPlan(), and GUIPerson::GUIPersonPopupMenu::onCmdShowPlan().

Here is the caller graph for this function:

◆ mkItem() [1/6]

void GUIParameterTableWindow::mkItem ( const char *  name,
bool  dynamic,
double  value 
)

Adds a row which shows a double-value.

Parameters
[in]nameThe name of the row entry
[in]dynamicInformation whether the entry is dynamic
[in]valueThe value to show
Todo:
the dynamic-parameter is obsolete

Definition at line 202 of file GUIParameterTableWindow.cpp.

References myCurrentPos, myItems, and myTable.

◆ mkItem() [2/6]

void GUIParameterTableWindow::mkItem ( const char *  name,
bool  dynamic,
int  value 
)

Adds a row which shows a integer-value.

Parameters
[in]nameThe name of the row entry
[in]dynamicInformation whether the entry is dynamic
[in]valueThe value to show
Todo:
the dynamic-parameter is obsolete

Definition at line 218 of file GUIParameterTableWindow.cpp.

References myCurrentPos, myItems, and myTable.

◆ mkItem() [3/6]

void GUIParameterTableWindow::mkItem ( const char *  name,
bool  dynamic,
long long int  value 
)

Adds a row which shows a 64 bit integer-value.

Parameters
[in]nameThe name of the row entry
[in]dynamicInformation whether the entry is dynamic
[in]valueThe value to show
Todo:
the dynamic-parameter is obsolete

Definition at line 226 of file GUIParameterTableWindow.cpp.

References myCurrentPos, myItems, and myTable.

◆ mkItem() [4/6]

void GUIParameterTableWindow::mkItem ( const char *  name,
bool  dynamic,
std::string  value 
)

Adds a row which shows a string-value.

Parameters
[in]nameThe name of the row entry
[in]dynamicInformation whether the entry is dynamic
[in]valueThe value to show
Todo:
the dynamic-parameter is obsolete(?)

Definition at line 194 of file GUIParameterTableWindow.cpp.

References myCurrentPos, myItems, and myTable.

◆ mkItem() [5/6]

void GUIParameterTableWindow::mkItem ( const char *  name,
bool  dynamic,
unsigned  value 
)

Adds a row which shows a unsigned-value.

Parameters
[in]nameThe name of the row entry
[in]dynamicInformation whether the entry is dynamic
[in]valueThe value to show
Todo:
the dynamic-parameter is obsolete

Definition at line 210 of file GUIParameterTableWindow.cpp.

References myCurrentPos, myItems, and myTable.

◆ mkItem() [6/6]

template<class T >
void GUIParameterTableWindow::mkItem ( const char *  name,
bool  dynamic,
ValueSource< T > *  src 
)
inline

Adds a row which obtains its value from a ValueSource.

Parameters
[in]nameThe name of the row entry
[in]dynamicInformation whether the entry is dynamic
[in]srcThe value source to use

Definition at line 104 of file GUIParameterTableWindow.h.

References myCurrentPos, myItems, and myTable.

Referenced by closeBuilding(), GUIBusStop::getParameterWindow(), GUICalibrator::getParameterWindow(), GUIChargingStation::getParameterWindow(), GUIContainer::getParameterWindow(), GUIContainerStop::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GUIE3Collector::MyWrapper::getParameterWindow(), GUIEdge::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIJunctionWrapper::getParameterWindow(), GUILane::getParameterWindow(), GUILaneSpeedTrigger::getParameterWindow(), GUIOverheadWire::getParameterWindow(), GUIParkingArea::getParameterWindow(), GUIPerson::getParameterWindow(), GUITrafficLightLogicWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GNEAdditional::getParameterWindow(), GNEPOI::getParameterWindow(), GNEPoly::getParameterWindow(), GNETAZElement::getParameterWindow(), GNEGenericData::getParameterWindow(), GNEDemandElement::getParameterWindow(), GNENetworkElement::getParameterWindow(), GUIPointOfInterest::getParameterWindow(), GUIPolygon::getParameterWindow(), GUINet::getParameterWindow(), GUIContainer::getTypeParameterWindow(), GUIEdge::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), GUIContainer::GUIContainerPopupMenu::onCmdShowPlan(), and GUIPerson::GUIPersonPopupMenu::onCmdShowPlan().

Here is the caller graph for this function:

◆ numParams()

int GUIParameterTableWindow::numParams ( const GUIGlObject obj)
staticprivate

returns the number of parameters if obj is Parameterised and 0 otherwise

Definition at line 269 of file GUIParameterTableWindow.cpp.

References Parameterised::getParametersMap().

◆ onLeftBtnPress()

long GUIParameterTableWindow::onLeftBtnPress ( FXObject *  sender,
FXSelector  sel,
void *  eventData 
)

directly opens tracker when clicking on last column

Definition at line 140 of file GUIParameterTableWindow.cpp.

References GUIParameterTracker::addTracked(), 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().

Here is the caller graph for this function:

◆ onRightButtonPress()

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.

See also
GUIParameterTableItemInterface
GUIParam_PopupMenuInterface

Definition at line 163 of file GUIParameterTableWindow.cpp.

References GUIDesigns::buildFXMenuCommand(), GUIParameterTableItemInterface::dynamic(), GUIParameterTableItemInterface::getdoubleSourceCopy(), GUIParameterTableItemInterface::getName(), MID_OPENTRACKER, myApplication, myItems, myObject, and myTable.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onSimStep()

long GUIParameterTableWindow::onSimStep ( FXObject *  ,
FXSelector  ,
void *   
)

Updates the table due to a simulation step.

Definition at line 120 of file GUIParameterTableWindow.cpp.

References updateTable().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onTableDeselected()

long GUIParameterTableWindow::onTableDeselected ( FXObject *  ,
FXSelector  ,
void *   
)

Does nothing.

Todo:
Recheck whether this is needed (to override FXTable-behaviour?)

Definition at line 135 of file GUIParameterTableWindow.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onTableSelected()

long GUIParameterTableWindow::onTableSelected ( FXObject *  ,
FXSelector  ,
void *   
)

Does nothing.

Todo:
Recheck whether this is needed (to override FXTable-behaviour?)

Definition at line 129 of file GUIParameterTableWindow.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ removeObject()

void GUIParameterTableWindow::removeObject ( GUIGlObject *const  o)

Lets this window know the object shown is being deleted.

Parameters
[in]oThe deleted (shown) object

Definition at line 113 of file GUIParameterTableWindow.cpp.

References myLock, and myObject.

◆ updateAll()

static void GUIParameterTableWindow::updateAll ( )
inlinestatic

Updates all instances.

Definition at line 198 of file GUIParameterTableWindow.h.

References myContainer, and myGlobalContainerLock.

◆ updateTable()

void GUIParameterTableWindow::updateTable ( )
protected

Updates the table.

Goes through all entries and updates them using GUIParameterTableItemInterface::update.

See also
GUIParameterTableItemInterface::update

Definition at line 234 of file GUIParameterTableWindow.cpp.

References myItems, myLock, and myObject.

Referenced by onSimStep().

Here is the caller graph for this function:

Field Documentation

◆ myApplication

GUIMainWindow* GUIParameterTableWindow::myApplication
private

The main application window.

Definition at line 228 of file GUIParameterTableWindow.h.

Referenced by closeBuilding(), onLeftBtnPress(), onRightButtonPress(), and ~GUIParameterTableWindow().

◆ myContainer

std::vector< GUIParameterTableWindow * > GUIParameterTableWindow::myContainer
staticprotected

The container of items that shall be updated.

Definition at line 218 of file GUIParameterTableWindow.h.

Referenced by GUIParameterTableWindow(), updateAll(), and ~GUIParameterTableWindow().

◆ myCurrentPos

unsigned GUIParameterTableWindow::myCurrentPos
private

The index of the next row to add - used while building.

Definition at line 237 of file GUIParameterTableWindow.h.

Referenced by mkItem().

◆ myGlobalContainerLock

FXMutex GUIParameterTableWindow::myGlobalContainerLock
staticprotected

The mutex used to avoid concurrent updates of the instance container.

Definition at line 215 of file GUIParameterTableWindow.h.

Referenced by GUIParameterTableWindow(), updateAll(), and ~GUIParameterTableWindow().

◆ myItems

std::vector<GUIParameterTableItemInterface*> GUIParameterTableWindow::myItems
private

The list of table rows.

Definition at line 231 of file GUIParameterTableWindow.h.

Referenced by closeBuilding(), mkItem(), onLeftBtnPress(), onRightButtonPress(), updateTable(), and ~GUIParameterTableWindow().

◆ myLock

FXMutex GUIParameterTableWindow::myLock
mutableprivate

A lock assuring save updates in case of object deletion.

Definition at line 240 of file GUIParameterTableWindow.h.

Referenced by GUIParameterTableWindow(), removeObject(), updateTable(), and ~GUIParameterTableWindow().

◆ myObject

GUIGlObject* GUIParameterTableWindow::myObject
private

◆ myTable

FXTable* GUIParameterTableWindow::myTable
private

The table to display the information in.

Definition at line 225 of file GUIParameterTableWindow.h.

Referenced by closeBuilding(), GUIParameterTableWindow(), mkItem(), onLeftBtnPress(), and onRightButtonPress().

◆ myTrackerY

int GUIParameterTableWindow::myTrackerY
private

y-position for opening new tracker window

Definition at line 234 of file GUIParameterTableWindow.h.

Referenced by onLeftBtnPress().


The documentation for this class was generated from the following files: