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-2020 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 
68 
77  GUISUMOAbstractView& parent);
78 
79 
86 
88  const std::string getOptionalName() const;
89 
94  void drawGL(const GUIVisualizationSettings& s) const;
96 
97 
99  void begin2TrackPhases();
100 
102  void showPhases();
103 
105  void switchTLSLogic(int to);
106 
108  int getLinkIndex(const MSLink* const link) const;
109 
111  return myTLLogic;
112  }
113 
115 
116  int getCurrentPhase() const;
117  std::string getCurrentPhaseName() const;
118  int getCurrentDuration() const;
119  int getCurrentMinDur() const;
120  int getCurrentMaxDur() const;
121  int getRunningDuration() const;
122 
123 public:
131  public:
134  GUISUMOAbstractView& parent, GUIGlObject& o);
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 
155 private:
158 
161 
164 
165 };
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.