89 FXObject*, FXSelector,
void*) {
98 FXObject*, FXSelector,
void*) {
106 FXObject*, FXSelector,
void*) {
110 if (act !=
nullptr) {
118 if (nema !=
nullptr) {
129 FXObject*, FXSelector ,
void*) {
139 FXObject*, FXSelector sel,
void*) {
168 std::vector<MSTrafficLightLogic*> logics = vars.
getAllLogics();
169 if (logics.size() > 1) {
170 std::vector<MSTrafficLightLogic*>::const_iterator i;
172 for (i = logics.begin(); i != logics.end(); ++i, ++index) {
178 new FXMenuSeparator(ret);
181 if (offLogic ==
nullptr) {
187 if (act !=
nullptr) {
195 if (nema !=
nullptr) {
198 new FXMenuSeparator(ret);
207 new FXMenuSeparator(ret);
272 for (MSTrafficLightLogic::LaneVectorVector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
274 for (MSTrafficLightLogic::LaneVector::const_iterator j = lanes2.begin(); j != lanes2.end(); ++j) {
275 ret.
add((*j)->getShape()[-1]);
295 std::vector<MSTrafficLightLogic*> logics = vars.
getAllLogics();
314 if (curState.find_first_of(
"gG") == std::string::npos) {
318 int phaseIdx = (curPhaseIdx + 1) % phases.size();
319 std::vector<int> nextGreen;
320 while (phaseIdx != curPhaseIdx) {
321 const std::string& state = phases[phaseIdx]->getState();
322 for (
int linkIdx = 0; linkIdx < (int)state.size(); linkIdx++) {
325 nextGreen.push_back(linkIdx);
328 if (nextGreen.size() > 0) {
331 phaseIdx = (phaseIdx + 1) % phases.size();
334 for (
const int idx : nextGreen) {
338 const Position& pos = lane->getShape().back();
340 double rot =
RAD2DEG(lane->getShape().angleAt2D((
int)lane->getShape().size() - 2)) - 90;
341 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[]
GUIIcon
An enumeration of icons used by the gui applications.
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(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
static void popMatrix()
pop matrix
static void pushMatrix()
push matrix
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
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.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
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)
MSTLLogicControl & myTLLogicControl
Reference to the according tls.
int getCurrentMinDurSeconds() const
MSTrafficLightLogic & myTLLogic
The wrapped tl-logic.
MSTrafficLightLogic & getTLLogic() const
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.
int getCurrentEarliestEndSeconds() const
int getDefaultCycleTimeSeconds() const
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GUITrafficLightLogicWrapper(MSTLLogicControl &control, MSTrafficLightLogic &tll)
Constructor.
~GUITrafficLightLogicWrapper()
Destructor.
int getCurrentTimeInCycleSeconds() const
int getRunningDurationSeconds() const
int getCurrentDurationSeconds() 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.
int getCurrentMaxDurSeconds() const
void showPhases()
Builds a GUITLLogicPhasesTrackerWindow which displays the phase diagram.
int getCurrentLatestEndSeconds() 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, bool realistic=false)
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)
Representation of a lane in the micro simulation.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
A traffic lights logic which represents a tls in an off-mode.
static const SUMOTime UNSPECIFIED_DURATION
const std::string & getName() const
const std::string & getState() const
Returns the state within this phase.
std::string getBlockingVehicleIDs() const
std::string getRequestedDriveWay() const
std::string getPriorityVehicleIDs() const
std::string getBlockingDriveWayIDs() 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
MSTrafficLightLogic * getActive() 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.
std::vector< LaneVector > LaneVectorVector
Definition of a list that holds lists of lanes that do have the same attribute.
virtual const MSPhaseDefinition & getCurrentPhaseDef() const =0
Returns the definition of the current phase.
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.
const LaneVector & getLanesAt(int i) const
Returns the list of lanes that are controlled by the signals at the given position.
std::vector< MSLane * > LaneVector
Definition of the list of arrival lanes subjected to this tls.
virtual SUMOTime getLatestEnd(int step=-1) const
const std::string & getProgramID() const
Returns this tl-logic's id.
TrafficLightType getLogicType() const
Returns the type of the logic.
virtual SUMOTime getEarliestEnd(int step=-1) const
virtual const Phases & getPhases() const =0
Returns the phases of this tls program.
const LaneVectorVector & getLaneVectors() const
Returns the list of lists of all lanes controlled by this tls.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
A NEMA (adaptive) traffic light logic based on E2Detector.
bool showDetectors() const
void setShowDetectors(bool show)
const std::string & getID() const
Returns the id.
virtual 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.