Eclipse SUMO - Simulation of Urban MObility
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-2024 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 // ===========================================================================
34 class GUIMainWindow;
35 
36 
37 // ===========================================================================
38 // class definition
39 // ===========================================================================
46 public:
49 
52 
53 
54 
56 
57 
66  GUISUMOAbstractView& parent);
67 
76  GUISUMOAbstractView& parent);
77 
84 
86  const std::string getOptionalName() const;
87 
92  void drawGL(const GUIVisualizationSettings& s) const;
94 
95 
97  void begin2TrackPhases();
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;
119  int getCurrentEarliestEndSeconds() const;
120  int getCurrentLatestEndSeconds() const;
121  int getDefaultCycleTimeSeconds() const;
122  int getCurrentTimeInCycleSeconds() const;
123  int getRunningDurationSeconds() const;
124 
125 public:
133  public:
136  GUISUMOAbstractView& parent, GUIGlObject& o);
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 
157 private:
160 
163 
166 
167 };
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 & getTLLogic() const
MSTrafficLightLogic & myTLLogic
The wrapped tl-logic.
GUIMainWindow * myApp
The main application.
void begin2TrackPhases()
Builds a GUITLLogicPhasesTrackerWindow which will receive new phases.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GUITrafficLightLogicWrapper(MSTLLogicControl &control, MSTrafficLightLogic &tll)
Constructor.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::string getOptionalName() const
Returns the value for generic parameter 'name' or ''.
Boundary getCenteringBoundary() const
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.