Skip to content
GitLab
Explore
Sign in
Commits on Source (2)
Respond to abort message
· 09a99830
Aljaž Srebrnič
authored
Oct 21, 2018
09a99830
Fire abort event when exiting flight GameScene
· 9967c0df
Aljaž Srebrnič
authored
Oct 21, 2018
9967c0df
Show whitespace changes
Inline
Side-by-side
ksp_client.py
View file @
9967c0df
...
...
@@ -65,6 +65,7 @@ def main():
stopping
.
wait
()
stopping
.
clear
()
socket
.
send_string
(
"
events abort
"
)
print
(
"
Removing callback...
"
)
stage
.
remove_callback
(
stage_changed
)
stage
.
remove
()
...
...
lighting.py
View file @
9967c0df
...
...
@@ -34,6 +34,9 @@ class ColorManager(Thread):
def
__init__
(
self
):
super
().
__init__
()
self
.
spi
.
open
(
1
,
0
)
self
.
lights_off
()
def
lights_off
(
self
):
ws2812
.
write2812
(
self
.
spi
,
[(
0
,
0
,
0
)
*
4
])
def
get_color
(
self
):
...
...
@@ -106,6 +109,8 @@ def main():
elif
messagedata
==
b
"
stage_2_separation
"
:
burn
()
cm
.
start_fade
()
elif
messagedata
==
b
"
abort
"
:
cm
.
lights_off
()
else
:
print
(
"
Unhandled message
"
)
...
...
servo.py
View file @
9967c0df
...
...
@@ -45,6 +45,8 @@ def main():
separate_stage_one
()
elif
messagedata
==
b
"
stage_2_separation
"
:
separate_stage_two
()
elif
messagedata
==
b
"
abort
"
:
prime_stages
()
else
:
print
(
"
Unhandled message
"
)
...
...
sound.py
View file @
9967c0df
...
...
@@ -53,6 +53,8 @@ def main():
pg
.
mixer
.
Channel
(
2
).
play
(
stageTwo
)
t
=
Timer
(
30.0
,
endMission
)
t
.
start
()
elif
messagedata
==
b
"
abort
"
:
endMission
()
else
:
print
(
"
Unhandled message
"
)
...
...