Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
new-socketemulator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李远洪
new-socketemulator
Commits
ec393d29
Commit
ec393d29
authored
Oct 10, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复M500模拟器轨迹跑完,反向行驶,导致数组越界问题
parent
96b4a4cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/socket/service/ProtocolSimulaterService.py
lib/socket/service/ProtocolSimulaterService.py
+4
-2
No files found.
lib/socket/service/ProtocolSimulaterService.py
View file @
ec393d29
...
@@ -168,9 +168,11 @@ class ProtocolSimulaterService():
...
@@ -168,9 +168,11 @@ class ProtocolSimulaterService():
gpsMsg
=
self
.
genGPSMsg
(
latitude
,
longitude
)
gpsMsg
=
self
.
genGPSMsg
(
latitude
,
longitude
)
if
self
.
fixPosition
==
0
:
#是否固定当前位置的判断
if
self
.
fixPosition
==
0
:
#是否固定当前位置的判断
if
self
.
travelDirection
==
0
:
if
self
.
travelDirection
==
0
:
self
.
gpsLineIndex
=
self
.
gpsLineIndex
+
1
#正向行驶
if
self
.
gpsLineIndex
<
len
(
self
.
gpsLine
):
self
.
gpsLineIndex
=
self
.
gpsLineIndex
+
1
#正向行驶
else
:
else
:
self
.
gpsLineIndex
=
self
.
gpsLineIndex
-
1
#反向行驶
if
self
.
gpsLineIndex
>
0
:
self
.
gpsLineIndex
=
self
.
gpsLineIndex
-
1
#反向行驶
elif
self
.
gpsLineIndex
==
len
(
self
.
gpsLine
)
or
self
.
gpsLineIndex
==
-
1
:
#如果反向行驶和反向行驶刚好跑完
elif
self
.
gpsLineIndex
==
len
(
self
.
gpsLine
)
or
self
.
gpsLineIndex
==
-
1
:
#如果反向行驶和反向行驶刚好跑完
if
int
(
self
.
data
[
"travelData"
][
"travelLoop"
])
==
0
:
#没有设置循环行驶
if
int
(
self
.
data
[
"travelData"
][
"travelLoop"
])
==
0
:
#没有设置循环行驶
if
self
.
travelDirection
==
0
:
if
self
.
travelDirection
==
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment