Path: blob/main/src/guisim/Command_Hotkey_InductionLoop.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_InductionLoop.h14/// @author Jakob Erdmann15/// @date 31 Jan 202216///17// Registers custom hotkey for overriding detector value18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>23#include <map>24#include <utils/common/Command.h>252627// ===========================================================================28// class declarations29// ===========================================================================30class MSInductLoop;313233// ===========================================================================34// class definitions35// ===========================================================================36/**37* @class Command_Hotkey_InductionLoop38* @brief Set/unsets inductionloop override39*/40class Command_Hotkey_InductionLoop : public Command {41public:42/** @brief Constructor43*44* @param[in] det The Detector to manipulate45* @param[in] set whether to set or unset the override46*/47Command_Hotkey_InductionLoop(MSInductLoop* det, bool set);4849/// @brief Destructor50~Command_Hotkey_InductionLoop();515253/// @name Derived from Command54/// @{5556/** @brief toggles override57*58* Returns always 1.59*60* @param[in] currentTime The current simulation time (unused)61* @return Always DELTA_T (will be executed in next time step)62* @see Command63*/64SUMOTime execute(SUMOTime currentTime);65/// @}6667/// @brief register hotkey actions68static bool registerHotkey(const std::string& key, MSInductLoop* det);6970private:7172/// @brief The detector to be manipulated73MSInductLoop* myDetector;7475/// @brief whether the override shall be set or reset76bool mySet;777879private:80/// @brief Invalidated copy constructor.81Command_Hotkey_InductionLoop(const Command_Hotkey_InductionLoop&);8283/// @brief Invalidated assignment operator.84Command_Hotkey_InductionLoop& operator=(const Command_Hotkey_InductionLoop&);8586};878889