Path: blob/main/tools/neteditTestFunctions/frames/network/crossing.py
169686 views
# -*- coding: utf-8 -*-1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2009-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-later1213# @file crossing.py14# @author Pablo Alvarez Lopez15# @date 28-05-251617# imports18from ...enums.attributesEnum import attrs19from ...general.functions import focusOnFrame20from ...input.keyboard import typeKey, updateText212223def createCrossing(hasTLS):24"""25@brief create crossing26"""27# focus current frame28focusOnFrame()29# jump to create crossing button depending of hasTLS30if hasTLS:31for _ in range(attrs.crossing.createTLS.button):32typeKey('tab')33else:34for _ in range(attrs.crossing.create.button):35typeKey('tab')36# type space to create crossing37typeKey('space')383940def modifyCrossingDefaultValue(numtabs, value):41"""42@brief change default int/real/string crossing default value43"""44# focus current frame45focusOnFrame()46# jump to value47for _ in range(numtabs + attrs.crossing.firstField):48typeKey('tab')49# paste the new value50updateText(value)51# type enter to save change52typeKey('enter')535455def modifyCrossingDefaultBoolValue(numtabs):56"""57@brief change default boolean crossing default value58"""59# focus current frame60focusOnFrame()61# jump to value62for _ in range(numtabs + attrs.crossing.firstField):63typeKey('tab')64# type space to change value65typeKey('space')666768def crossingClearEdges():69"""70@brief clear crossing71"""72# focus current frame73focusOnFrame()74# jump to clear button75for _ in range(attrs.crossing.clearEdges):76typeKey('tab')77# type space to activate button78typeKey('space')798081def crossingInvertEdges():82"""83@brief invert crossing84"""85# focus current frame86focusOnFrame()87# jump to invert button88for _ in range(attrs.crossing.invertEdges):89typeKey('tab')90# type space to activate button91typeKey('space')929394