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, SUMOReal startPos, SUMOReal endPos, SUMOReal chargingPower, SUMOReal efficiency, bool chargeInTransit, const SUMOReal chargeDelay);
63 
66 
68  void updateGeometry();
69 
73  void writeAdditional(OutputDevice& device) const;
74 
79 
87  bool getChargeInTransit();
92 
97  void setChargingPower(SUMOReal chargingPower);
98 
103  void setEfficiency(SUMOReal efficiency);
107  void setChargeInTransit(bool chargeInTransit);
112  void setChargeDelay(SUMOReal 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 
152 
155 
158 
159 private:
161  void setAttribute(SumoXMLAttr key, const std::string& value);
162 
165 
168 };
169 
170 
171 #endif
SUMOReal getEfficiency()
Returns the charging efficiency of the chargingStation.
bool getChargeInTransit()
Returns the value of charge in transit of the chargingStation.
Stores the information about how to visualize structures.
SUMOReal getChargeDelay()
Returns the charge delay of the chargingStation.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:87
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
SUMOReal getChargingPower()
Returns the charging power of the chargingStation.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOReal myEfficiency
efficiency of the charge
void setChargeInTransit(bool chargeInTransit)
Enable or disable charge in transit in the charging station.
A list of positions.
void updateGeometry()
update pre-computed geometry information
void setChargeDelay(SUMOReal chargeDelay)
Set a new charge delay in the charging station.
~GNEChargingStation()
Destructor.
bool myChargeInTransit
enable or disable charge in transit
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
std::string getAttribute(SumoXMLAttr key) const
SUMOReal myChargingPower
Charging power pro timestep.
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, SUMOReal startPos, SUMOReal endPos, SUMOReal chargingPower, SUMOReal efficiency, bool chargeInTransit, const SUMOReal chargeDelay)
Constructor of charging station.
The popup menu of a globject.
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.
void setEfficiency(SUMOReal efficiency)
Set a new efficiency in the charging station.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:208
void setChargingPower(SUMOReal chargingPower)
Set a new charging power in the charging station.
SUMOReal myChargeDelay
delay in the starting of charge
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...