Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETractionSubstation.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2021-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//
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEAdditional.h"
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
35
45 GNETractionSubstation(const std::string& id, GNENet* net, const std::string& filename, const Position& pos,
46 const double voltage, const double currentLimit, const Parameterised::Map& parameters);
47
50
53
55 GNEMoveElement* getMoveElement() const override;
56
58 Parameterised* getParameters() override;
59
61 const Parameterised* getParameters() const override;
62
64
67
71 void writeAdditional(OutputDevice& device) const override;
72
74 bool isAdditionalValid() const override;
75
77 std::string getAdditionalProblem() const override;
78
80 void fixAdditionalProblem() override;
81
83
86
88 bool checkDrawMoveContour() const override;
89
91
94
96 void updateGeometry() override;
97
99 Position getPositionInView() const override;
100
102 void updateCenteringBoundary(const bool updateGrid) override;
103
105 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
106
108
111
114 std::string getParentName() const override;
115
120 void drawGL(const GUIVisualizationSettings& s) const override;
121
123
126
127 /* @brief method for getting the Attribute of an XML key
128 * @param[in] key The attribute key
129 * @return string with the value associated to key
130 */
131 std::string getAttribute(SumoXMLAttr key) const override;
132
133 /* @brief method for getting the Attribute of an XML key in double format
134 * @param[in] key The attribute key
135 * @return double with the value associated to key
136 */
137 double getAttributeDouble(SumoXMLAttr key) const override;
138
139 /* @brief method for getting the Attribute of an XML key in position format
140 * @param[in] key The attribute key
141 * @return position with the value associated to key
142 */
143 Position getAttributePosition(SumoXMLAttr key) const override;
144
145 /* @brief method for getting the Attribute of an XML key in positionVector format
146 * @param[in] key The attribute key
147 * @return positionVector with the value associated to key
148 */
150
151 /* @brief method for setting the attribute and letting the object perform additional changes
152 * @param[in] key The attribute key
153 * @param[in] value The new value
154 * @param[in] undoList The undoList on which to register changes
155 */
156 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
157
158 /* @brief method for checking if the key and their correspond attribute are valids
159 * @param[in] key The attribute key
160 * @param[in] value The value associated to key key
161 * @return true if the value is valid, false in other case
162 */
163 bool isValid(SumoXMLAttr key, const std::string& value) override;
164
166 std::string getPopUpID() const override;
167
169 std::string getHierarchyName() const override;
170
172
173protected:
175 double myVoltage = 0;
176
178 double myCurrentLimit = 0;
179
180private:
182 void setAttribute(SumoXMLAttr key, const std::string& value) override;
183
186
189};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
Position getAttributePosition(SumoXMLAttr key) const override
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
double myCurrentLimit
current limit
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
std::string getAttribute(SumoXMLAttr key) const override
GNETractionSubstation(const GNETractionSubstation &)=delete
Invalidated copy constructor.
Position getPositionInView() const override
Returns position of additional in view.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Parameterised * getParameters() override
get parameters associated with this tractionSubstation
double getAttributeDouble(SumoXMLAttr key) const override
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
bool checkDrawMoveContour() const override
check if draw move contour (red)
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getParentName() const override
Returns the name of the parent object.
GNETractionSubstation & operator=(const GNETractionSubstation &)=delete
Invalidated assignment operator.
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this tractionSubstation
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
bool isValid(SumoXMLAttr key, const std::string &value) override
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.