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 #include <config.h>
25 
26 #include "GNEStoppingPlace.h"
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
32 
34 
35 public:
50  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);
51 
54 
58  void updateGeometry(bool updateGrid);
60 
63 
67  void drawGL(const GUIVisualizationSettings& s) const;
69 
72  /* @brief method for getting the Attribute of an XML key
73  * @param[in] key The attribute key
74  * @return string with the value associated to key
75  */
76  std::string getAttribute(SumoXMLAttr key) const;
77 
78  /* @brief method for setting the attribute and letting the object perform additional changes
79  * @param[in] key The attribute key
80  * @param[in] value The new value
81  * @param[in] undoList The undoList on which to register changes
82  */
83  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
84 
85  /* @brief method for checking if the key and their correspond attribute are valids
86  * @param[in] key The attribute key
87  * @param[in] value The value asociated to key key
88  * @return true if the value is valid, false in other case
89  */
90  bool isValid(SumoXMLAttr key, const std::string& value);
92 
93 protected:
96 
98  double myEfficiency;
99 
102 
105 
106 private:
108  void setAttribute(SumoXMLAttr key, const std::string& value);
109 
111  GNEChargingStation(const GNEChargingStation&) = delete;
112 
115 };
116 
117 
118 #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 ...