本文整理汇总了Python中testingtools.set_circular_orbit函数的典型用法代码示例。如果您正苦于以下问题:Python set_circular_orbit函数的具体用法?Python set_circular_orbit怎么用?Python set_circular_orbit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_circular_orbit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
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})
示例2: setUpClass
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
示例3: setUp
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
示例4: setUpClass
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()
示例5: test_orbital_speed
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)
示例6: setUpClass
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))
示例7: setUpClass
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)
示例8: setUpClass
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
示例9: setUpClass
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
示例10: setUpClass
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)
示例11: setUpClass
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)
示例12: test_staging
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)
示例13: setUp
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
示例14: setUpClass
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
示例15: test_pitch_control
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)