Path: blob/main/src/netedit/elements/additional/GNEChargingStation.h
193967 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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/// @author Mirko Barthauer16/// @date Nov 201517///18// A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)19/****************************************************************************/20#pragma once21#include <config.h>2223#include "GNEStoppingPlace.h"2425// ===========================================================================26// class definitions27// ===========================================================================2829class GNEChargingStation : public GNEStoppingPlace {3031public:32/// @brief default Constructor of charging station33GNEChargingStation(GNENet* net);3435/**@brief Constructor of charging station36* @param[in] id charging station ID37* @param[in] net pointer to GNENet of this additional element belongs38* @param[in] fileBucket file in which this element is stored39* @param[in] lane Lane of this StoppingPlace belongs40* @param[in] startPos Start position of the StoppingPlace41* @param[in] endPos End position of the StoppingPlace42* @param[in] name Name of busStop43* @param[in] chargingPower charging power of the charging station44* @param[in] efficiency efficiency of the charge [0,1]45* @param[in] chargeInTransit enable or disable charge in transit46* @param[in] chargeDelay delay in timeSteps in the charge47* @param[in] chargeType charge type (fuel or electric)48* @param[in] waitingTime waiting time until start charging49* @param[in] parkingAreaID parking area the charging station is located at50* @param[in] friendlyPos enable or disable friendly position51* @param[in] parameters generic parameters52*/53GNEChargingStation(const std::string& id, GNENet* net, FileBucket* fileBucket, GNELane* lane,54const double startPos, const double endPos, const std::string& name, const double chargingPower,55const double totalPower, const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay,56const std::string& chargeType, const SUMOTime waitingTime, const std::string& parkingAreaID,57const bool friendlyPosition, const Parameterised::Map& parameters);5859/// @brief Destructor60~GNEChargingStation();6162/**@brief write additional element into a xml file63* @param[in] device device in which write parameters of additional element64*/65void writeAdditional(OutputDevice& device) const override;6667/// @name Functions related with geometry of element68/// @{6970/// @brief update pre-computed geometry information71void updateGeometry() override;7273/// @}7475/// @name inherited from GUIGlObject76/// @{7778/**@brief Draws the object79* @param[in] s The settings for the current view (may influence drawing)80* @see GUIGlObject::drawGL81*/82void drawGL(const GUIVisualizationSettings& s) const override;8384/// @}8586/// @name inherited from GNEAttributeCarrier87/// @{8889/* @brief method for getting the Attribute of an XML key90* @param[in] key The attribute key91* @return string with the value associated to key92*/93std::string getAttribute(SumoXMLAttr key) const override;9495/* @brief method for getting the Attribute of an XML key in double format96* @param[in] key The attribute key97* @return double with the value associated to key98*/99double getAttributeDouble(SumoXMLAttr key) const override;100101/* @brief method for setting the attribute and letting the object perform additional changes102* @param[in] key The attribute key103* @param[in] value The new value104* @param[in] undoList The undoList on which to register changes105*/106void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;107108/* @brief method for checking if the key and their correspond attribute are valids109* @param[in] key The attribute key110* @param[in] value The value associated to key key111* @return true if the value is valid, false in other case112*/113bool isValid(SumoXMLAttr key, const std::string& value) override;114115/// @}116117protected:118/// @brief Charging power pro timestep and vehicle119double myChargingPower = 0;120121/// @brief Charging power pro timestep across all charging vehicles122double myTotalPower = 0;123124/// @brief efficiency of the charge125double myEfficiency = 0;126127/// @brief enable or disable charge in transit128bool myChargeInTransit = false;129130/// @brief delay in the starting of charge131SUMOTime myChargeDelay = 0;132133/// @brief charging type134std::string myChargeType = "normal";135136/// @brief waiting time before start charging137SUMOTime myWaitingTime = 0;138139/// @brief parking area ID140std::string myParkingAreaID;141142private:143/// @brief set attribute after validation144void setAttribute(SumoXMLAttr key, const std::string& value) override;145146/// @brief Invalidated copy constructor.147GNEChargingStation(const GNEChargingStation&) = delete;148149/// @brief Invalidated assignment operator.150GNEChargingStation& operator=(const GNEChargingStation&) = delete;151};152153154