SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GNEChargingStation.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 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:
63  GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, SUMOReal startPos, SUMOReal endPos, SUMOReal chargingPower, SUMOReal efficiency, bool chargeInTransit, int chargeDelay, bool blocked);
64 
67 
69  void updateGeometry();
70 
74  void writeAdditional(OutputDevice& device, const std::string&);
75 
80 
88  bool getChargeInTransit();
93 
98  void setChargingPower(SUMOReal chargingPower);
99 
104  void setEfficiency(SUMOReal efficiency);
108  void setChargeInTransit(bool chargeInTransit);
113  void setChargeDelay(SUMOReal chargeDelay);
114 
117 
121  void drawGL(const GUIVisualizationSettings& s) const;
123 
126  /* @brief method for getting the Attribute of an XML key
127  * @param[in] key The attribute key
128  * @return string with the value associated to key
129  */
130  std::string getAttribute(SumoXMLAttr key) const;
131 
132  /* @brief method for setting the attribute and letting the object perform additional changes
133  * @param[in] key The attribute key
134  * @param[in] value The new value
135  * @param[in] undoList The undoList on which to register changes
136  */
137  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
138 
139  /* @brief method for checking if the key and their correspond attribute are valids
140  * @param[in] key The attribute key
141  * @param[in] value The value asociated to key key
142  * @return true if the value is valid, false in other case
143  */
144  bool isValid(SumoXMLAttr key, const std::string& value);
146 
147 protected:
150 
153 
156 
159 
160 private:
162  void setAttribute(SumoXMLAttr key, const std::string& value);
163 
166 
169 };
170 
171 
172 #endif
SUMOReal getEfficiency()
Returns the charging efficiency of the chargingStation.
int myChargeDelay
delay in the starting of charge
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:55
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 writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file
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
std::string getAttribute(SumoXMLAttr key) const
SUMOReal myChargingPower
Charging power pro timestep.
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.
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, SUMOReal startPos, SUMOReal endPos, SUMOReal chargingPower, SUMOReal efficiency, bool chargeInTransit, int chargeDelay, bool blocked)
Constructor of charging station.
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:214
void setChargingPower(SUMOReal chargingPower)
Set a new charging power in the charging station.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...