|
@@ -42,8 +42,7 @@ button.rect_transform.position = (0, 0)
|
42
|
42
|
button_clicked = conn.add_stream(getattr, button, 'clicked')
|
43
|
43
|
|
44
|
44
|
f = open(datafile, 'w')
|
45
|
|
-f.write('timepoint, current_altitude, v_speed, h_speed, mass, fuel, available_thrust, current_thrust, g_force\n')
|
46
|
|
-timepoint = 0
|
|
45
|
+f.write('mission_time, current_altitude, v_speed, h_speed, mass, electric_charge, liquid_fuel, oxidizer, available_thrust, current_thrust, g_force\n')
|
47
|
46
|
|
48
|
47
|
vessel = conn.space_center.active_vessel
|
49
|
48
|
body = vessel.orbit.body
|
|
@@ -57,14 +56,12 @@ while button_clicked() == False:
|
57
|
56
|
v_speed = vessel.flight(r_frame).vertical_speed
|
58
|
57
|
h_speed = vessel.flight(r_frame).horizontal_speed
|
59
|
58
|
c_thrust = vessel.thrust
|
|
59
|
+ e_charge = vessel.resources.amount('ElectricCharge')
|
|
60
|
+ lf = vessel.resources.amount('LiquidFuel')
|
|
61
|
+ ox = vessel.resources.amount('Oxidizer')
|
60
|
62
|
g_force = vessel.flight(r_frame).g_force
|
61
|
|
- f.write('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}\n'.format(timepoint,
|
62
|
|
- current_altitude,
|
63
|
|
- v_speed, h_speed,
|
64
|
|
- vm, vm -
|
65
|
|
- dry_mass, at,
|
66
|
|
- c_thrust, g_force))
|
67
|
|
- timepoint = timepoint + 1
|
|
63
|
+ timept = vessel.met
|
|
64
|
+ f.write('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}\n'.format(timept, current_altitude, v_speed, h_speed, vm, e_charge, lf, ox, at, c_thrust, g_force))
|
68
|
65
|
time.sleep(0.1)
|
69
|
66
|
|
70
|
67
|
f.close()
|