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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)
18 /****************************************************************************/
19 #ifndef GNEChargingStation_h
20 #define GNEChargingStation_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEStoppingPlace.h"
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
38 
40 
41 public:
55  GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double startPos, double endPos, const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, const double chargeDelay, bool friendlyPosition);
56 
59 
63  void writeAdditional(OutputDevice& device) const;
64 
68  double getChargingPower();
69 
73  double getEfficiency();
77  bool getChargeInTransit();
81  double getChargeDelay();
82 
87  void setChargingPower(double chargingPower);
88 
93  void setEfficiency(double efficiency);
97  void setChargeInTransit(bool chargeInTransit);
102  void setChargeDelay(double chargeDelay);
103 
107  void updateGeometry();
109 
112 
116  void drawGL(const GUIVisualizationSettings& s) const;
118 
121  /* @brief method for getting the Attribute of an XML key
122  * @param[in] key The attribute key
123  * @return string with the value associated to key
124  */
125  std::string getAttribute(SumoXMLAttr key) const;
126 
127  /* @brief method for setting the attribute and letting the object perform additional changes
128  * @param[in] key The attribute key
129  * @param[in] value The new value
130  * @param[in] undoList The undoList on which to register changes
131  */
132  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
133 
134  /* @brief method for checking if the key and their correspond attribute are valids
135  * @param[in] key The attribute key
136  * @param[in] value The value asociated to key key
137  * @return true if the value is valid, false in other case
138  */
139  bool isValid(SumoXMLAttr key, const std::string& value);
141 
142 protected:
145 
147  double myEfficiency;
148 
151 
154 
155 private:
157  void setAttribute(SumoXMLAttr key, const std::string& value);
158 
161 
164 };
165 
166 
167 #endif
bool getChargeInTransit()
Returns the value of charge in transit of the chargingStation.
double getEfficiency()
Returns the charging efficiency of the chargingStation.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
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:53
void setEfficiency(double efficiency)
Set a new efficiency in the charging station.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double myEfficiency
efficiency of the charge
void setChargeInTransit(bool chargeInTransit)
Enable or disable charge in transit in the charging station.
double getChargeDelay()
Returns the charge delay of the chargingStation.
double getChargingPower()
Returns the charging power of the chargingStation.
void updateGeometry()
update pre-computed geometry information
~GNEChargingStation()
Destructor.
void setChargeDelay(double chargeDelay)
Set a new charge delay in the charging station.
bool myChargeInTransit
enable or disable charge in transit
double myChargingPower
Charging power pro timestep.
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double startPos, double endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, const double chargeDelay, bool friendlyPosition)
Constructor of charging station.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setChargingPower(double chargingPower)
Set a new charging power in the charging station.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNEChargingStation & operator=(const GNEChargingStation &)
Invalidated assignment operator.
double myChargeDelay
delay in the starting of charge
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...