Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/guisim/Command_Hotkey_TrafficLight.h
169667 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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 Command_Hotkey_TrafficLight.h
15
/// @author Jakob Erdmann
16
/// @date 31 Jan 2022
17
///
18
// Registers custom hotkey for aborting current traffic light phase
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <string>
24
#include <utils/common/Command.h>
25
26
27
// ===========================================================================
28
// class declarations
29
// ===========================================================================
30
class MSTrafficLightLogic;
31
32
33
// ===========================================================================
34
// class definitions
35
// ===========================================================================
36
/**
37
* @class Command_Hotkey_TrafficLight
38
* @brief Set/unsets inductionloop override
39
*/
40
class Command_Hotkey_TrafficLight : public Command {
41
public:
42
/** @brief Constructor
43
*
44
* @param[in] tll The traffic light logic to manipulate
45
*/
46
Command_Hotkey_TrafficLight(MSTrafficLightLogic& tll);
47
48
/// @brief Destructor
49
~Command_Hotkey_TrafficLight();
50
51
52
/// @name Derived from Command
53
/// @{
54
55
/** @brief toggles override
56
*
57
* Returns always 1.
58
*
59
* @param[in] currentTime The current simulation time (unused)
60
* @return Always DELTA_T (will be executed in next time step)
61
* @see Command
62
*/
63
SUMOTime execute(SUMOTime currentTime);
64
/// @}
65
66
/// @brief register hotkey actions
67
static bool registerHotkey(const std::string& key, MSTrafficLightLogic& tll);
68
69
private:
70
71
/// @brief The traffic light logic to be manipulated
72
MSTrafficLightLogic& myLogic;
73
74
private:
75
/// @brief Invalidated copy constructor.
76
Command_Hotkey_TrafficLight(const Command_Hotkey_TrafficLight&);
77
78
/// @brief Invalidated assignment operator.
79
Command_Hotkey_TrafficLight& operator=(const Command_Hotkey_TrafficLight&);
80
81
};
82
83