示例#1
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     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': 201000, 'isp': 280.5})
     cls.add_engine_data(
         'LV-T45 "Swivel" Liquid Fuel Engine',
         {'max_thrust': 169200, 'isp': 270.7})
     cls.add_engine_data(
         'LV-N "Nerv" Atomic Rocket Motor',
         {'max_thrust': 14300, 'isp': 190.6})
     cls.add_engine_data(
         'IX-6315 "Dawn" Electric Propulsion System',
         {'max_thrust': 63, 'isp': 128.0})
     cls.add_engine_data(
         'O-10 "Puff" MonoPropellant Fuel Engine',
         {'max_thrust': 9700, 'isp': 121.2})
     cls.add_engine_data(
         'RT-10 "Hammer" Solid Fuel Booster',
         {'max_thrust': 197897, 'isp': 170.4})
     cls.add_engine_data(
         'J-33 "Wheesley" Basic Jet Engine',
         {'max_thrust': 80000, 'isp': 9600})
示例#2
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     cls.conn = krpc.connect(name='TestFlightAtLaunchpad')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.conn.testing_tools.remove_other_vessels()
     cls.far = cls.conn.space_center.far_available
示例#3
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
     })
示例#4
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.remove_other_vessels()
        testingtools.launch_vessel_from_vab('PartsDockingPortPreAttachedTo')
        cls.conn = testingtools.connect(
            name='TestPartsDockingPortPreAttachedTo')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.state = cls.conn.space_center.DockingPortState

        # Stack is as follows, from top to bottom:
        # parts[0] - Pod
        # parts[1] - Docking port (facing down)
        # parts[2] - Docking port (facing up)
        # parts[3] - Tank
        # parts[4] - Docking port (facing up)
        # parts[5] - Tank
        # parts[6] - Docking port (facing down)
        # parts[7] - Tank

        cls.parts = [cls.vessel.parts.root]
        cls.parts.append(
            next(
                iter(
                    filter(lambda p: p.docking_port != None,
                           cls.parts[0].children))))
        part = cls.parts[-1]
        while len(part.children) == 1:
            part = part.children[0]
            cls.parts.append(part)

        cls.port1 = cls.parts[1].docking_port
        cls.port2 = cls.parts[2].docking_port
        cls.port4 = cls.parts[4].docking_port
        cls.port6 = cls.parts[6].docking_port
示例#5
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.remove_other_vessels()
        testingtools.launch_vessel_from_vab('PartsDockingPort')
        cls.conn = testingtools.connect(name='TestPartsDockingPort')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.parts = cls.vessel.parts
        cls.state = cls.conn.space_center.DockingPortState

        # Get the three undocked ports
        ports = cls.parts.docking_ports
        cls.port1 = next(
            iter(
                filter(
                    lambda p: p.part.title == 'Clamp-O-Tron Docking Port Jr.',
                    ports)))
        cls.port2 = next(
            iter(
                filter(
                    lambda p: p.part.title ==
                    'Clamp-O-Tron Shielded Docking Port', ports)))
        cls.port3 = next(
            iter(filter(lambda p: p.part.title == 'Mk2 Clamp-O-Tron', ports)))
        cls.port4 = next(
            iter(filter(lambda p: p.part.title == 'Inline Clamp-O-Tron',
                        ports)))
示例#6
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})
示例#7
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsEngine')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsSolarPanel')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsLaunchClamp')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
示例#9
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     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': 201000,
         'isp': 280.5
     })
     cls.add_engine_data('LV-T45 "Swivel" Liquid Fuel Engine', {
         'max_thrust': 169200,
         'isp': 270.7
     })
     cls.add_engine_data('LV-N "Nerv" Atomic Rocket Motor', {
         'max_thrust': 14300,
         'isp': 190.6
     })
     cls.add_engine_data('IX-6315 "Dawn" Electric Propulsion System', {
         'max_thrust': 63,
         'isp': 128.0
     })
     cls.add_engine_data('O-10 "Puff" MonoPropellant Fuel Engine', {
         'max_thrust': 9700,
         'isp': 121.2
     })
     cls.add_engine_data('RT-10 "Hammer" Solid Fuel Booster', {
         'max_thrust': 197897,
         'isp': 170.4
     })
     cls.add_engine_data('J-33 "Wheesley" Basic Jet Engine', {
         'max_thrust': 80000,
         'isp': 9600
     })
