Beispiel #1
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 250000)
     cls.conn = testingtools.connect(name='TestPartsEngineMSL')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.add_engine_data('LV-T30 "Reliant" Liquid Fuel Engine', {
         'max_thrust': 215000,
         'isp': 300
     })
     cls.add_engine_data('LV-T45 "Swivel" Liquid Fuel Engine', {
         'max_thrust': 200000,
         'isp': 320
     })
     cls.add_engine_data('LV-N "Nerv" Atomic Rocket Motor', {
         'max_thrust': 60000,
         'isp': 800
     })
     cls.add_engine_data('IX-6315 "Dawn" Electric Propulsion System', {
         'max_thrust': 2000,
         'isp': 4200
     })
     cls.add_engine_data('O-10 "Puff" MonoPropellant Fuel Engine', {
         'max_thrust': 20000,
         'isp': 250
     })
     cls.add_engine_data('RT-10 "Hammer" Solid Fuel Booster', {
         'max_thrust': 227000,
         'isp': 195
     })
Beispiel #2
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 250000)
     cls.conn = testingtools.connect(name='TestPartsEngineMSL')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.add_engine_data(
         'LV-T30 "Reliant" Liquid Fuel Engine',
         {'max_thrust': 215000, 'isp': 300})
     cls.add_engine_data(
         'LV-T45 "Swivel" Liquid Fuel Engine',
         {'max_thrust': 200000, 'isp': 320})
     cls.add_engine_data(
         'LV-N "Nerv" Atomic Rocket Motor',
         {'max_thrust': 60000, 'isp': 800})
     cls.add_engine_data(
         'IX-6315 "Dawn" Electric Propulsion System',
         {'max_thrust': 2000, 'isp': 4200})
     cls.add_engine_data(
         'O-10 "Puff" MonoPropellant Fuel Engine',
         {'max_thrust': 20000, 'isp': 250})
     cls.add_engine_data(
         'RT-10 "Hammer" Solid Fuel Booster',
         {'max_thrust': 227000, 'isp': 195})
Beispiel #3
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestReferenceFrame')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.conn.space_center.active_vessel
     cls.bodies = cls.conn.space_center.bodies
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = krpc.connect(name='TestReferenceFrame')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.conn.space_center.active_vessel
     cls.bodies = cls.conn.space_center.bodies
Beispiel #5
0
 def test_orbital_speed(self):
     testingtools.set_circular_orbit('Kerbin', 100000)
     ref = self.vessel.orbit.body.non_rotating_reference_frame
     flight = self.vessel.flight(ref)
     self.check_speed(flight, ref)
     self.assertClose(2246.1, flight.speed, error=0.1)
     self.assertClose(2246.1, flight.horizontal_speed, error=0.1)
     self.assertClose(0, flight.vertical_speed, error=0.1)
Beispiel #6
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestNode')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     for node in cls.control.nodes:
         node.remove()
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsDockingPortInFlight')
     testingtools.set_circular_orbit('Kerbin', 100000)
     testingtools.remove_other_vessels()
     self.conn = krpc.connect(name='TestPartsDockingPortInFlight')
     self.sc = self.conn.space_center
     self.state = self.sc.DockingPortState
Beispiel #8
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = krpc.connect(name='TestNode')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     for node in cls.control.nodes:
         node.remove()
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsDockingPortInFlight')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     self.conn = testingtools.connect(name='TestPartsDockingPortInFlight')
     self.sc = self.conn.space_center
     self.state = self.sc.DockingPortState
Beispiel #10
0
 def test_orbital_speed(self):
     testingtools.set_circular_orbit('Kerbin', 100000)
     ref = self.vessel.orbit.body.non_rotating_reference_frame
     flight = self.vessel.flight(ref)
     self.check_speed(flight, ref)
     self.assertClose(2246.1, flight.speed, error=0.1)
     self.assertClose(2246.1, flight.horizontal_speed, error=0.1)
     self.assertClose(0, flight.vertical_speed, error=0.1)
Beispiel #11
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = krpc.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.conn.testing_tools.clear_rotation()
     cls.conn.testing_tools.apply_rotation(116, (0,0,-1))
     cls.conn.testing_tools.apply_rotation(27, (-1,0,0))
     cls.conn.testing_tools.apply_rotation(40, (0,-1,0))
