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
Example #2
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
Example #3
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
Example #4
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
Example #5
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
     })
Example #6
0
 def setUpClass(cls):
     testingtools.new_save()
     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
Example #7
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})
 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
Example #9
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
     })
Example #10
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
 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)))
Example #12
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})
Example #13
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)))
Example #14
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
Example #15
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
Example #16
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
Example #17
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
Example #18
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsSolarPanel')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsSolarPanel')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.SolarPanelState
Example #19
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()
Example #20
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
Example #21
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)
Example #22
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
Example #23
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
Example #24
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
Example #25
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
Example #26
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)
Example #27
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
Example #28
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
Example #29
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
Example #30
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)))
Example #31
0
 def setUpClass(cls):
     testingtools.new_save()
     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
Example #32
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
Example #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)
Example #34
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
Example #35
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
Example #36
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)
Example #37
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
Example #38
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)
Example #39
0
 def test_clear_on_disconnect(self):
     conn = testingtools.connect(name='TestControlActiveVessel.test_clear_on_disconnect')
     control = conn.space_center.active_vessel.control
     control.pitch = 1
     control.yaw = 1
     control.roll = 1
     time.sleep(0.5)
     conn.close()
     time.sleep(0.5)
     self.assertEqual(self.control.pitch, 0)
     self.assertEqual(self.control.yaw, 0)
     self.assertEqual(self.control.roll, 0)
Example #40
0
 def test_clear_on_disconnect(self):
     conn = testingtools.connect(
         name='TestControlActiveVessel.test_clear_on_disconnect')
     control = conn.space_center.active_vessel.control
     control.pitch = 1
     control.yaw = 1
     control.roll = 1
     time.sleep(0.5)
     conn.close()
     time.sleep(0.5)
     self.assertEqual(self.control.pitch, 0)
     self.assertEqual(self.control.yaw, 0)
     self.assertEqual(self.control.roll, 0)
Example #41
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)
Example #42
0
def main():
    # Check that a kRPC server is running
    import krpc
    try:
        conn = testingtools.connect()
    except:
        print('kRPC server not running; skipping tests')
        exit(0)

    suite = unittest.TestLoader().discover(os.path.dirname(__file__), pattern='test_*.py')
    result = unittest.TextTestRunner(verbosity=2).run(suite)
    if not result.wasSuccessful():
        exit(1)
Example #43
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)
Example #44
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)))
Example #45
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)))
Example #46
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)
Example #47
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})
Example #48
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
Example #49
0
 def setUpClass(cls):
     cls.conn = testingtools.connect(name='TestBody')
Example #50
0
 def setUpClass(cls):
     cls.conn = testingtools.connect(name='TestBody')
Example #51
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestFlightVerticalSpeed')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.conn.testing_tools.remove_other_vessels()
Example #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')
Example #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))
Example #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())
Example #55
0
 def setUpClass(cls):
     cls.conn = testingtools.connect(name='TestResourcesStaticMethods')