Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEChargingStation.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEStoppingPlace.h"
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
28
30
31public:
34
53 GNEChargingStation(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,
54 const double startPos, const double endPos, const std::string& name, const double chargingPower,
55 const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay,
56 const std::string& chargeType, const SUMOTime waitingTime, const std::string& parkingAreaID,
57 const bool friendlyPosition, const Parameterised::Map& parameters);
58
61
65 void writeAdditional(OutputDevice& device) const;
66
69
71 void updateGeometry() override;
72
74
77
82 void drawGL(const GUIVisualizationSettings& s) const;
83
85
88
89 /* @brief method for getting the Attribute of an XML key
90 * @param[in] key The attribute key
91 * @return string with the value associated to key
92 */
93 std::string getAttribute(SumoXMLAttr key) const override;
94
95 /* @brief method for getting the Attribute of an XML key in double format
96 * @param[in] key The attribute key
97 * @return double with the value associated to key
98 */
99 double getAttributeDouble(SumoXMLAttr key) const override;
100
101 /* @brief method for setting the attribute and letting the object perform additional changes
102 * @param[in] key The attribute key
103 * @param[in] value The new value
104 * @param[in] undoList The undoList on which to register changes
105 */
106 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
107
108 /* @brief method for checking if the key and their correspond attribute are valids
109 * @param[in] key The attribute key
110 * @param[in] value The value associated to key key
111 * @return true if the value is valid, false in other case
112 */
113 bool isValid(SumoXMLAttr key, const std::string& value) override;
114
116
117protected:
119 double myChargingPower = 0;
120
122 double myEfficiency = 0;
123
125 bool myChargeInTransit = false;
126
129
131 std::string myChargeType = "normal";
132
135
137 std::string myParkingAreaID;
138
139private:
141 void setAttribute(SumoXMLAttr key, const std::string& value) override;
142
145
148};
long long int SUMOTime
Definition GUI.h:36
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEChargingStation(const GNEChargingStation &)=delete
Invalidated copy constructor.
std::string myChargeType
charging type
double getAttributeDouble(SumoXMLAttr key) const override
bool isValid(SumoXMLAttr key, const std::string &value) override
~GNEChargingStation()
Destructor.
std::string myParkingAreaID
parking area ID
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void updateGeometry() override
update pre-computed geometry information
SUMOTime myChargeDelay
delay in the starting of charge
GNEChargingStation & operator=(const GNEChargingStation &)=delete
Invalidated assignment operator.
bool myChargeInTransit
enable or disable charge in transit
std::string getAttribute(SumoXMLAttr key) const override
double myChargingPower
Charging power pro timestep.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
double myEfficiency
efficiency of the charge
SUMOTime myWaitingTime
waiting time before start charging
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map