|
28 | 28 | from ._vehicletype import VTypeDomain
|
29 | 29 | from . import constants as tc
|
30 | 30 | from .exceptions import TraCIException, deprecated, alias_param
|
| 31 | +from ._lane import _readLinks |
31 | 32 |
|
32 | 33 |
|
33 | 34 | _legacyGetLeader = True
|
@@ -204,32 +205,6 @@ def _readNextStops(result):
|
204 | 205 | return tuple(nextStop)
|
205 | 206 |
|
206 | 207 |
|
207 |
| -def _readNextLinks(result): |
208 |
| - result.read("!Bi") # Type Compound, Length |
209 |
| - nbLinks = result.readInt() |
210 |
| - links = [] |
211 |
| - for _ in range(nbLinks): |
212 |
| - result.read("!B") # Type String |
213 |
| - approachedLane = result.readString() |
214 |
| - result.read("!B") # Type String |
215 |
| - approachedInternal = result.readString() |
216 |
| - result.read("!B") # Type Byte |
217 |
| - hasPrio = bool(result.read("!B")[0]) |
218 |
| - result.read("!B") # Type Byte |
219 |
| - isOpen = bool(result.read("!B")[0]) |
220 |
| - result.read("!B") # Type Byte |
221 |
| - hasFoe = bool(result.read("!B")[0]) |
222 |
| - result.read("!B") # Type String |
223 |
| - state = result.readString() |
224 |
| - result.read("!B") # Type String |
225 |
| - direction = result.readString() |
226 |
| - result.read("!B") # Type Float |
227 |
| - length = result.readDouble() |
228 |
| - links.append((approachedLane, hasPrio, isOpen, hasFoe, |
229 |
| - approachedInternal, state, direction, length)) |
230 |
| - return tuple(links) |
231 |
| - |
232 |
| - |
233 | 208 | def _readJunctionFoes(result):
|
234 | 209 | result.read("!Bi")
|
235 | 210 | nbJunctionFoes = result.readInt()
|
@@ -265,7 +240,7 @@ def _readJunctionFoes(result):
|
265 | 240 | tc.VAR_NEIGHBORS: _readNeighbors,
|
266 | 241 | tc.VAR_NEXT_TLS: _readNextTLS,
|
267 | 242 | tc.VAR_NEXT_STOPS: _readNextStops,
|
268 |
| - tc.VAR_NEXT_LINKS: _readNextLinks, |
| 243 | + tc.VAR_NEXT_LINKS: _readLinks, |
269 | 244 | tc.VAR_NEXT_STOPS2: _readStopData,
|
270 | 245 | tc.VAR_FOES: _readJunctionFoes,
|
271 | 246 | # ignore num compounds and type int
|
|
0 commit comments