Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Open-Cube FW
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Cube
Open-Cube FW
Commits
9ab42858
Commit
9ab42858
authored
4 days ago
by
Václav Jelínek
Browse files
Options
Downloads
Patches
Plain Diff
Reset BT callback and send ko message to user when progarm downloading fails
parent
7dedd876
Branches
jv-robosoutez
No related tags found
No related merge requests found
Pipeline
#125421
canceled
4 days ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/menu.py
+17
-6
17 additions, 6 deletions
lib/menu.py
with
17 additions
and
6 deletions
lib/menu.py
+
17
−
6
View file @
9ab42858
...
...
@@ -190,7 +190,6 @@ def main():
program_name
=
cmd
[
4
:]
if
program_name
in
program_list
:
program_num
=
program_list
.
index
(
program_name
)
print
(
"
BT user command:
"
,
cmd
,
program_name
)
elif
cmd
[:
4
]
==
"
prg
"
:
program_name
=
cmd
[
4
:]
if
program_name
.
endswith
(
"
.py
"
):
...
...
@@ -208,8 +207,12 @@ def main():
robot
.
esp
.
bt_write
(
"
oc prg ok
"
)
downloading
=
2
return
with
open
(
OC_TMP_FILE
,
"
a
"
)
as
f
:
f
.
write
(
next_line
+
"
\n
"
)
try
:
with
open
(
OC_TMP_FILE
,
"
a
"
)
as
f
:
f
.
write
(
next_line
+
"
\n
"
)
except
:
downloading
=
0
robot
.
esp
.
bt_write
(
"
oc prg ko
"
)
# Initialize variables
robot_state
=
0
...
...
@@ -301,16 +304,19 @@ def main():
menu_debounce
=
1
else
:
if
menu_move_v
!=
0
:
if
current_menu
>=
Menu
.
COUNT
:
if
current_menu
>=
Menu
.
COUNT
:
# == Menu.DOWNLOADING
pass
else
:
menu_list
[
current_menu
]
+=
menu_move_v
menu_list
[
current_menu
]
%=
menu_list_size
[
current_menu
]
menu_debounce
=
1
elif
menu_move_h
!=
0
:
if
current_menu
>=
Menu
.
COUNT
:
if
current_menu
>=
Menu
.
COUNT
:
# == Menu.DOWNLOADING
current_menu
=
Menu
.
PROGRAM
menu_list
[
current_menu
]
=
0
downloading
=
0
robot
.
esp
.
bt_reset
()
robot
.
esp
.
bt_write
(
"
oc prg ko
"
)
else
:
menu_list
[
current_menu
]
=
0
current_menu
+=
menu_move_h
...
...
@@ -446,7 +452,12 @@ def main():
elif
current_menu
==
Menu
.
DOWNLOAD
:
display_fill_downloading
(
robot
,
program_name
)
if
downloading
==
2
:
if
downloading
==
0
:
robot
.
esp
.
bt_reset
()
current_menu
=
Menu
.
PROGRAM
menu_list
[
current_menu
]
=
0
menu_debounce
=
1
elif
downloading
==
2
:
robot
.
esp
.
bt_reset
()
downloading
=
0
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment