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 /****************************************************************************/
15 // A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)
16 /****************************************************************************/
17 #ifndef GNEChargingStation_h
18 #define GNEChargingStation_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include "GNEStoppingPlace.h"
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
31 
33 
34 public:
49  GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const std::string& startPos, const std::string& endPos, const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement);
50 
53 
57  void updateGeometry();
58 
62 
65 
69  void drawGL(const GUIVisualizationSettings& s) const;
71 
74  /* @brief method for getting the Attribute of an XML key
75  * @param[in] key The attribute key
76  * @return string with the value associated to key
77  */
78  std::string getAttribute(SumoXMLAttr key) const;
79 
80  /* @brief method for setting the attribute and letting the object perform additional changes
81  * @param[in] key The attribute key
82  * @param[in] value The new value
83  * @param[in] undoList The undoList on which to register changes
84  */
85  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
86 
87  /* @brief method for checking if the key and their correspond attribute are valids
88  * @param[in] key The attribute key
89  * @param[in] value The value asociated to key key
90  * @return true if the value is valid, false in other case
91  */
92  bool isValid(SumoXMLAttr key, const std::string& value);
94 
95 protected:
98 
100  double myEfficiency;
101 
104 
107 
108 private:
110  void setAttribute(SumoXMLAttr key, const std::string& value);
111 
113  GNEChargingStation(const GNEChargingStation&) = delete;
114 
117 };
118 
119 
120 #endif
long long int SUMOTime
Definition: SUMOTime.h:35
Stores the information about how to visualize structures.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SUMOTime myChargeDelay
delay in the starting of charge
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
double myEfficiency
efficiency of the charge
void updateGeometry()
update pre-computed geometry information
~GNEChargingStation()
Destructor.
bool myChargeInTransit
enable or disable charge in transit
double myChargingPower
Charging power pro timestep.
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const std::string &startPos, const std::string &endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement)
Constructor of charging station.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string getAttribute(SumoXMLAttr key) const
GNEChargingStation & operator=(const GNEChargingStation &)=delete
Invalidated assignment operator.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...