Line data Source code
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 : /****************************************************************************/
14 : /// @file GUITrafficLightLogicWrapper.cpp
15 : /// @author Daniel Krajzewicz
16 : /// @author Jakob Erdmann
17 : /// @author Michael Behrisch
18 : /// @author Laura Bieker
19 : /// @date Oct/Nov 2003
20 : ///
21 : // A wrapper for tl-logics to allow their visualisation and interaction
22 : /****************************************************************************/
23 : #include <config.h>
24 :
25 : #include <cassert>
26 : #include <utils/common/MsgHandler.h>
27 : #include <utils/geom/GeomHelper.h>
28 : #include <utils/gui/globjects/GUIGlObject.h>
29 : #include <utils/gui/div/GLObjectValuePassConnector.h>
30 : #include <utils/gui/windows/GUIAppEnum.h>
31 : #include <utils/gui/images/GUIIconSubSys.h>
32 : #include <utils/gui/div/GLHelper.h>
33 : #include <utils/gui/div/GUIParameterTableWindow.h>
34 : #include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
35 : #include <utils/gui/div/GUIGlobalSelection.h>
36 : #include <microsim/MSLane.h>
37 : #include <microsim/traffic_lights/MSTrafficLightLogic.h>
38 : #include <microsim/traffic_lights/MSTLLogicControl.h>
39 : #include <microsim/traffic_lights/MSOffTrafficLightLogic.h>
40 : #include <microsim/traffic_lights/MSActuatedTrafficLightLogic.h>
41 : #include <microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h>
42 : #include <microsim/traffic_lights/NEMAController.h>
43 : #include <microsim/traffic_lights/MSRailSignal.h>
44 : #include <microsim/logging/FunctionBinding.h>
45 : #include <microsim/logging/FuncBinding_StringParam.h>
46 : #include <gui/GUIApplicationWindow.h>
47 : #include <gui/GUITLLogicPhasesTrackerWindow.h>
48 : #include <gui/GUIGlobals.h>
49 : #include <utils/gui/globjects/GLIncludes.h>
50 : #include <utils/gui/div/GUIDesigns.h>
51 :
52 : #include "GUITrafficLightLogicWrapper.h"
53 : #include "GUINet.h"
54 :
55 : // ===========================================================================
56 : // FOX callback mapping
57 : // ===========================================================================
58 : FXDEFMAP(GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu)
59 : GUITrafficLightLogicWrapperPopupMenuMap[] = {
60 : FXMAPFUNC(SEL_COMMAND, MID_SHOWPHASES, GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdShowPhases),
61 : FXMAPFUNC(SEL_COMMAND, MID_TRACKPHASES, GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdBegin2TrackPhases),
62 : FXMAPFUNC(SEL_COMMAND, MID_SHOW_DETECTORS, GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdShowDetectors),
63 : FXMAPFUNC(SEL_COMMAND, MID_SWITCH_OFF, GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLS2Off),
64 : FXMAPFUNCS(SEL_COMMAND, MID_SWITCH, MID_SWITCH + 20, GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLSLogic),
65 : };
66 :
67 : // Object implementation
68 0 : FXIMPLEMENT(GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu, GUIGLObjectPopupMenu, GUITrafficLightLogicWrapperPopupMenuMap, ARRAYNUMBER(GUITrafficLightLogicWrapperPopupMenuMap))
69 :
70 :
71 : // ===========================================================================
72 : // method definitions
73 : // ===========================================================================
74 : /* -------------------------------------------------------------------------
75 : * GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu - methods
76 : * ----------------------------------------------------------------------- */
77 0 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::GUITrafficLightLogicWrapperPopupMenu(
78 : GUIMainWindow& app, GUISUMOAbstractView& parent,
79 0 : GUIGlObject& o)
80 0 : : GUIGLObjectPopupMenu(app, parent, o) {}
81 :
82 :
83 0 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::~GUITrafficLightLogicWrapperPopupMenu() {}
84 :
85 :
86 :
87 : long
88 0 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdBegin2TrackPhases(
89 : FXObject*, FXSelector, void*) {
90 : assert(myObject->getType() == GLO_TLLOGIC);
91 0 : static_cast<GUITrafficLightLogicWrapper*>(myObject)->begin2TrackPhases();
92 0 : return 1;
93 : }
94 :
95 :
96 : long
97 0 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdShowPhases(
98 : FXObject*, FXSelector, void*) {
99 : assert(myObject->getType() == GLO_TLLOGIC);
100 0 : static_cast<GUITrafficLightLogicWrapper*>(myObject)->showPhases();
101 0 : return 1;
102 : }
103 :
104 : long
105 0 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdShowDetectors(
106 : FXObject*, FXSelector, void*) {
107 : assert(myObject->getType() == GLO_TLLOGIC);
108 0 : GUITrafficLightLogicWrapper* w = static_cast<GUITrafficLightLogicWrapper*>(myObject);
109 0 : MSActuatedTrafficLightLogic* act = dynamic_cast<MSActuatedTrafficLightLogic*>(&w->getTLLogic());
110 0 : if (act != nullptr) {
111 0 : act->setShowDetectors(!act->showDetectors());
112 : } else {
113 0 : MSDelayBasedTrafficLightLogic* db = dynamic_cast<MSDelayBasedTrafficLightLogic*>(&w->getTLLogic());
114 0 : if (db != nullptr) {
115 0 : db->setShowDetectors(!db->showDetectors());
116 : } else {
117 0 : NEMALogic* nema = dynamic_cast<NEMALogic*>(&w->getTLLogic());
118 0 : if (nema != nullptr) {
119 0 : nema->setShowDetectors(!nema->showDetectors());
120 : }
121 : }
122 : }
123 0 : myParent->update();
124 0 : return 1;
125 : }
126 :
127 : long
128 0 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLS2Off(
129 : FXObject*, FXSelector /*sel*/, void*) {
130 : assert(myObject->getType() == GLO_TLLOGIC);
131 0 : static_cast<GUITrafficLightLogicWrapper*>(myObject)->switchTLSLogic(-1);
132 0 : myParent->update();
133 0 : return 1;
134 : }
135 :
136 :
137 : long
138 0 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLSLogic(
139 : FXObject*, FXSelector sel, void*) {
140 : assert(myObject->getType() == GLO_TLLOGIC);
141 0 : static_cast<GUITrafficLightLogicWrapper*>(myObject)->switchTLSLogic(FXSELID(sel) - MID_SWITCH);
142 0 : myParent->update();
143 0 : return 1;
144 : }
145 :
146 :
147 :
148 : /* -------------------------------------------------------------------------
149 : * GUITrafficLightLogicWrapper - methods
150 : * ----------------------------------------------------------------------- */
151 19809 : GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapper(MSTLLogicControl& control, MSTrafficLightLogic& tll) :
152 : GUIGlObject(GLO_TLLOGIC, tll.getID(), GUIIconSubSys::getIcon(GUIIcon::LOCATETLS)),
153 19809 : myTLLogicControl(control), myTLLogic(tll) {
154 19809 : }
155 :
156 :
157 39584 : GUITrafficLightLogicWrapper::~GUITrafficLightLogicWrapper() {}
158 :
159 :
160 : GUIGLObjectPopupMenu*
161 0 : GUITrafficLightLogicWrapper::getPopUpMenu(GUIMainWindow& app,
162 : GUISUMOAbstractView& parent) {
163 0 : myApp = &app;
164 0 : GUIGLObjectPopupMenu* ret = new GUITrafficLightLogicWrapperPopupMenu(app, parent, *this);
165 0 : buildPopupHeader(ret, app);
166 0 : buildCenterPopupEntry(ret);
167 0 : const MSTLLogicControl::TLSLogicVariants& vars = myTLLogicControl.get(myTLLogic.getID());
168 0 : std::vector<MSTrafficLightLogic*> logics = vars.getAllLogics();
169 0 : if (logics.size() > 1) {
170 : std::vector<MSTrafficLightLogic*>::const_iterator i;
171 : int index = 0;
172 0 : for (i = logics.begin(); i != logics.end(); ++i, ++index) {
173 0 : if (!vars.isActive(*i) && dynamic_cast<MSOffTrafficLightLogic*>(*i) == nullptr) {
174 0 : GUIDesigns::buildFXMenuCommand(ret, TLF("Switch to '%'", (*i)->getProgramID()),
175 0 : GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, (FXSelector)(MID_SWITCH + index));
176 : }
177 : }
178 0 : new FXMenuSeparator(ret);
179 : }
180 0 : MSOffTrafficLightLogic* offLogic = dynamic_cast<MSOffTrafficLightLogic*>(vars.getActive());
181 0 : if (offLogic == nullptr) {
182 0 : GUIDesigns::buildFXMenuCommand(ret, TL("Switch off"), GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, MID_SWITCH_OFF);
183 : }
184 0 : GUIDesigns::buildFXMenuCommand(ret, TL("Track Phases"), nullptr, ret, MID_TRACKPHASES);
185 0 : GUIDesigns::buildFXMenuCommand(ret, TL("Show Phases"), nullptr, ret, MID_SHOWPHASES);
186 0 : MSActuatedTrafficLightLogic* act = dynamic_cast<MSActuatedTrafficLightLogic*>(&myTLLogic);
187 0 : if (act != nullptr) {
188 0 : GUIDesigns::buildFXMenuCommand(ret, act->showDetectors() ? TL("Hide Detectors") : TL("Show Detectors"), nullptr, ret, MID_SHOW_DETECTORS);
189 : }
190 0 : MSDelayBasedTrafficLightLogic* db = dynamic_cast<MSDelayBasedTrafficLightLogic*>(&myTLLogic);
191 0 : if (db != nullptr) {
192 0 : GUIDesigns::buildFXMenuCommand(ret, db->showDetectors() ? TL("Hide Detectors") : TL("Show Detectors"), nullptr, ret, MID_SHOW_DETECTORS);
193 : }
194 0 : NEMALogic* nema = dynamic_cast<NEMALogic*>(&myTLLogic);
195 0 : if (nema != nullptr) {
196 0 : GUIDesigns::buildFXMenuCommand(ret, nema->showDetectors() ? TL("Hide Detectors") : TL("Show Detectors"), nullptr, ret, MID_SHOW_DETECTORS);
197 : }
198 0 : new FXMenuSeparator(ret);
199 0 : MSTrafficLightLogic* tll = getActiveTLLogic();
200 0 : buildNameCopyPopupEntry(ret);
201 0 : buildSelectionPopupEntry(ret);
202 0 : GUIDesigns::buildFXMenuCommand(ret, TLF("Phase: %", toString(tll->getCurrentPhaseIndex())), nullptr, nullptr, 0);
203 0 : const std::string& name = tll->getCurrentPhaseDef().getName();
204 0 : if (name != "") {
205 0 : GUIDesigns::buildFXMenuCommand(ret, TLF("Phase name: %", name), nullptr, nullptr, 0);
206 : }
207 0 : new FXMenuSeparator(ret);
208 0 : buildShowParamsPopupEntry(ret, false);
209 0 : buildPositionCopyEntry(ret, app);
210 0 : return ret;
211 : }
212 :
213 :
214 : void
215 0 : GUITrafficLightLogicWrapper::begin2TrackPhases() {
216 : GUITLLogicPhasesTrackerWindow* window =
217 0 : new GUITLLogicPhasesTrackerWindow(*myApp, myTLLogic, *this,
218 : new FuncBinding_StringParam<MSTLLogicControl, std::pair<SUMOTime, MSPhaseDefinition> >
219 0 : (&MSNet::getInstance()->getTLSControl(), &MSTLLogicControl::getPhaseDef, myTLLogic.getID()));
220 0 : window->create();
221 0 : window->show();
222 0 : }
223 :
224 :
225 : void
226 0 : GUITrafficLightLogicWrapper::showPhases() {
227 : GUITLLogicPhasesTrackerWindow* window =
228 0 : new GUITLLogicPhasesTrackerWindow(*myApp, myTLLogic, *this,
229 0 : static_cast<MSSimpleTrafficLightLogic&>(myTLLogic).getPhases());
230 0 : window->setBeginTime(0);
231 0 : window->create();
232 0 : window->show();
233 0 : }
234 :
235 :
236 : GUIParameterTableWindow*
237 0 : GUITrafficLightLogicWrapper::getParameterWindow(GUIMainWindow& app,
238 : GUISUMOAbstractView&) {
239 0 : GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this);
240 0 : ret->mkItem(TL("tlLogic [id]"), false, myTLLogic.getID());
241 0 : ret->mkItem(TL("type"), false, toString(myTLLogic.getLogicType()));
242 0 : ret->mkItem(TL("program"), false, myTLLogic.getProgramID());
243 0 : ret->mkItem(TL("phase"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getCurrentPhase));
244 0 : ret->mkItem(TL("phase name"), true, new FunctionBindingString<GUITrafficLightLogicWrapper>(this, &GUITrafficLightLogicWrapper::getCurrentPhaseName));
245 0 : ret->mkItem(TL("duration"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getCurrentDurationSeconds));
246 0 : ret->mkItem(TL("minDur"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getCurrentMinDurSeconds));
247 0 : ret->mkItem(TL("maxDur"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getCurrentMaxDurSeconds));
248 0 : ret->mkItem(TL("running duration"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getRunningDurationSeconds));
249 0 : ret->mkItem(TL("earliestEnd"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getCurrentEarliestEndSeconds));
250 0 : ret->mkItem(TL("latestEnd"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getCurrentLatestEndSeconds));
251 0 : ret->mkItem(TL("time in cycle"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getCurrentTimeInCycleSeconds));
252 0 : ret->mkItem(TL("cycle time"), true, new FunctionBinding<GUITrafficLightLogicWrapper, int>(this, &GUITrafficLightLogicWrapper::getDefaultCycleTimeSeconds));
253 0 : MSRailSignal* rs = dynamic_cast<MSRailSignal*>(&myTLLogic);
254 0 : if (rs != nullptr) {
255 0 : ret->mkItem(TL("blocking"), true, new FunctionBindingString<MSRailSignal>(rs, &MSRailSignal::getBlockingVehicleIDs));
256 0 : ret->mkItem(TL("rival"), true, new FunctionBindingString<MSRailSignal>(rs, &MSRailSignal::getRivalVehicleIDs));
257 0 : ret->mkItem(TL("priority"), true, new FunctionBindingString<MSRailSignal>(rs, &MSRailSignal::getPriorityVehicleIDs));
258 0 : ret->mkItem(TL("constraint"), true, new FunctionBindingString<MSRailSignal>(rs, &MSRailSignal::getConstraintInfo));
259 : }
260 : // close building
261 0 : ret->closeBuilding(&myTLLogic);
262 0 : return ret;
263 : }
264 :
265 :
266 : Boundary
267 19809 : GUITrafficLightLogicWrapper::getCenteringBoundary() const {
268 19809 : Boundary ret;
269 19809 : const MSTrafficLightLogic::LaneVectorVector& lanes = myTLLogic.getLaneVectors();
270 225729 : for (MSTrafficLightLogic::LaneVectorVector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
271 : const MSTrafficLightLogic::LaneVector& lanes2 = (*i);
272 411528 : for (MSTrafficLightLogic::LaneVector::const_iterator j = lanes2.begin(); j != lanes2.end(); ++j) {
273 205608 : ret.add((*j)->getShape()[-1]);
274 : }
275 : }
276 19809 : ret.grow(20);
277 19809 : return ret;
278 0 : }
279 :
280 : const std::string
281 0 : GUITrafficLightLogicWrapper::getOptionalName() const {
282 0 : return myTLLogic.getParameter("name", "");
283 : }
284 :
285 :
286 : void
287 0 : GUITrafficLightLogicWrapper::switchTLSLogic(int to) {
288 0 : if (to == -1) {
289 0 : myTLLogicControl.switchTo(myTLLogic.getID(), "off");
290 0 : GUINet::getGUIInstance()->createTLWrapper(getActiveTLLogic());
291 : } else {
292 0 : const MSTLLogicControl::TLSLogicVariants& vars = myTLLogicControl.get(myTLLogic.getID());
293 0 : std::vector<MSTrafficLightLogic*> logics = vars.getAllLogics();
294 0 : myTLLogicControl.switchTo(myTLLogic.getID(), logics[to]->getProgramID());
295 : }
296 0 : }
297 :
298 :
299 : int
300 0 : GUITrafficLightLogicWrapper::getLinkIndex(const MSLink* const link) const {
301 0 : return myTLLogic.getLinkIndex(link);
302 : }
303 :
304 :
305 : void
306 606673 : GUITrafficLightLogicWrapper::drawGL(const GUIVisualizationSettings& s) const {
307 606673 : if (s.gaming) {
308 0 : if (!MSNet::getInstance()->getTLSControl().isActive(&myTLLogic) || myTLLogic.getPhases().size() == 0) {
309 0 : return;
310 : }
311 0 : const std::string& curState = myTLLogic.getCurrentPhaseDef().getState();
312 0 : if (curState.find_first_of("gG") == std::string::npos) {
313 : // no link is 'green' at the moment. find those that turn green next
314 0 : const MSTrafficLightLogic::Phases& phases = myTLLogic.getPhases();
315 0 : int curPhaseIdx = myTLLogic.getCurrentPhaseIndex();
316 0 : int phaseIdx = (curPhaseIdx + 1) % phases.size();
317 : std::vector<int> nextGreen;
318 0 : while (phaseIdx != curPhaseIdx) {
319 0 : const std::string& state = phases[phaseIdx]->getState();
320 0 : for (int linkIdx = 0; linkIdx < (int)state.size(); linkIdx++) {
321 0 : if ((LinkState)state[linkIdx] == LINKSTATE_TL_GREEN_MINOR ||
322 : (LinkState)state[linkIdx] == LINKSTATE_TL_GREEN_MAJOR) {
323 0 : nextGreen.push_back(linkIdx);
324 : }
325 : }
326 0 : if (nextGreen.size() > 0) {
327 : break;
328 : }
329 0 : phaseIdx = (phaseIdx + 1) % phases.size();
330 : }
331 : // highlight nextGreen links
332 0 : for (const int idx : nextGreen) {
333 0 : for (const MSLane* const lane : myTLLogic.getLanesAt(idx)) {
334 0 : GLHelper::pushMatrix();
335 : // split circle in red and yellow
336 : const Position& pos = lane->getShape().back();
337 0 : glTranslated(pos.x(), pos.y(), GLO_MAX);
338 0 : double rot = RAD2DEG(lane->getShape().angleAt2D((int)lane->getShape().size() - 2)) - 90;
339 0 : glRotated(rot, 0, 0, 1);
340 0 : GLHelper::setColor(s.getLinkColor(LINKSTATE_TL_RED));
341 0 : GLHelper::drawFilledCircle(lane->getWidth() / 2., 8, -90, 90);
342 0 : GLHelper::setColor(s.getLinkColor(LINKSTATE_TL_YELLOW_MAJOR));
343 0 : GLHelper::drawFilledCircle(lane->getWidth() / 2., 8, 90, 270);
344 0 : GLHelper::popMatrix();
345 : }
346 : }
347 : }
348 : }
349 : }
350 :
351 : MSTrafficLightLogic*
352 0 : GUITrafficLightLogicWrapper::getActiveTLLogic() const {
353 0 : return myTLLogicControl.getActive(myTLLogic.getID());
354 : }
355 :
356 : int
357 0 : GUITrafficLightLogicWrapper::getCurrentPhase() const {
358 0 : return getActiveTLLogic()->getCurrentPhaseIndex();
359 : }
360 :
361 : std::string
362 0 : GUITrafficLightLogicWrapper::getCurrentPhaseName() const {
363 0 : return getActiveTLLogic()->getCurrentPhaseDef().getName();
364 : }
365 :
366 : int
367 0 : GUITrafficLightLogicWrapper::getCurrentDurationSeconds() const {
368 0 : return (int)STEPS2TIME(getActiveTLLogic()->getCurrentPhaseDef().duration);
369 : }
370 :
371 : int
372 0 : GUITrafficLightLogicWrapper::getCurrentMinDurSeconds() const {
373 0 : return (int)STEPS2TIME(getActiveTLLogic()->getMinDur());
374 : }
375 :
376 : int
377 0 : GUITrafficLightLogicWrapper::getCurrentMaxDurSeconds() const {
378 0 : return (int)STEPS2TIME(getActiveTLLogic()->getMaxDur());
379 : }
380 :
381 : int
382 0 : GUITrafficLightLogicWrapper::getCurrentEarliestEndSeconds() const {
383 0 : const SUMOTime earliestEnd = getActiveTLLogic()->getEarliestEnd();
384 0 : return earliestEnd == MSPhaseDefinition::UNSPECIFIED_DURATION ? -1 : (int)STEPS2TIME(earliestEnd);
385 : }
386 :
387 : int
388 0 : GUITrafficLightLogicWrapper::getCurrentLatestEndSeconds() const {
389 0 : const SUMOTime latestEnd = getActiveTLLogic()->getLatestEnd();
390 0 : return latestEnd == MSPhaseDefinition::UNSPECIFIED_DURATION ? -1 : (int)STEPS2TIME(latestEnd);
391 : }
392 :
393 : int
394 0 : GUITrafficLightLogicWrapper::getDefaultCycleTimeSeconds() const {
395 0 : return (int)STEPS2TIME(getActiveTLLogic()->getDefaultCycleTime());
396 : }
397 :
398 : int
399 0 : GUITrafficLightLogicWrapper::getCurrentTimeInCycleSeconds() const {
400 0 : return (int)STEPS2TIME(getActiveTLLogic()->getTimeInCycle());
401 : }
402 :
403 : int
404 0 : GUITrafficLightLogicWrapper::getRunningDurationSeconds() const {
405 0 : return STEPS2TIME(getActiveTLLogic()->getSpentDuration());
406 : }
407 :
408 :
409 : /****************************************************************************/
|