Beispiel #12
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = krpc.connect()
     cls.control = cls.conn.space_center.active_vessel.control
     vessel = cls.conn.space_center.active_vessel
     cls.orbital_flight = vessel.flight(vessel.orbit.reference_frame)
Beispiel #13
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestVessel')
     cls.vtype = cls.conn.space_center.VesselType
     cls.vsituation = cls.conn.space_center.VesselSituation
     cls.vessel = cls.conn.space_center.active_vessel
     cls.far = cls.conn.space_center.far_available
Beispiel #14
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 700000)
     cls.conn = testingtools.connect(name='TestWarpInOrbit')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.maximum_rails_warp_factor = 7
     cls.landed = False
Beispiel #15
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 700000)
     cls.conn = krpc.connect(name='TestWarpInOrbit')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.maximum_rails_warp_factor = 7
     cls.landed = False
Beispiel #16
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestVessel')
     cls.vtype = cls.conn.space_center.VesselType
     cls.vsituation = cls.conn.space_center.VesselSituation
     cls.vessel = cls.conn.space_center.active_vessel
     cls.far = cls.conn.space_center.far_available
Beispiel #17
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestControl')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     cls.auto_pilot = cls.vessel.auto_pilot
     cls.orbital_flight = cls.vessel.flight(cls.vessel.orbital_reference_frame)
Beispiel #18
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestControl')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     cls.auto_pilot = cls.vessel.auto_pilot
     cls.orbital_flight = cls.vessel.flight(
         cls.vessel.orbital_reference_frame)
Beispiel #19
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.conn.testing_tools.clear_rotation()
     cls.conn.testing_tools.apply_rotation(116, (0,0,-1))
     cls.conn.testing_tools.apply_rotation(27, (-1,0,0))
     cls.conn.testing_tools.apply_rotation(40, (0,-1,0))
     cls.far = cls.conn.space_center.far_available
Beispiel #20
0
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsDockingPortInFlight')
     testingtools.set_circular_orbit('Kerbin', 100000)
     testingtools.remove_other_vessels()
     #FIXME: sleep to prevent undocking tests from running too soon and the undocked vessel
     #       getting deleted by the previous call
     time.sleep(1)
     self.conn = krpc.connect(name='TestPartsDockingPortInFlight')
     self.sc = self.conn.space_center
     self.state = self.sc.DockingPortState
Beispiel #21
0
 def test_staging(self):
     testingtools.launch_vessel_from_vab('Staging')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     self.conn = krpc.connect()
     self.control = self.conn.space_center.active_vessel.control
     for i in reversed(range(12)):
         self.assertEqual(i, self.control.current_stage)
         time.sleep(3)
         self.control.activate_next_stage()
     self.assertEqual(0, self.control.current_stage)
Beispiel #22
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Multi')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = krpc.connect(name='TestControlOtherVessel')
     next(iter(cls.conn.space_center.active_vessel.parts.docking_ports)).undock()
     cls.vessel = next(iter(filter(lambda v: v != cls.conn.space_center.active_vessel, cls.conn.space_center.vessels)))
     cls.control = cls.vessel.control
     cls.auto_pilot = cls.vessel.auto_pilot
     cls.orbital_flight = cls.vessel.flight(cls.vessel.orbital_reference_frame)
Beispiel #23
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.set_circular_orbit('Kerbin', 100000)
        cls.conn = krpc.connect()
        cls.sc = cls.conn.space_center

        cls.vessel = cls.conn.space_center.active_vessel
        cls.ref_vessel = cls.vessel.reference_frame
        cls.ref_obt_vessel = cls.vessel.orbital_reference_frame
        cls.ref_srf_vessel = cls.vessel.surface_reference_frame

        cls.bodies = cls.conn.space_center.bodies
Beispiel #24
0
    def test_pitch_control(self):
        testingtools.set_circular_orbit('Kerbin', 100000)
        self.conn.testing_tools.clear_rotation()

        self.auto_pilot.sas = False
        self.control.pitch = 1
        time.sleep(1)
        self.control.pitch = 0

        # Check flight is pitching in correct direction
        pitch = self.orbital_flight.pitch
        time.sleep(0.1)
        diff = pitch - self.orbital_flight.pitch
        self.assertGreater(diff, 0)