示例#10
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.launch_vessel_from_vab('PartsDockingPortPreAttachedTo')
        testingtools.remove_other_vessels()
        cls.conn = krpc.connect(name='TestPartsDockingPortPreAttachedTo')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.state = cls.conn.space_center.DockingPortState

        # Stack is as follows, from top to bottom:
        # parts[0] - Pod
        # parts[1] - Docking port (facing down)
        # parts[2] - Docking port (facing up)
        # parts[3] - Tank
        # parts[4] - Docking port (facing up)
        # parts[5] - Tank
        # parts[6] - Docking port (facing down)
        # parts[7] - Tank

        cls.parts = [cls.vessel.parts.root]
        cls.parts.append(filter(lambda p: p.docking_port != None, cls.parts[0].children)[0])
        part = cls.parts[-1]
        while len(part.children) == 1:
            part = part.children[0]
            cls.parts.append(part)

        cls.port1 = cls.parts[1].docking_port
        cls.port2 = cls.parts[2].docking_port
        cls.port4 = cls.parts[4].docking_port
        cls.port6 = cls.parts[6].docking_port
示例#11
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsSolarPanel')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsLaunchClamp')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
示例#12
0
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsParachute')
     testingtools.remove_other_vessels()
     self.conn = krpc.connect(name='TestPartsParachute')
     self.vessel = self.conn.space_center.active_vessel
     self.parts = self.vessel.parts
     self.state = self.conn.space_center.ParachuteState
示例#13
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsRadiator')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsRadiator')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.RadiatorState
示例#14
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Basic')
     cls.conn = testingtools.connect(name='TestFlightAtLaunchpad')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.conn.testing_tools.remove_other_vessels()
     cls.far = cls.conn.space_center.far_available
示例#15
0
 def setUpClass(cls):
     if testingtools.connect().space_center.active_vessel.name != 'Parts':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('Parts')
         testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestParts')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
示例#16
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsDecoupler')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsDecoupler')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.SolarPanelState
示例#17
0
 def setUpClass(cls):
     if testingtools.connect().space_center.active_vessel.name != "Parts":
         testingtools.new_save()
         testingtools.launch_vessel_from_vab("Parts")
         testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name="TestPartsReactionWheel")
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
示例#18
0
 def setUp(self):
     self.conn = testingtools.connect(name='TestComms')
     if not self.conn.space_center.remote_tech_available:
         self.skipTest('RemoteTech not installed')
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Comms')
     testingtools.remove_other_vessels()
     self.vessel = self.conn.space_center.active_vessel
示例#19
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Rover')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestControlRover')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     cls.flight = cls.vessel.flight(cls.vessel.orbit.body.reference_frame)
示例#20
0
 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
示例#21
0
 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
示例#22
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsRadiator')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsRadiator')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.RadiatorState
示例#23
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Rover')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestControlRover')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     cls.flight = cls.vessel.flight(cls.vessel.orbit.body.reference_frame)
示例#24
0
 def setUpClass(cls):
     if krpc.connect().space_center.active_vessel.name != 'Parts':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('Parts')
         testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsReactionWheel')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
示例#25
0
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsParachute')
     testingtools.remove_other_vessels()
     self.conn = testingtools.connect(name='TestPartsParachute')
     self.vessel = self.conn.space_center.active_vessel
     self.parts = self.vessel.parts
     self.state = self.conn.space_center.ParachuteState
示例#26
0
 def setUp(self):
     self.conn = krpc.connect(name='TestComms')
     if not self.conn.space_center.remote_tech_available:
         self.skipTest('RemoteTech not installed')
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Comms')
     testingtools.remove_other_vessels()
     self.vessel = self.conn.space_center.active_vessel
示例#27
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)
示例#28
0
 def setUpClass(cls):
     if testingtools.connect().space_center.active_vessel.name != 'PartsLandingGear':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('PartsLandingGear')
         testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsLandingGear')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.LandingGearState
