Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/neteditTestFunctions/frames/network/crossing.py
169686 views
1
# -*- coding: utf-8 -*-
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2009-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 crossing.py
15
# @author Pablo Alvarez Lopez
16
# @date 28-05-25
17
18
# imports
19
from ...enums.attributesEnum import attrs
20
from ...general.functions import focusOnFrame
21
from ...input.keyboard import typeKey, updateText
22
23
24
def createCrossing(hasTLS):
25
"""
26
@brief create crossing
27
"""
28
# focus current frame
29
focusOnFrame()
30
# jump to create crossing button depending of hasTLS
31
if hasTLS:
32
for _ in range(attrs.crossing.createTLS.button):
33
typeKey('tab')
34
else:
35
for _ in range(attrs.crossing.create.button):
36
typeKey('tab')
37
# type space to create crossing
38
typeKey('space')
39
40
41
def modifyCrossingDefaultValue(numtabs, value):
42
"""
43
@brief change default int/real/string crossing default value
44
"""
45
# focus current frame
46
focusOnFrame()
47
# jump to value
48
for _ in range(numtabs + attrs.crossing.firstField):
49
typeKey('tab')
50
# paste the new value
51
updateText(value)
52
# type enter to save change
53
typeKey('enter')
54
55
56
def modifyCrossingDefaultBoolValue(numtabs):
57
"""
58
@brief change default boolean crossing default value
59
"""
60
# focus current frame
61
focusOnFrame()
62
# jump to value
63
for _ in range(numtabs + attrs.crossing.firstField):
64
typeKey('tab')
65
# type space to change value
66
typeKey('space')
67
68
69
def crossingClearEdges():
70
"""
71
@brief clear crossing
72
"""
73
# focus current frame
74
focusOnFrame()
75
# jump to clear button
76
for _ in range(attrs.crossing.clearEdges):
77
typeKey('tab')
78
# type space to activate button
79
typeKey('space')
80
81
82
def crossingInvertEdges():
83
"""
84
@brief invert crossing
85
"""
86
# focus current frame
87
focusOnFrame()
88
# jump to invert button
89
for _ in range(attrs.crossing.invertEdges):
90
typeKey('tab')
91
# type space to activate button
92
typeKey('space')
93
94