SUMO - Simulation of Urban MObility
GNEChargingStation.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEChargingStation_h
21 #define GNEChargingStation_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEStoppingPlace.h"
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 
41 class PositionVector;
42 class GNELane;
43 class GNENet;
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
48 
50 public:
62  GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double startPos, double endPos, double chargingPower, double efficiency, bool chargeInTransit, const double chargeDelay);
63 
66 
68  void updateGeometry();
69 
73  void writeAdditional(OutputDevice& device) const;
74 
78  double getChargingPower();
79 
83  double getEfficiency();
87  bool getChargeInTransit();
91  double getChargeDelay();
92 
97  void setChargingPower(double chargingPower);
98 
103  void setEfficiency(double efficiency);
107  void setChargeInTransit(bool chargeInTransit);
112  void setChargeDelay(double chargeDelay);
113 
116 
120  void drawGL(const GUIVisualizationSettings& s) const;
122 
125  /* @brief method for getting the Attribute of an XML key
126  * @param[in] key The attribute key
127  * @return string with the value associated to key
128  */
129  std::string getAttribute(SumoXMLAttr key) const;
130 
131  /* @brief method for setting the attribute and letting the object perform additional changes
132  * @param[in] key The attribute key
133  * @param[in] value The new value
134  * @param[in] undoList The undoList on which to register changes
135  */
136  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
137 
138  /* @brief method for checking if the key and their correspond attribute are valids
139  * @param[in] key The attribute key
140  * @param[in] value The value asociated to key key
141  * @return true if the value is valid, false in other case
142  */
143  bool isValid(SumoXMLAttr key, const std::string& value);
145 
146 protected:
149 
151  double myEfficiency;
152 
155 
158 
159 private:
161  void setAttribute(SumoXMLAttr key, const std::string& value);
162 
165 
168 };
169 
170 
171 #endif
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double startPos, double endPos, double chargingPower, double efficiency, bool chargeInTransit, const double chargeDelay)
Constructor of charging station.
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.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:88
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
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.
A list of positions.
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.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
The popup menu of a globject.
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
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...