示例#29
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestWarpOnLaunchpad')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.maximum_rails_warp_factor = 7
     cls.landed = True
示例#30
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestWarpOnLaunchpad')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.maximum_rails_warp_factor = 7
     cls.landed = True
示例#31
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Multi')
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83, 251.1)
     cls.conn = testingtools.connect(name='TestAutoPilotOtherVessel')
     next(iter(cls.conn.space_center.active_vessel.parts.docking_ports)).undock()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.other_vessel = next(iter(filter(lambda v: v != cls.vessel, cls.conn.space_center.vessels)))
示例#32
0
 def setUpClass(cls):
     if krpc.connect().space_center.active_vessel.name != 'Parts':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('Parts')
         testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestParts')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.expectedAmbientTemperature = 273+20
示例#33
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)
示例#34
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
示例#35
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
 def setUpClass(cls):
     if krpc.connect().space_center.active_vessel.name != 'Parts':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('Parts')
         testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsLandingLeg')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.LandingLegState
     cls.leg = cls.parts.landing_legs[0]
示例#37
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
示例#38
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
示例#39
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
示例#40
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)
示例#41
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)
示例#42
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83, 251.1)
     time.sleep(5) #FIXME: remove sleep
     cls.conn = krpc.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.ap = cls.vessel.auto_pilot
     cls.sas_mode = cls.conn.space_center.SASMode
     cls.speed_mode = cls.conn.space_center.SpeedMode
示例#43
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)
示例#44
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83, 251.1)
     cls.conn = testingtools.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.ap = cls.vessel.auto_pilot
     cls.sas_mode = cls.conn.space_center.SASMode
     cls.speed_mode = cls.conn.space_center.SpeedMode
     cls.ap.rotation_speed_multiplier = 2
     cls.ap.roll_speed_multiplier = 2
     cls.ap.set_pid_parameters(3,0,0)
示例#45
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83,
                            251.1)
     cls.conn = testingtools.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.ap = cls.vessel.auto_pilot
     cls.sas_mode = cls.conn.space_center.SASMode
     cls.speed_mode = cls.conn.space_center.SpeedMode
     cls.ap.rotation_speed_multiplier = 2
     cls.ap.roll_speed_multiplier = 2
     cls.ap.set_pid_parameters(3, 0, 0)
示例#46
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Multi')
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83,
                            251.1)
     cls.conn = testingtools.connect(name='TestAutoPilotOtherVessel')
     next(iter(
         cls.conn.space_center.active_vessel.parts.docking_ports)).undock()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.other_vessel = next(
         iter(
             filter(lambda v: v != cls.vessel,
                    cls.conn.space_center.vessels)))
示例#47
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.launch_vessel_from_vab('PartsDockingPort')
        testingtools.remove_other_vessels()
        cls.conn = krpc.connect(name='TestPartsDockingPort')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.parts = cls.vessel.parts
        cls.state = cls.conn.space_center.DockingPortState

        # Get the three undocked ports
        ports = cls.parts.docking_ports
        cls.port1 = filter(lambda p: p.part.title == 'Clamp-O-Tron Docking Port Jr.', ports)[0]
        cls.port2 = filter(lambda p: p.part.title == 'Clamp-O-Tron Shielded Docking Port', ports)[0]
        cls.port3 = filter(lambda p: p.part.title == 'Mk2 Clamp-O-Tron', ports)[0]
        cls.port4 = filter(lambda p: p.part.title == 'Inline Clamp-O-Tron', ports)[0]
 def setUpClass(cls):
     if testingtools.connect(
     ).space_center.active_vessel.name != 'PartsHarvester':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('PartsHarvester')
         testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsResourceHarvester')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.ResourceHarvesterState
     cls.drill = next(
         iter(
             filter(
                 lambda e: e.part.title ==
                 '\'Drill-O-Matic\' Mining Excavator',
                 cls.parts.resource_harvesters)))
示例#49
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)
示例#50
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})
示例#51
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
示例#52
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')
示例#53
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))
示例#54
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Resources')
     cls.conn = testingtools.connect(name='TestResources')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.num_stages = len(cls.expected.keys())