Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4 : // This program and the accompanying materials are made available under the
5 : // terms of the Eclipse Public License 2.0 which is available at
6 : // https://www.eclipse.org/legal/epl-2.0/
7 : // This Source Code may also be made available under the following Secondary
8 : // Licenses when the conditions for such availability set forth in the Eclipse
9 : // Public License 2.0 are satisfied: GNU General Public License, version 2
10 : // or later which is available at
11 : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 : /****************************************************************************/
14 : /// @file GUIChargingStation.h
15 : /// @author Daniel Krajzewicz
16 : /// @author Jakob Erdmann
17 : /// @author Michael Behrisch
18 : /// @author Tamas Kurczveil
19 : /// @author Pablo Alvarez Lopez
20 : /// @author Mirko Barthauer
21 : /// @date 20-12-13
22 : ///
23 : // A lane area vehicles can halt at (gui-version)
24 : /****************************************************************************/
25 : #pragma once
26 : #include <config.h>
27 :
28 : #include <vector>
29 : #include <string>
30 : #include <utils/common/Command.h>
31 : #include <utils/common/VectorHelper.h>
32 : #include <utils/geom/PositionVector.h>
33 : #include <microsim/trigger/MSChargingStation.h>
34 : #include <guisim/GUIBusStop.h>
35 : #include <utils/gui/globjects/GUIGlObject.h>
36 : #include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
37 : #include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
38 : #include <utils/geom/Position.h>
39 : #include <gui/GUIManipulator.h>
40 :
41 :
42 : // ===========================================================================
43 : // class declarations
44 : // ===========================================================================
45 : class MSNet;
46 : class MSLane;
47 : class GUIManipulator;
48 :
49 :
50 : // ===========================================================================
51 : // class definitions
52 : // ===========================================================================
53 : /**
54 : * @class GUIChargingStation
55 : * @brief A lane area vehicles can halt at (gui-version)
56 : *
57 : * This gui-version of a bus-stop extends MSChargingStation by methods for displaying
58 : * and interaction.
59 : *
60 : * @see MSChargingStation
61 : * @see GUIGlObject_AbstractAdd
62 : * @see GUIGlObject
63 : */
64 : class GUIChargingStation : public MSChargingStation, public GUIGlObject_AbstractAdd {
65 : public:
66 : /** @brief Constructor
67 : * @param[in] id The id of the Charging Station
68 : * @param[in] lane The lane the charging station is placed on
69 : * @param[in] frompos Begin position of the charging station on the lane
70 : * @param[in] topos End position of the charging station on the lane
71 : * @param[in] chargingPower max energy charged in every timeStep by one vehicle
72 : * @param[in] totalPower max energy charged in every timeStep across all charging vehicles
73 : * @param[in] efficiency efficiency of the charge
74 : * @param[in] chargeInTransit enable or disable charge in transit
75 : * @param[in] chargeDelay delay in the charge
76 : * @param[in] chargeType charge type (normal, electric or fuel)
77 : * @param[in] waitingTime waiting time until start charging
78 : */
79 : GUIChargingStation(const std::string& id, MSLane& lane, double frompos, double topos,
80 : const std::string& name, double chargingPower, double totalPower, double efficiency,
81 : bool chargeInTransit, SUMOTime chargeDelay, const std::string& chargeType,
82 : SUMOTime waitingTime);
83 :
84 : /** @brief Constructor
85 : * @param[in] id The id of the Charging Station
86 : * @param[in] parkingArea The parking area the charging station is placed on
87 : * @param[in] frompos Begin position of the charging station on the lane
88 : * @param[in] topos End position of the charging station on the lane
89 : * @param[in] chargingPower max energy charged in every timeStep by one vehicle
90 : * @param[in] totalPower max energy charged in every timeStep across all charging vehicles
91 : * @param[in] efficiency efficiency of the charge
92 : * @param[in] chargeInTransit enable or disable charge in transit
93 : * @param[in] chargeDelay delay in the charge
94 : * @param[in] chargeType charge type (normal, electric or fuel)
95 : * @param[in] waitingTime waiting time until start charging
96 : */
97 : GUIChargingStation(const std::string& id, MSParkingArea* parkingArea,
98 : const std::string& name, double chargingPower, double totalPower, double efficiency,
99 : bool chargeInTransit, SUMOTime chargeDelay, const std::string& chargeType,
100 : SUMOTime waitingTime);
101 :
102 : /// @brief Destructor
103 : ~GUIChargingStation();
104 :
105 : /// @name inherited from GUIGlObject
106 : //@{
107 :
108 : /** @brief Returns an own popup-menu
109 : *
110 : * @param[in] app The application needed to build the popup-menu
111 : * @param[in] parent The parent window needed to build the popup-menu
112 : * @return The built popup-menu
113 : * @see GUIGlObject::getPopUpMenu
114 : */
115 : GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) override;
116 :
117 : /** @brief Returns an own parameter window
118 : *
119 : * Bus stops have no parameter windows (yet).
120 : *
121 : * @param[in] app The application needed to build the parameter window
122 : * @param[in] parent The parent window needed to build the parameter window
123 : * @return The built parameter window (always 0 in this case)
124 : * @see GUIGlObject::getParameterWindow
125 : */
126 : GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) override;
127 :
128 : /// @brief return exaggeration associated with this GLObject
129 : double getExaggeration(const GUIVisualizationSettings& s) const override;
130 :
131 : /** @brief Returns the boundary to which the view shall be centered in order to show the object
132 : *
133 : * @return The boundary the object is within
134 : * @see GUIGlObject::getCenteringBoundary
135 : */
136 : Boundary getCenteringBoundary() const override;
137 :
138 : /// @brief Returns the stopping place name
139 : const std::string getOptionalName() const override;
140 :
141 : /** @brief Draws the object
142 : * @param[in] s The settings for the current view (may influence drawing)
143 : * @see GUIGlObject::drawGL
144 : */
145 : void drawGL(const GUIVisualizationSettings& s) const override;
146 : //@}
147 :
148 : const Position& getSignPos() const {
149 0 : return myFGSignPos;
150 : }
151 :
152 : private:
153 : /// @brief Returns the stopping place name
154 : void initAppearance(MSLane& lane, double frompos, double topos);
155 :
156 : private:
157 : /// @brief The rotations of the shape parts
158 : std::vector<double> myFGShapeRotations;
159 :
160 : /// @brief The lengths of the shape parts
161 : std::vector<double> myFGShapeLengths;
162 :
163 : /// @brief The shape
164 : PositionVector myFGShape;
165 :
166 : /// @brief The position of the sign
167 : Position myFGSignPos;
168 :
169 : /// @brief The rotation of the sign
170 : double myFGSignRot;
171 : };
|