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.org/sumo
3 // Copyright (C) 2001-2022 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 
79  double getExaggeration(const GUIVisualizationSettings& s) const;
80 
87 
89  const std::string getOptionalName() const;
90 
95  void drawGL(const GUIVisualizationSettings& s) const;
97 
98 
100  void begin2TrackPhases();
101 
103  void showPhases();
104 
106  void switchTLSLogic(int to);
107 
109  int getLinkIndex(const MSLink* const link) const;
110 
112  return myTLLogic;
113  }
114 
116 
117  int getCurrentPhase() const;
118  std::string getCurrentPhaseName() const;
119  int getCurrentDuration() const;
120  int getCurrentMinDur() const;
121  int getCurrentMaxDur() const;
122  int getCurrentEarliestEnd() const;
123  int getCurrentLatestEnd() const;
124  int getDefaultCycleTime() const;
125  int getCurrentTimeInCycle() const;
126  int getRunningDuration() const;
127 
128 public:
136  public:
139  GUISUMOAbstractView& parent, GUIGlObject& o);
140 
143 
145  long onCmdShowPhases(FXObject*, FXSelector, void*);
146 
148  long onCmdBegin2TrackPhases(FXObject*, FXSelector, void*);
149  long onCmdShowDetectors(FXObject*, FXSelector, void*);
150 
151  long onCmdSwitchTLS2Off(FXObject*, FXSelector, void*);
152  long onCmdSwitchTLSLogic(FXObject*, FXSelector, void*);
153 
154  protected:
157 
158  };
159 
160 private:
163 
166 
169 
170 };
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 ''.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
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.