本文整理汇总了Python中testingtools.set_circular_orbit函数的典型用法代码示例。如果您正苦于以下问题:Python set_circular_orbit函数的具体用法?Python set_circular_orbit怎么用?Python set_circular_orbit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_circular_orbit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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})
开发者ID:artwhaley,项目名称:krpc,代码行数:26,代码来源:test_parts_engine.py
示例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
开发者ID:NOTtheMessiah,项目名称:krpc,代码行数:7,代码来源:test_referenceframe.py
示例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
开发者ID:rosalesr,项目名称:krpc,代码行数:8,代码来源:test_parts_docking_port.py
示例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()
开发者ID:ilo,项目名称:krpc,代码行数:8,代码来源:test_node.py
示例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)
开发者ID:rosalesr,项目名称:krpc,代码行数:8,代码来源:test_flight.py
示例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))
开发者ID:Fred4106,项目名称:krpc,代码行数:9,代码来源:test_flight.py
示例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)
开发者ID:Fred4106,项目名称:krpc,代码行数:9,代码来源:test_control.py
示例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
开发者ID:Kerbal007,项目名称:krpc,代码行数:10,代码来源:test_vessel.py
示例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
开发者ID:calaveraDeluxe,项目名称:krpc,代码行数:10,代码来源:test_spacecenter.py
示例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)
开发者ID:Kerbal007,项目名称:krpc,代码行数:10,代码来源:test_control.py
示例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)
开发者ID:rosalesr,项目名称:krpc,代码行数:11,代码来源:test_control.py
示例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)
开发者ID:Fred4106,项目名称:krpc,代码行数:11,代码来源:test_control.py
示例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
开发者ID:ilo,项目名称:krpc,代码行数:11,代码来源:test_parts_docking_port.py
示例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
开发者ID:Fred4106,项目名称:krpc,代码行数:12,代码来源:test_referenceframe.py
示例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)
开发者ID:602p,项目名称:krpc,代码行数:14,代码来源:test_control.py
示例16: test_yaw_control
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)
开发者ID:602p,项目名称:krpc,代码行数:14,代码来源:test_control.py
示例17: test_roll_control
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)
开发者ID:602p,项目名称:krpc,代码行数:20,代码来源:test_control.py
示例18: 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})
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})
开发者ID:Kerbal007,项目名称:krpc,代码行数:40,代码来源:test_parts_engine.py
示例19: setUpClass
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))
开发者ID:602p,项目名称:krpc,代码行数:22,代码来源:test_vessel.py
示例20: test_vessel_orbiting_kerbin
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)
开发者ID:rosalesr,项目名称:krpc,代码行数:23,代码来源:test_orbit.py
注:本文中的testingtools.set_circular_orbit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论