Path: blob/main/src/guisim/Command_Hotkey_TrafficLight.h
169667 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file Command_Hotkey_TrafficLight.h14/// @author Jakob Erdmann15/// @date 31 Jan 202216///17// Registers custom hotkey for aborting current traffic light phase18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>23#include <utils/common/Command.h>242526// ===========================================================================27// class declarations28// ===========================================================================29class MSTrafficLightLogic;303132// ===========================================================================33// class definitions34// ===========================================================================35/**36* @class Command_Hotkey_TrafficLight37* @brief Set/unsets inductionloop override38*/39class Command_Hotkey_TrafficLight : public Command {40public:41/** @brief Constructor42*43* @param[in] tll The traffic light logic to manipulate44*/45Command_Hotkey_TrafficLight(MSTrafficLightLogic& tll);4647/// @brief Destructor48~Command_Hotkey_TrafficLight();495051/// @name Derived from Command52/// @{5354/** @brief toggles override55*56* Returns always 1.57*58* @param[in] currentTime The current simulation time (unused)59* @return Always DELTA_T (will be executed in next time step)60* @see Command61*/62SUMOTime execute(SUMOTime currentTime);63/// @}6465/// @brief register hotkey actions66static bool registerHotkey(const std::string& key, MSTrafficLightLogic& tll);6768private:6970/// @brief The traffic light logic to be manipulated71MSTrafficLightLogic& myLogic;7273private:74/// @brief Invalidated copy constructor.75Command_Hotkey_TrafficLight(const Command_Hotkey_TrafficLight&);7677/// @brief Invalidated assignment operator.78Command_Hotkey_TrafficLight& operator=(const Command_Hotkey_TrafficLight&);7980};818283