Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUITrafficLightLogicWrapper.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/****************************************************************************/
20// A wrapper for tl-logics to allow their visualisation and interaction
21/****************************************************************************/
22#pragma once
23#include <config.h>
24
28
29
30// ===========================================================================
31// class declarations
32// ===========================================================================
34class GUIMainWindow;
35
36
37// ===========================================================================
38// class definition
39// ===========================================================================
46public:
49
52
53
54
56
57
66
75
81 Boundary getCenteringBoundary() const override;
82
84 const std::string getOptionalName() const override;
85
90 void drawGL(const GUIVisualizationSettings& s) const override;
92
93
95 void begin2TrackPhases(GUIMainWindow* app = nullptr);
96
98 void showPhases();
99
101 void switchTLSLogic(int to);
102
104 int getLinkIndex(const MSLink* const link) const;
105
107 return myTLLogic;
108 }
109
111
112 int getCurrentPhase() const;
113 std::string getCurrentPhaseName() const;
114 int getCurrentDurationSeconds() const;
115 int getCurrentMinDurSeconds() const;
116 int getCurrentMaxDurSeconds() const;
118 int getCurrentLatestEndSeconds() const;
119 int getDefaultCycleTimeSeconds() const;
121 int getRunningDurationSeconds() const;
122
123public:
131
132 public:
135
138
140 long onCmdShowPhases(FXObject*, FXSelector, void*);
141
143 long onCmdBegin2TrackPhases(FXObject*, FXSelector, void*);
144 long onCmdShowDetectors(FXObject*, FXSelector, void*);
145
146 long onCmdSwitchTLS2Off(FXObject*, FXSelector, void*);
147 long onCmdSwitchTLSLogic(FXObject*, FXSelector, void*);
148
149 protected:
152
153 };
154
155private:
158
161
164};
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
The popup menu of a globject.
A window containing a gl-object's parameter.
long onCmdBegin2TrackPhases(FXObject *, FXSelector, void *)
Called if the phases shall be begun to track.
long onCmdShowPhases(FXObject *, FXSelector, void *)
Called if the phases shall be shown.
MSTLLogicControl & myTLLogicControl
Reference to the according tls.
MSTrafficLightLogic & myTLLogic
The wrapped tl-logic.
MSTrafficLightLogic & getTLLogic() const
GUIMainWindow * myApp
The main application.
void begin2TrackPhases(GUIMainWindow *app=nullptr)
Builds a GUITLLogicPhasesTrackerWindow which will receive new phases.
const std::string getOptionalName() const override
Returns the value for generic parameter 'name' or ''.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
MSTrafficLightLogic * getActiveTLLogic() const
void switchTLSLogic(int to)
Builds a GUITLLogicPhasesTrackerWindow which displays the phase diagram.
int getLinkIndex(const MSLink *const link) const
Returns the index of the given link within the according tls.
void showPhases()
Builds a GUITLLogicPhasesTrackerWindow which displays the phase diagram.
Stores the information about how to visualize structures.
A class that stores and controls tls and switching of their programs.
The parent class for traffic light logics.