Eclipse SUMO - Simulation of Urban MObility
GNEChargingStation.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)
15 /****************************************************************************/
16 #ifndef GNEChargingStation_h
17 #define GNEChargingStation_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEStoppingPlace.h"
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
30 
32 
33 public:
48  GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet,
49  const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay,
50  bool friendlyPosition, bool blockMovement);
51 
54 
58  void updateGeometry();
59 
63 
66 
70  void drawGL(const GUIVisualizationSettings& s) const;
72 
75  /* @brief method for getting the Attribute of an XML key
76  * @param[in] key The attribute key
77  * @return string with the value associated to key
78  */
79  std::string getAttribute(SumoXMLAttr key) const;
80 
81  /* @brief method for setting the attribute and letting the object perform additional changes
82  * @param[in] key The attribute key
83  * @param[in] value The new value
84  * @param[in] undoList The undoList on which to register changes
85  */
86  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
87 
88  /* @brief method for checking if the key and their correspond attribute are valids
89  * @param[in] key The attribute key
90  * @param[in] value The value asociated to key key
91  * @return true if the value is valid, false in other case
92  */
93  bool isValid(SumoXMLAttr key, const std::string& value);
94 
96 
97 protected:
100 
102  double myEfficiency;
103 
106 
109 
110 private:
112  void setAttribute(SumoXMLAttr key, const std::string& value);
113 
115  GNEChargingStation(const GNEChargingStation&) = delete;
116 
119 };
120 
121 
122 #endif
GNEChargingStation::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEChargingStation.cpp:239
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GNEViewNet
Definition: GNEViewNet.h:42
GNEChargingStation::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEChargingStation.cpp:79
GNEChargingStation::GNEChargingStation
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const double startPos, const double endPos, const int parametersSet, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement)
Constructor of charging station.
Definition: GNEChargingStation.cpp:40
GNEChargingStation::myEfficiency
double myEfficiency
efficiency of the charge
Definition: GNEChargingStation.h:102
GNEChargingStation::myChargeDelay
SUMOTime myChargeDelay
delay in the starting of charge
Definition: GNEChargingStation.h:108
GNEChargingStation
Definition: GNEChargingStation.h:31
GNEStoppingPlace
Definition: GNEStoppingPlace.h:39
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEChargingStation::~GNEChargingStation
~GNEChargingStation()
Destructor.
Definition: GNEChargingStation.cpp:50
GNEChargingStation::myChargeInTransit
bool myChargeInTransit
enable or disable charge in transit
Definition: GNEChargingStation.h:105
GNEChargingStation::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEChargingStation.cpp:54
GNEChargingStation::myChargingPower
double myChargingPower
Charging power pro timestep.
Definition: GNEChargingStation.h:99
GNEChargingStation::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEChargingStation.cpp:85
GNEChargingStation::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEChargingStation.cpp:196
GNEStoppingPlace.h
GNEChargingStation::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEChargingStation.cpp:266
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNEChargingStation::operator=
GNEChargingStation & operator=(const GNEChargingStation &)=delete
Invalidated assignment operator.
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45