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

Set/unsets inductionloop override. More...

#include <Command_Hotkey_InductionLoop.h>

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

Public Member Functions

 Command_Hotkey_InductionLoop (MSInductLoop *det, bool set)
 Constructor.
 
virtual SUMOTime shiftTime (SUMOTime, SUMOTime, SUMOTime)
 Reschedule or deschedule the command when quick-loading state.
 
 ~Command_Hotkey_InductionLoop ()
 Destructor.
 
Derived from Command
SUMOTime execute (SUMOTime currentTime)
 toggles override
 

Static Public Member Functions

static bool registerHotkey (const std::string &key, MSInductLoop *det)
 register hotkey actions
 

Data Fields

int priority = 0
 

Private Member Functions

 Command_Hotkey_InductionLoop (const Command_Hotkey_InductionLoop &)
 Invalidated copy constructor.
 
Command_Hotkey_InductionLoopoperator= (const Command_Hotkey_InductionLoop &)
 Invalidated assignment operator.
 

Private Attributes

MSInductLoopmyDetector
 The detector to be manipulated.
 
bool mySet
 whether the override shall be set or reset
 

Detailed Description

Set/unsets inductionloop override.

Definition at line 41 of file Command_Hotkey_InductionLoop.h.

Constructor & Destructor Documentation

◆ Command_Hotkey_InductionLoop() [1/2]

Command_Hotkey_InductionLoop::Command_Hotkey_InductionLoop ( MSInductLoop det,
bool  set 
)

Constructor.

Parameters
[in]detThe Detector to manipulate
[in]setwhether to set or unset the override

Definition at line 31 of file Command_Hotkey_InductionLoop.cpp.

◆ ~Command_Hotkey_InductionLoop()

Command_Hotkey_InductionLoop::~Command_Hotkey_InductionLoop ( )

Destructor.

Definition at line 36 of file Command_Hotkey_InductionLoop.cpp.

◆ Command_Hotkey_InductionLoop() [2/2]

Command_Hotkey_InductionLoop::Command_Hotkey_InductionLoop ( const Command_Hotkey_InductionLoop )
private

Invalidated copy constructor.

Member Function Documentation

◆ execute()

SUMOTime Command_Hotkey_InductionLoop::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_InductionLoop.cpp.

References myDetector, mySet, and MSInductLoop::overrideTimeSinceDetection().

◆ operator=()

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

Invalidated assignment operator.

◆ registerHotkey()

bool Command_Hotkey_InductionLoop::registerHotkey ( const std::string &  key,
MSInductLoop det 
)
static

register hotkey actions

Definition at line 47 of file Command_Hotkey_InductionLoop.cpp.

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

Referenced by GUIInductLoop::buildDetectorGUIRepresentation().

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

◆ myDetector

MSInductLoop* Command_Hotkey_InductionLoop::myDetector
private

The detector to be manipulated.

Definition at line 74 of file Command_Hotkey_InductionLoop.h.

Referenced by execute().

◆ mySet

bool Command_Hotkey_InductionLoop::mySet
private

whether the override shall be set or reset

Definition at line 77 of file Command_Hotkey_InductionLoop.h.

Referenced by execute().

◆ priority

int Command::priority = 0
inherited

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