SUMO - Simulation of Urban MObility
GNEChargingStation.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)
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:
64  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);
65 
68 
73  void writeAdditional(OutputDevice& device, bool volatileOptionsEnabled) 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 
117  void updateGeometry();
119 
122 
126  void drawGL(const GUIVisualizationSettings& s) const;
128 
131  /* @brief method for getting the Attribute of an XML key
132  * @param[in] key The attribute key
133  * @return string with the value associated to key
134  */
135  std::string getAttribute(SumoXMLAttr key) const;
136 
137  /* @brief method for setting the attribute and letting the object perform additional changes
138  * @param[in] key The attribute key
139  * @param[in] value The new value
140  * @param[in] undoList The undoList on which to register changes
141  */
142  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
143 
144  /* @brief method for checking if the key and their correspond attribute are valids
145  * @param[in] key The attribute key
146  * @param[in] value The value asociated to key key
147  * @return true if the value is valid, false in other case
148  */
149  bool isValid(SumoXMLAttr key, const std::string& value);
151 
152 protected:
155 
157  double myEfficiency;
158 
161 
164 
165 private:
167  void setAttribute(SumoXMLAttr key, const std::string& value);
168 
171 
174 };
175 
176 
177 #endif
bool getChargeInTransit()
Returns the value of charge in transit of the chargingStation.
double getEfficiency()
Returns the charging efficiency of the chargingStation.
Stores the information about how to visualize structures.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:92
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 drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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.
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.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
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
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...