Beispiel #25
0
    def test_yaw_control(self):
        testingtools.set_circular_orbit('Kerbin', 100000)
        self.conn.testing_tools.clear_rotation()

        self.auto_pilot.sas = False
        self.control.yaw = 1
        time.sleep(1)
        self.control.yaw = 0

        # Check flight is yawing in correct direction
        heading = self.orbital_flight.heading
        time.sleep(0.1)
        diff = heading - self.orbital_flight.heading
        self.assertGreater(diff, 0)
Beispiel #26
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Multi')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestControlOtherVessel')
     next(iter(
         cls.conn.space_center.active_vessel.parts.docking_ports)).undock()
     cls.vessel = next(
         iter(
             filter(lambda v: v != cls.conn.space_center.active_vessel,
                    cls.conn.space_center.vessels)))
     cls.control = cls.vessel.control
     cls.auto_pilot = cls.vessel.auto_pilot
     cls.orbital_flight = cls.vessel.flight(
         cls.vessel.orbital_reference_frame)
Beispiel #27
0
    def test_roll_control(self):
        testingtools.set_circular_orbit('Kerbin', 100000)
        self.conn.testing_tools.clear_rotation()

        pitch = self.orbital_flight.pitch
        heading = self.orbital_flight.heading

        self.auto_pilot.sas = False
        self.control.roll = 0.1
        time.sleep(1)
        self.control.roll = 0

        self.assertClose(pitch, self.orbital_flight.pitch, error=1)
        self.assertCloseDegrees(heading, self.orbital_flight.heading, error=1)

        # Check flight is rolling in correct direction
        roll = self.orbital_flight.roll
        time.sleep(0.1)
        diff = self.orbital_flight.roll - roll
        self.assertGreater(diff, 0)
Beispiel #28
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 250000)
     cls.conn = testingtools.connect(name='TestPartsEngineMSL')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.add_engine_data(
         'LV-T30 "Reliant" Liquid Fuel Engine',
         {'max_thrust': 215000, 'isp': 300})
     cls.add_engine_data(
         'LV-T45 "Swivel" Liquid Fuel Engine',
         {'max_thrust': 200000, 'isp': 320})
     cls.add_engine_data(
         'LV-N "Nerv" Atomic Rocket Motor',
         {'max_thrust': 60000, 'isp': 800})
     cls.add_engine_data(
         'IX-6315 "Dawn" Electric Propulsion System',
         {'max_thrust': 2000, 'isp': 4200})
     cls.add_engine_data(
         'O-10 "Puff" MonoPropellant Fuel Engine',
         {'max_thrust': 20000, 'isp': 250})
     cls.add_engine_data(
         'RT-10 "Hammer" Solid Fuel Booster',
         {'max_thrust': 227000, 'isp': 195})
     cls.add_engine_data(
         'CR-7 R.A.P.I.E.R. Engine',
         {'propellants': {'Oxidizer': 1., 'LiquidFuel': 0.818181},
          'gimballed': True,
          'gimbal_range': 3,
          'throttle_locked': False,
          'can_restart': True,
          'can_shutdown': True,
          'max_vac_thrust': 180000,
          'msl_isp': 275,
          'vac_isp': 305,
          'modes': ['AirBreathing', 'ClosedCycle'],
          'max_thrust': 180000,
          'isp': 305})
Beispiel #29
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.launch_vessel_from_vab('PartsEngine')
        testingtools.remove_other_vessels()
        testingtools.set_circular_orbit('Kerbin', 100000)
        cls.conn = krpc.connect(name='TestVesselEngines')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.control = cls.vessel.control

        cls.engines = []
        for engine in cls.vessel.parts.engines:
            if 'IntakeAir' not in engine.propellants and engine.can_shutdown:
                cls.engines.append(engine)

        thrusts = [200000, 215000, 20000, 2000, 60000]
        isps = [320, 300, 250, 4200, 800]
        vac_isps = [320, 300, 250, 4200, 800]
        msl_isps = [270, 280, 120, 100, 185]
        cls.thrust = sum(thrusts)
        cls.combined_isp = sum(thrusts) / sum(t/i for t,i in zip(thrusts, isps))
        cls.vac_combined_isp = sum(thrusts) / sum(t/i for t,i in zip(thrusts, vac_isps))
        cls.msl_combined_isp = sum(thrusts) / sum(t/i for t,i in zip(thrusts, msl_isps))
