|
@@ -24,11 +24,23 @@ rect.size = (200, 50)
|
24
|
24
|
rect.position = (110-(screen_size[0]/2), screen_size[1]/2-75)
|
25
|
25
|
|
26
|
26
|
# Add a button to set the throttle to maximum
|
27
|
|
-button = panel.add_button("Stop monitor")
|
|
27
|
+button = panel.add_button("Start monitor")
|
28
|
28
|
button.rect_transform.position = (0, 0)
|
29
|
29
|
|
30
|
30
|
# Set up a stream to monitor the throttle button
|
31
|
31
|
button_clicked = conn.add_stream(getattr, button, 'clicked')
|
|
32
|
+
|
|
33
|
+# Wait for button
|
|
34
|
+while button_clicked() == False:
|
|
35
|
+ time.sleep(0.1)
|
|
36
|
+
|
|
37
|
+button.remove()
|
|
38
|
+
|
|
39
|
+# replace button
|
|
40
|
+button = panel.add_button("Stop monitor")
|
|
41
|
+button.rect_transform.position = (0, 0)
|
|
42
|
+button_clicked = conn.add_stream(getattr, button, 'clicked')
|
|
43
|
+
|
32
|
44
|
f = open(datafile, 'w')
|
33
|
45
|
f.write('timepoint, current_altitude, v_speed, h_speed, mass, fuel, available_thrust, current_thrust, g_force\n')
|
34
|
46
|
timepoint = 0
|