Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
Command_Hotkey_TrafficLight Class Reference

Set/unsets inductionloop override. More...

#include <Command_Hotkey_TrafficLight.h>

Inheritance diagram for Command_Hotkey_TrafficLight:
[legend]
Collaboration diagram for Command_Hotkey_TrafficLight:
[legend]

Public Member Functions

 Command_Hotkey_TrafficLight (MSTrafficLightLogic &tll)
 Constructor.
 
virtual SUMOTime shiftTime (SUMOTime, SUMOTime, SUMOTime)
 Reschedule or deschedule the command when quick-loading state.
 
 ~Command_Hotkey_TrafficLight ()
 Destructor.
 
Derived from Command
SUMOTime execute (SUMOTime currentTime)
 toggles override
 

Static Public Member Functions

static bool registerHotkey (const std::string &key, MSTrafficLightLogic &tll)
 register hotkey actions
 

Data Fields

int priority = 0
 

Private Member Functions

 Command_Hotkey_TrafficLight (const Command_Hotkey_TrafficLight &)
 Invalidated copy constructor.
 
Command_Hotkey_TrafficLightoperator= (const Command_Hotkey_TrafficLight &)
 Invalidated assignment operator.
 

Private Attributes

MSTrafficLightLogicmyLogic
 The traffic light logic to be manipulated.
 

Detailed Description

Set/unsets inductionloop override.

Definition at line 40 of file Command_Hotkey_TrafficLight.h.

Constructor & Destructor Documentation

◆ Command_Hotkey_TrafficLight() [1/2]

Command_Hotkey_TrafficLight::Command_Hotkey_TrafficLight ( MSTrafficLightLogic tll)

Constructor.

Parameters
[in]tllThe traffic light logic to manipulate

Definition at line 31 of file Command_Hotkey_TrafficLight.cpp.

◆ ~Command_Hotkey_TrafficLight()

Command_Hotkey_TrafficLight::~Command_Hotkey_TrafficLight ( )

Destructor.

Definition at line 36 of file Command_Hotkey_TrafficLight.cpp.

◆ Command_Hotkey_TrafficLight() [2/2]

Command_Hotkey_TrafficLight::Command_Hotkey_TrafficLight ( const Command_Hotkey_TrafficLight )
private

Invalidated copy constructor.

Member Function Documentation

◆ execute()

SUMOTime Command_Hotkey_TrafficLight::execute ( SUMOTime  currentTime)
virtual

toggles override

Returns always 1.

Parameters
[in]currentTimeThe current simulation time (unused)
Returns
Always DELTA_T (will be executed in next time step)
See also
Command

Implements Command.

Definition at line 40 of file Command_Hotkey_TrafficLight.cpp.

References MSTrafficLightLogic::changeStepAndDuration(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSNet::getInstance(), MSTrafficLightLogic::getPhaseNumber(), MSNet::getTLSControl(), and myLogic.

◆ operator=()

Command_Hotkey_TrafficLight & Command_Hotkey_TrafficLight::operator= ( const Command_Hotkey_TrafficLight )
private

Invalidated assignment operator.

◆ registerHotkey()

bool Command_Hotkey_TrafficLight::registerHotkey ( const std::string &  key,
MSTrafficLightLogic tll 
)
static

register hotkey actions

Definition at line 48 of file Command_Hotkey_TrafficLight.cpp.

References GUINet::addHotkey(), MSNet::getInstance(), gn, TL, and WRITE_WARNINGF.

Referenced by GUINet::createTLWrapper().

Here is the caller graph for this function:

◆ shiftTime()

virtual SUMOTime Command::shiftTime ( SUMOTime  ,
SUMOTime  ,
SUMOTime   
)
inlinevirtualinherited

Reschedule or deschedule the command when quick-loading state.

The implementations should return -1 if the command shall not be re-scheduled, or a value >= 0 that describe the new time at which the command shall be executed again.

Parameters
[in]currentTimeThe current simulation time
[in]execTimeThe time at which the command would have been executed
[in]newTimeThe simulation time at which the simulation is restarted
Returns
The time at which the command shall be executed again

Reimplemented in MSTrafficLightLogic::SwitchCommand, and MSCalibrator::CalibratorCommand.

Definition at line 83 of file Command.h.

Field Documentation

◆ myLogic

MSTrafficLightLogic& Command_Hotkey_TrafficLight::myLogic
private

The traffic light logic to be manipulated.

Definition at line 72 of file Command_Hotkey_TrafficLight.h.

Referenced by execute().

◆ priority

int Command::priority = 0
inherited

The documentation for this class was generated from the following files: