Skip to content

Commit

Permalink
format last free pos ref #13962
Browse files Browse the repository at this point in the history
Signed-off-by: m-kro <m.barthauer@t-online.de>
  • Loading branch information
m-kro committed Feb 23, 2024
1 parent c48ef3d commit 5f2b533
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/guisim/GUIBusStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ GUIBusStop::getParameterWindow(GUIMainWindow& app,
ret->mkItem((transportable + " capacity [#]").c_str(), false, myTransportableCapacity);
ret->mkItem((transportable + " number [#]").c_str(), true, new FunctionBinding<GUIBusStop, int>(this, &MSStoppingPlace::getTransportableNumber));
ret->mkItem(TL("stopped vehicles [#]"), true, new FunctionBinding<GUIBusStop, int>(this, &MSStoppingPlace::getStoppedVehicleNumber));
ret->mkItem(TL("last free pos [m]"), true, new FunctionBinding<GUIBusStop, double>(this, &MSStoppingPlace::getLastFreePos));
ret->mkItem(TL("last free pos [m]"), true, new FunctionBinding<GUIBusStop, double>(this, &GUIBusStop::getCroppedLastFreePos));
// rides-being-waited-on statistic
std::map<std::string, int> stats;
for (const MSTransportable* t : getTransportables()) {
Expand Down Expand Up @@ -278,4 +278,9 @@ GUIBusStop::getOptionalName() const {
return myName;
}

double
GUIBusStop::getCroppedLastFreePos() const {
return MAX2(0., getLastFreePos());
}

/****************************************************************************/
3 changes: 3 additions & 0 deletions src/guisim/GUIBusStop.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class GUIBusStop : public MSStoppingPlace, public GUIGlObject_AbstractAdd {
/// @brief Returns the street name
const std::string getOptionalName() const;

/// @brief Formats the last free pos value
double getCroppedLastFreePos() const;

/** @brief Draws the object
* @param[in] s The settings for the current view (may influence drawing)
* @see GUIGlObject::drawGL
Expand Down

0 comments on commit 5f2b533

Please sign in to comment.