Beispiel #30
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 1000000)
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.set_circular_orbit('Kerbin', 1010000)
     cls.conn = krpc.connect(name='TestSpaceCenter')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.other_vessel = next(iter(filter(lambda v: v != cls.vessel, cls.sc.vessels)))
     cls.ref_vessel = cls.vessel.reference_frame
     bodies = cls.sc.bodies
     cls.sun = bodies['Sun']
     cls.kerbin = bodies['Kerbin']
     cls.mun = bodies['Mun']
     cls.ref_sun = cls.sun.reference_frame
     cls.ref_kerbin = cls.kerbin.reference_frame
     cls.ref_mun = cls.mun.reference_frame
     cls.ref_nr_sun = cls.sun.non_rotating_reference_frame
     cls.ref_nr_kerbin = cls.kerbin.non_rotating_reference_frame
     cls.ref_nr_mun = cls.mun.non_rotating_reference_frame
Beispiel #31
0
 def test_vessel_orbiting_kerbin(self):
     testingtools.set_circular_orbit('Kerbin', 100000)
     vessel = self.conn.space_center.active_vessel
     orbit = vessel.orbit
     self.assertEqual('Kerbin', orbit.body.name)
     self.assertClose(100000 + 600000, orbit.apoapsis, error=50)
     self.assertClose(100000 + 600000, orbit.periapsis, error=50)
     self.assertClose(100000, orbit.apoapsis_altitude, error=50)
     self.assertClose(100000, orbit.periapsis_altitude, error=50)
     self.assertClose(100000 + 600000, orbit.semi_major_axis, error=50)
     self.assertClose(100000 + 600000, orbit.semi_minor_axis, error=50)
     self.assertClose(700000, orbit.radius, error=50)
     self.assertClose(2246.1, orbit.speed, error=1)
     self.check_radius_and_speed(vessel, orbit)
     self.check_time_to_apoapsis_and_periapsis(vessel, orbit)
     #self.assertTrue(math.isnan(orbit.time_to_soi_change))
     self.assertClose(0, orbit.eccentricity, error=0.1)
     self.assertClose(0, orbit.inclination, error=0.1)
     #self.assertClose(0, orbit.longitude_of_ascending_node, error=0.1)
     #self.assertClose(0, orbit.argument_of_periapsis, error=0.1)
     #self.assertClose(0, orbit.mean_anomaly_at_epoch, error=0.1)
     #self.assertClose(0, orbit.epoch, error=0.1)
     self.check_anomalies(vessel, orbit)
Beispiel #32
0
 def test_vessel_orbiting_kerbin(self):
     testingtools.set_circular_orbit("Kerbin", 100000)
     vessel = self.conn.space_center.active_vessel
     orbit = vessel.orbit
     self.assertEqual("Kerbin", orbit.body.name)
     self.assertClose(100000 + 600000, orbit.apoapsis, error=50)
     self.assertClose(100000 + 600000, orbit.periapsis, error=50)
     self.assertClose(100000, orbit.apoapsis_altitude, error=50)
     self.assertClose(100000, orbit.periapsis_altitude, error=50)
     self.assertClose(100000 + 600000, orbit.semi_major_axis, error=50)
     self.assertClose(100000 + 600000, orbit.semi_minor_axis, error=50)
     self.assertClose(700000, orbit.radius, error=50)
     self.assertClose(2246.1, orbit.speed, error=1)
     self.check_radius_and_speed(vessel, orbit)
     self.check_time_to_apoapsis_and_periapsis(vessel, orbit)
     # self.assertTrue(math.isnan(orbit.time_to_soi_change))
     self.assertClose(0, orbit.eccentricity, error=0.1)
     self.assertClose(0, orbit.inclination, error=0.1)
     # self.assertClose(0, orbit.longitude_of_ascending_node, error=0.1)
     # self.assertClose(0, orbit.argument_of_periapsis, error=0.1)
     # self.assertClose(0, orbit.mean_anomaly_at_epoch, error=0.1)
     # self.assertClose(0, orbit.epoch, error=0.1)
     self.check_anomalies(vessel, orbit)
