Path: blob/main/tools/neteditTestFunctions/frames/network/createEdge.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 createEdge.py14# @author Pablo Alvarez Lopez15# @date 28-05-251617# imports18import time1920from ...enums.attributesEnum import attrs21from ...constants import DELAY_SELECT22from ...general.functions import focusOnFrame23from ...input.keyboard import typeKey242526def selectEdgeType():27"""28@brief select edge type29"""30# focus current frame31focusOnFrame()32# go to select button33for _ in range(attrs.edge.edgeType.select):34typeKey('tab')35# type space to press button36typeKey('space')37# wait for gl debug38time.sleep(DELAY_SELECT)394041def createNewEdgeType(existent: bool):42"""43@brief create new edge type44"""45# focus current frame46focusOnFrame()47# go to cancel button48if existent:49for _ in range(attrs.edge.edgeType.createExistent):50typeKey('tab')51else:52for _ in range(attrs.edge.edgeType.createNew):53typeKey('tab')54# type space to press button55typeKey('space')56# wait for gl debug57time.sleep(DELAY_SELECT)585960