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-2026 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;
91
92 double getClickPriority() const override;
94
95
97 void begin2TrackPhases(GUIMainWindow* app = nullptr);
98
100 void showPhases();
101
103 void switchTLSLogic(int to);
104
106 int getLinkIndex(const MSLink* const link) const;
107
109 return myTLLogic;
110 }
111
113
114 int getCurrentPhase() const;
115 std::string getCurrentPhaseName() const;
116 int getCurrentDurationSeconds() const;
117 int getCurrentMinDurSeconds() const;
118 int getCurrentMaxDurSeconds() const;
120 int getCurrentLatestEndSeconds() const;
121 int getDefaultCycleTimeSeconds() const;
123 int getRunningDurationSeconds() const;
124
125public:
133
134 public:
137
140
142 long onCmdShowPhases(FXObject*, FXSelector, void*);
143
145 long onCmdBegin2TrackPhases(FXObject*, FXSelector, void*);
146 long onCmdShowDetectors(FXObject*, FXSelector, void*);
147
148 long onCmdSwitchTLS2Off(FXObject*, FXSelector, void*);
149 long onCmdSwitchTLSLogic(FXObject*, FXSelector, void*);
150
151 protected:
154
155 };
156
157private:
160
163
166};
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.
double getClickPriority() const override
Returns the priority of receiving mouse clicks.
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.