Beispiel #33
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 1000000)
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.set_circular_orbit('Kerbin', 1010000)
     cls.conn = testingtools.connect(name='TestSpaceCenter')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.other_vessel = next(iter(filter(lambda v: v != cls.vessel, cls.sc.vessels)))
     cls.vessel.name = 'Vessel'
     cls.other_vessel.name = 'OtherVessel'
     cls.ref_vessel = cls.vessel.reference_frame
     bodies = cls.sc.bodies
     cls.sun = bodies['Sun']
     cls.kerbin = bodies['Kerbin']
     cls.mun = bodies['Mun']
     cls.ref_sun = cls.sun.reference_frame
     cls.ref_kerbin = cls.kerbin.reference_frame
     cls.ref_mun = cls.mun.reference_frame
     cls.ref_nr_sun = cls.sun.non_rotating_reference_frame
     cls.ref_nr_kerbin = cls.kerbin.non_rotating_reference_frame
     cls.ref_nr_mun = cls.mun.non_rotating_reference_frame
Beispiel #34
0
 def setUp(self):
     testingtools.launch_vessel_from_vab('Staging')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     self.conn = krpc.connect(name='TestStaging')
Beispiel #35
0
 def test_fix(self):
     testingtools.set_circular_orbit("Kerbin", 100000)
     vessel = self.conn.space_center.active_vessel
     orbit = vessel.orbit
     self.assertClose(0, orbit.eccentricity, error=0.1)
     self.assertClose(0, orbit.inclination, error=0.1)
Beispiel #36
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.launch_vessel_from_vab('PartsEngine')
        testingtools.remove_other_vessels()
        testingtools.set_circular_orbit('Kerbin', 100000)
        cls.conn = testingtools.connect(name='TestVesselEngines')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.control = cls.vessel.control

        cls.engines = []
        for engine in cls.vessel.parts.engines:
            if 'IntakeAir' not in engine.propellants and engine.can_shutdown:
                cls.engines.append(engine)

        cls.engine_info = {
            'IX-6315 "Dawn" Electric Propulsion System': {
                'max_thrust': 2000,
                'available_thrust': 2000,
                'isp': 4200,
                'vac_isp': 4200,
                'msl_isp': 100
            },
            'LV-T45 "Swivel" Liquid Fuel Engine': {
                'max_thrust': 200000,
                'available_thrust': 200000,
                'isp': 320,
                'vac_isp': 320,
                'msl_isp': 270
            },
            'LV-T30 "Reliant" Liquid Fuel Engine': {
                'max_thrust': 215000,
                'available_thrust': 215000,
                'isp': 300,
                'vac_isp': 300,
                'msl_isp': 280
            },
            'LV-N "Nerv" Atomic Rocket Motor': {
                'max_thrust': 60000,
                'available_thrust': 60000,
                'isp': 800,
                'vac_isp': 800,
                'msl_isp': 185
            },
            'O-10 "Puff" MonoPropellant Fuel Engine': {
                'max_thrust': 20000,
                'available_thrust': 20000,
                'isp': 250,
                'vac_isp': 250,
                'msl_isp': 120
            },
            'RT-10 "Hammer" Solid Fuel Booster': {
                'max_thrust': 0,
                'available_thrust': 0,
                'isp': 195,
                'vac_isp': 195,
                'msl_isp': 170
            },
            'LV-909 "Terrier" Liquid Fuel Engine': {
                'max_thrust': 60000,
                'available_thrust': 0,
                'isp': 345,
                'vac_isp': 345,
                'msl_isp': 85
            },
            'J-33 "Wheesley" Basic Jet Engine': {
                'max_thrust': 0,
                'available_thrust': 0,
                'isp': 0,
                'vac_isp': 0,
                'msl_isp': 0
            }
        }
        max_thrusts = [x['max_thrust'] for x in cls.engine_info.values()]
        available_thrusts = [x['available_thrust'] for x in cls.engine_info.values()]
        isps = [x['isp'] for x in cls.engine_info.values()]
        vac_isps = [x['vac_isp'] for x in cls.engine_info.values()]
        msl_isps = [x['msl_isp'] for x in cls.engine_info.values()]
        cls.max_thrust = sum(max_thrusts)
        cls.available_thrust = sum(available_thrusts)
        cls.combined_isp = sum(max_thrusts) / sum(t/i if i > 0 else 0 for t,i in zip(max_thrusts, isps))
        cls.vac_combined_isp = sum(max_thrusts) / sum(t/i if i > 0 else 0 for t,i in zip(max_thrusts, vac_isps))
        cls.msl_combined_isp = sum(max_thrusts) / sum(t/i if i > 0 else 0 for t,i in zip(max_thrusts, msl_isps))
