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-2018 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, const double chargeDelay, bool friendlyPosition, bool blockMovement);
50 
53 
57  void updateGeometry(bool updateGrid);
59 
62 
66  void drawGL(const GUIVisualizationSettings& s) const;
68 
71  /* @brief method for getting the Attribute of an XML key
72  * @param[in] key The attribute key
73  * @return string with the value associated to key
74  */
75  std::string getAttribute(SumoXMLAttr key) const;
76 
77  /* @brief method for setting the attribute and letting the object perform additional changes
78  * @param[in] key The attribute key
79  * @param[in] value The new value
80  * @param[in] undoList The undoList on which to register changes
81  */
82  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
83 
84  /* @brief method for checking if the key and their correspond attribute are valids
85  * @param[in] key The attribute key
86  * @param[in] value The value asociated to key key
87  * @return true if the value is valid, false in other case
88  */
89  bool isValid(SumoXMLAttr key, const std::string& value);
91 
92 protected:
95 
97  double myEfficiency;
98 
101 
104 
105 private:
107  void setAttribute(SumoXMLAttr key, const std::string& value);
108 
110  GNEChargingStation(const GNEChargingStation&) = delete;
111 
114 };
115 
116 
117 #endif
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:47
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void updateGeometry(bool updateGrid)
update pre-computed geometry information
double myEfficiency
efficiency of the charge
~GNEChargingStation()
Destructor.
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, const double chargeDelay, bool friendlyPosition, bool blockMovement)
Constructor of charging station.
bool myChargeInTransit
enable or disable charge in transit
double myChargingPower
Charging power pro timestep.
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
double myChargeDelay
delay in the starting of charge
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 ...