86 FXObject*, FXSelector,
void*) {
95 FXObject*, FXSelector,
void*) {
103 FXObject*, FXSelector,
void*) {
107 if (act ==
nullptr) {
119 FXObject*, FXSelector ,
void*) {
128 FXObject*, FXSelector sel,
void*) {
157 std::vector<MSTrafficLightLogic*> logics = vars.
getAllLogics();
158 if (logics.size() > 1) {
159 std::vector<MSTrafficLightLogic*>::const_iterator i;
161 for (i = logics.begin(); i != logics.end(); ++i, ++index) {
167 new FXMenuSeparator(ret);
173 if (act !=
nullptr) {
180 new FXMenuSeparator(ret);
189 new FXMenuSeparator(ret);
248 for (MSTrafficLightLogic::LaneVectorVector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
250 for (MSTrafficLightLogic::LaneVector::const_iterator j = lanes2.begin(); j != lanes2.end(); ++j) {
251 ret.
add((*j)->getShape()[-1]);
271 std::vector<MSTrafficLightLogic*> logics = vars.
getAllLogics();
290 if (curState.find_first_of(
"gG") == std::string::npos) {
294 int phaseIdx = (curPhaseIdx + 1) % phases.size();
295 std::vector<int> nextGreen;
296 while (phaseIdx != curPhaseIdx) {
297 const std::string& state = phases[phaseIdx]->getState();
298 for (
int linkIdx = 0; linkIdx < (int)state.size(); linkIdx++) {
301 nextGreen.push_back(linkIdx);
304 if (nextGreen.size() > 0) {
307 phaseIdx = (phaseIdx + 1) % phases.size();
310 for (std::vector<int>::iterator it_idx = nextGreen.begin(); it_idx != nextGreen.end(); it_idx++) {
312 for (MSTrafficLightLogic::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); it_lane++) {
315 Position pos = (*it_lane)->getShape().back();
317 double rot =
RAD2DEG((*it_lane)->getShape().angleAt2D((
int)(*it_lane)->getShape().size() - 2)) - 90;
318 glRotated(rot, 0, 0, 1);
@ MID_SWITCH_OFF
Show TLS phases - popup entry.
@ MID_TRACKPHASES
Begin to track phases - menu entry.
@ MID_SHOW_DETECTORS
show/hide actuation detectors
FXDEFMAP(GUIDialog_AppSettings) GUIDialog_AppSettingsMap[]
GUITrafficLightLogicWrapperPopupMenuMap[]
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_TL_YELLOW_MAJOR
The link has yellow light, may pass.
@ LINKSTATE_TL_GREEN_MAJOR
The link has green light, may pass.
@ LINKSTATE_TL_RED
The link has red light (must brake)
@ LINKSTATE_TL_GREEN_MINOR
The link has green light, has to brake.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void createTLWrapper(MSTrafficLightLogic *tll) override
creates a wrapper for the given logic
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
This window displays a phase diagram for a chosen tl-logic.
void setBeginTime(SUMOTime time)
Sets the time the display shall be shown as beginning at.
void create()
Creates the window (FOX-Toolkit)
int getCurrentMaxDur() const
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.
~GUITrafficLightLogicWrapper()
Destructor.
int getCurrentDuration() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::string getOptionalName() const
Returns the value for generic parameter 'name' or ''.
int getCurrentPhase() const
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.
std::string getCurrentPhaseName() const
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.
int getRunningDuration() const
int getCurrentMinDur() const
Stores the information about how to visualize structures.
bool gaming
whether the application is in gaming mode or not
static const RGBColor & getLinkColor(const LinkState &ls)
map from LinkState to color constants
An actuated (adaptive) traffic light logic.
void setShowDetectors(bool show)
bool showDetectors() const
An actuated traffic light logic based on time delay of approaching vehicles.
bool showDetectors() const
void setShowDetectors(bool show)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getState() const
Returns the state within this phase.
const std::string & getName() const
std::string getBlockingVehicleIDs() const
std::string getPriorityVehicleIDs() const
std::string getConstraintInfo() const
std::string getRivalVehicleIDs() const
A fixed traffic light logic.
Storage for all programs of a single tls.
std::vector< MSTrafficLightLogic * > getAllLogics() const
bool isActive(const MSTrafficLightLogic *tl) const
A class that stores and controls tls and switching of their programs.
std::pair< SUMOTime, MSPhaseDefinition > getPhaseDef(const std::string &tlid) const
return the complete phase definition for a named traffic lights logic
void switchTo(const std::string &id, const std::string &programID)
Switches the named (id) tls to the named (programID) program.
MSTrafficLightLogic * getActive(const std::string &id) const
Returns the active program of a named tls.
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
The parent class for traffic light logics.
virtual const MSPhaseDefinition & getCurrentPhaseDef() const =0
Returns the definition of the current phase.
std::vector< LaneVector > LaneVectorVector
Definition of a list that holds lists of lanes that do have the same attribute.
int getLinkIndex(const MSLink *const link) const
Returns the index of the given link.
virtual int getCurrentPhaseIndex() const =0
Returns the current index within the program.
std::vector< MSLane * > LaneVector
Definition of the list of arrival lanes subjected to this tls.
const LaneVectorVector & getLaneVectors() const
Returns the list of lists of all lanes controlled by this tls.
TrafficLightType getLogicType() const
Returns the type of the logic.
const LaneVector & getLanesAt(int i) const
Returns the list of lanes that are controlled by the signals at the given position.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
virtual const Phases & getPhases() const =0
Returns the phases of this tls program.
const std::string & getProgramID() const
Returns this tl-logic's id.
const std::string & getID() const
Returns the id.
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.