Beispiel #37
0
 def test_fix(self):
     testingtools.set_circular_orbit('Kerbin', 100000)
     vessel = self.conn.space_center.active_vessel
     orbit = vessel.orbit
     self.assertClose(0, orbit.eccentricity, error=0.1)
     self.assertClose(0, orbit.inclination, error=0.1)
Beispiel #38
0
 def setUp(self):
     testingtools.launch_vessel_from_vab('Staging')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     self.conn = testingtools.connect(name='TestStaging')
Beispiel #39
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.launch_vessel_from_vab('PartsEngine')
        testingtools.remove_other_vessels()
        testingtools.set_circular_orbit('Kerbin', 100000)
        cls.conn = testingtools.connect(name='TestVesselEngines')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.control = cls.vessel.control

        cls.engines = []
        for engine in cls.vessel.parts.engines:
            if 'IntakeAir' not in engine.propellants and engine.can_shutdown:
                cls.engines.append(engine)

        cls.engine_info = {
            'IX-6315 "Dawn" Electric Propulsion System': {
                'max_thrust': 2000,
                'available_thrust': 2000,
                'isp': 4200,
                'vac_isp': 4200,
                'msl_isp': 100
            },
            'LV-T45 "Swivel" Liquid Fuel Engine': {
                'max_thrust': 200000,
                'available_thrust': 200000,
                'isp': 320,
                'vac_isp': 320,
                'msl_isp': 270
            },
            'LV-T30 "Reliant" Liquid Fuel Engine': {
                'max_thrust': 215000,
                'available_thrust': 215000,
                'isp': 300,
                'vac_isp': 300,
                'msl_isp': 280
            },
            'LV-N "Nerv" Atomic Rocket Motor': {
                'max_thrust': 60000,
                'available_thrust': 60000,
                'isp': 800,
                'vac_isp': 800,
                'msl_isp': 185
            },
            'O-10 "Puff" MonoPropellant Fuel Engine': {
                'max_thrust': 20000,
                'available_thrust': 20000,
                'isp': 250,
                'vac_isp': 250,
                'msl_isp': 120
            },
            'RT-10 "Hammer" Solid Fuel Booster': {
                'max_thrust': 0,
                'available_thrust': 0,
                'isp': 195,
                'vac_isp': 195,
                'msl_isp': 170
            },
            'LV-909 "Terrier" Liquid Fuel Engine': {
                'max_thrust': 60000,
                'available_thrust': 0,
                'isp': 345,
                'vac_isp': 345,
                'msl_isp': 85
            },
            'J-33 "Wheesley" Basic Jet Engine': {
                'max_thrust': 0,
                'available_thrust': 0,
                'isp': 0,
                'vac_isp': 0,
                'msl_isp': 0
            }
        }
        max_thrusts = [x['max_thrust'] for x in cls.engine_info.values()]
        available_thrusts = [
            x['available_thrust'] for x in cls.engine_info.values()
        ]
        isps = [x['isp'] for x in cls.engine_info.values()]
        vac_isps = [x['vac_isp'] for x in cls.engine_info.values()]
        msl_isps = [x['msl_isp'] for x in cls.engine_info.values()]
        cls.max_thrust = sum(max_thrusts)
        cls.available_thrust = sum(available_thrusts)
        cls.combined_isp = sum(max_thrusts) / sum(
            t / i if i > 0 else 0 for t, i in zip(max_thrusts, isps))
        cls.vac_combined_isp = sum(max_thrusts) / sum(
            t / i if i > 0 else 0 for t, i in zip(max_thrusts, vac_isps))
        cls.msl_combined_isp = sum(max_thrusts) / sum(
            t / i if i > 0 else 0 for t, i in zip(max_thrusts, msl_isps))