Path: blob/main/src/netedit/elements/additional/GNEChargingStation.h
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNEChargingStation.h14/// @author Pablo Alvarez Lopez15/// @date Nov 201516///17// A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEStoppingPlace.h"2324// ===========================================================================25// class definitions26// ===========================================================================2728class GNEChargingStation : public GNEStoppingPlace {2930public:31/// @brief default Constructor of charging station32GNEChargingStation(GNENet* net);3334/**@brief Constructor of charging station35* @param[in] id charging station ID36* @param[in] net pointer to GNENet of this additional element belongs37* @param[in] filename file in which this element is stored38* @param[in] lane Lane of this StoppingPlace belongs39* @param[in] startPos Start position of the StoppingPlace40* @param[in] endPos End position of the StoppingPlace41* @param[in] name Name of busStop42* @param[in] chargingPower charging power of the charging station43* @param[in] efficiency efficiency of the charge [0,1]44* @param[in] chargeInTransit enable or disable charge in transit45* @param[in] chargeDelay delay in timeSteps in the charge46* @param[in] chargeType charge type (fuel or electric)47* @param[in] waitingTime waiting time until start charging48* @param[in] parkingAreaID parking area the charging station is located at49* @param[in] friendlyPos enable or disable friendly position50* @param[in] parameters generic parameters51*/52GNEChargingStation(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,53const double startPos, const double endPos, const std::string& name, const double chargingPower,54const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay,55const std::string& chargeType, const SUMOTime waitingTime, const std::string& parkingAreaID,56const bool friendlyPosition, const Parameterised::Map& parameters);5758/// @brief Destructor59~GNEChargingStation();6061/**@brief write additional element into a xml file62* @param[in] device device in which write parameters of additional element63*/64void writeAdditional(OutputDevice& device) const;6566/// @name Functions related with geometry of element67/// @{6869/// @brief update pre-computed geometry information70void updateGeometry();7172/// @}7374/// @name inherited from GUIGlObject75/// @{7677/**@brief Draws the object78* @param[in] s The settings for the current view (may influence drawing)79* @see GUIGlObject::drawGL80*/81void drawGL(const GUIVisualizationSettings& s) const;8283/// @}8485/// @name inherited from GNEAttributeCarrier86/// @{8788/* @brief method for getting the Attribute of an XML key89* @param[in] key The attribute key90* @return string with the value associated to key91*/92std::string getAttribute(SumoXMLAttr key) const;9394/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)95* @param[in] key The attribute key96* @return double with the value associated to key97*/98double getAttributeDouble(SumoXMLAttr key) const;99100/* @brief method for setting the attribute and letting the object perform additional changes101* @param[in] key The attribute key102* @param[in] value The new value103* @param[in] undoList The undoList on which to register changes104*/105void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);106107/* @brief method for checking if the key and their correspond attribute are valids108* @param[in] key The attribute key109* @param[in] value The value associated to key key110* @return true if the value is valid, false in other case111*/112bool isValid(SumoXMLAttr key, const std::string& value);113114/// @}115116protected:117/// @brief Charging power pro timestep118double myChargingPower = 0;119120/// @brief efficiency of the charge121double myEfficiency = 0;122123/// @brief enable or disable charge in transit124bool myChargeInTransit = false;125126/// @brief delay in the starting of charge127SUMOTime myChargeDelay = 0;128129/// @brief charging type130std::string myChargeType = "normal";131132/// @brief waiting time before start charging133SUMOTime myWaitingTime = 0;134135/// @brief parking area ID136std::string myParkingAreaID;137138private:139/// @brief set attribute after validation140void setAttribute(SumoXMLAttr key, const std::string& value);141142/// @brief Invalidated copy constructor.143GNEChargingStation(const GNEChargingStation&) = delete;144145/// @brief Invalidated assignment operator.146GNEChargingStation& operator=(const GNEChargingStation&) = delete;147};148149150