本文整理汇总了Python中dipplanner.dive.Dive.get_surface_interval方法的典型用法代码示例。如果您正苦于以下问题:Python Dive.get_surface_interval方法的具体用法?Python Dive.get_surface_interval怎么用?Python Dive.get_surface_interval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dipplanner.dive.Dive
的用法示例。
在下文中一共展示了Dive.get_surface_interval方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestRepetitiveDive1
# 需要导入模块: from dipplanner.dive import Dive [as 别名]
# 或者: from dipplanner.dive.Dive import get_surface_interval [as 别名]
class TestRepetitiveDive1(TestDive):
def setUp(self):
TestDive.setUp(self)
diveseg1 = SegmentDive(40, 20 * 60, self.airtank12, 0)
self.profile0 = Dive([diveseg1], [self.airtank12])
self.profile0.do_dive()
diveseg2 = SegmentDive(40, 20 * 60, self.airtank, 0)
self.profile1 = Dive([diveseg2], [self.airtank], self.profile0)
self.profile1.do_surface_interval(20 * 60)
self.profile1.do_dive()
def test_rt(self):
assert seconds_to_mmss(self.profile1.run_time) == ' 68:09', \
'bad dive runtime ? (%s)' \
% seconds_to_mmss(self.profile1.run_time)
def test_otu(self):
self.assertAlmostEqual(self.profile1.model.ox_tox.otu,
40.0702502936, 7, 'bad dive OTU ? (%s)'
% self.profile1.model.ox_tox.otu)
def test_cns(self):
self.assertAlmostEqual(self.profile1.model.ox_tox.cns * 100,
14.3091665925, 7, 'bad dive CNS ? (%s)'
% (self.profile1.model.ox_tox.cns * 100))
def test_tank_cons(self):
self.assertAlmostEqual(self.airtank12.used_gas, 2115.5196384,
7, 'bad used gas (%s)'
% self.airtank12.used_gas)
def test_tank_cons_rule(self):
self.assertEqual(self.profile1.tanks[0].check_rule(), True,
'Wrong tank status : it should pass the remaining '
'gas rule test (result:%s)'
% self.profile1.tanks[0].check_rule())
def test_no_flight(self):
no_flight_time = self.profile1.no_flight_time()
self.assertEqual(no_flight_time, 5460, 'Bad no flight time: %s'
% no_flight_time)
def test_no_flight_wo_exc(self):
no_flight_time = self.profile1.no_flight_time_wo_exception()
self.assertEqual(no_flight_time, 5460, 'Bad no flight time: %s'
% no_flight_time)
def test_surfaceint(self):
self.assertEqual(self.profile1.get_surface_interval(),
' 20:00',
'wrong surface interval:%s'
% self.profile1.get_surface_interval())
示例2: TestRepetitiveDive3
# 需要导入模块: from dipplanner.dive import Dive [as 别名]
# 或者: from dipplanner.dive.Dive import get_surface_interval [as 别名]
class TestRepetitiveDive3(TestDive):
def setUp(self):
TestDive.setUp(self)
diveseg1 = SegmentDive(40, 20 * 60, self.airtank12, 0)
self.profile0 = Dive([diveseg1], [self.airtank12])
self.profile0.do_dive()
diveseg2 = SegmentDive(30, 40 * 60, self.airtank, 0)
self.profile1 = Dive([diveseg2], [self.airtank], self.profile0)
self.profile1.do_surface_interval(30 * 60)
self.profile1.do_dive()
diveseg3 = SegmentDive(25, 35 * 60, self.airtank, 0)
self.profile2 = Dive([diveseg3], [self.airtank], self.profile1)
self.profile2.do_surface_interval(60 * 60)
# self.profile2.refill_tanks()
self.profile2.do_dive()
diveseg4 = SegmentDive(40, 20 * 60, self.airtank, 0)
self.profile3 = Dive([diveseg4], [self.airtank], self.profile2)
self.profile3.do_surface_interval(12 * 60 * 60)
# self.profile3.refill_tanks()
self.profile3.do_dive()
def test_rt(self):
assert seconds_to_mmss(self.profile3.run_time) == ' 38:36', \
'bad dive runtime ? (%s)' \
% seconds_to_mmss(self.profile3.run_time)
def test_otu(self):
self.assertAlmostEqual(self.profile3.model.ox_tox.otu,
86.8657204829, 7, 'bad dive OTU ? (%s)'
% self.profile3.model.ox_tox.otu)
def test_cns(self):
self.assertAlmostEqual(self.profile3.model.ox_tox.cns * 100,
7.75546902304, 7, 'bad dive CNS ? (%s)'
% (self.profile3.model.ox_tox.cns * 100))
def test_tank_cons(self):
self.assertAlmostEqual(self.airtank.used_gas, 2115.5196384, 7,
'bad used gas (%s)'
% self.airtank.used_gas)
def test_tank_cons_rule(self):
self.assertEqual(self.profile3.tanks[0].check_rule(), True,
'Wrong tank status : it should pass the remaining '
'gas rule test (result:%s)'
% self.profile2.tanks[0].check_rule())
def test_no_flight(self):
no_flight_time = self.profile3.no_flight_time()
self.assertEqual(no_flight_time, 1620, 'Bad no flight time: %s'
% no_flight_time)
def test_no_flight_wo_exc(self):
no_flight_time = self.profile3.no_flight_time_wo_exception()
self.assertEqual(no_flight_time, 1620, 'Bad no flight time: %s'
% no_flight_time)
def test_surfaceint(self):
self.assertEqual(self.profile3.get_surface_interval(),
'720:00',
'wrong surface interval:%s'
% self.profile3.get_surface_interval())
示例3: TestRepetitiveDive2
# 需要导入模块: from dipplanner.dive import Dive [as 别名]
# 或者: from dipplanner.dive.Dive import get_surface_interval [as 别名]
class TestRepetitiveDive2(TestDive):
def setUp(self):
TestDive.setUp(self)
diveseg1 = SegmentDive(40, 20 * 60, self.airtank12, 0)
self.profile0 = Dive([diveseg1], [self.airtank12])
self.profile0.do_dive()
diveseg2 = SegmentDive(30, 40 * 60, self.airtank, 0)
self.profile1 = Dive([diveseg2], [self.airtank], self.profile0)
self.profile1.do_surface_interval(30 * 60)
self.profile1.do_dive()
diveseg3 = SegmentDive(25, 35 * 60, self.airtank, 0)
self.profile2 = Dive([diveseg3], [self.airtank], self.profile1)
self.profile2.do_surface_interval(60 * 60)
# self.profile2.refill_tanks()
self.profile2.do_dive()
def test_rt(self):
assert seconds_to_mmss(self.profile2.run_time) == ' 70:18', \
'bad dive runtime ? (%s)' \
% seconds_to_mmss(self.profile2.run_time)
def test_otu(self):
self.assertAlmostEqual(self.profile2.model.ox_tox.otu,
66.8427163401, 7, 'bad dive OTU ? (%s)'
% self.profile2.model.ox_tox.otu)
def test_cns(self):
self.assertAlmostEqual(self.profile2.model.ox_tox.cns * 100,
18.1490350581, 7, 'bad dive CNS ? (%s)'
% (self.profile2.model.ox_tox.cns * 100))
def test_tank_cons(self):
self.assertAlmostEqual(self.airtank.used_gas, 2701.73162947, 7,
'bad used gas (%s)'
% self.airtank.used_gas)
def test_tank_cons_rule(self):
self.assertEqual(self.profile2.tanks[0].check_rule(), True,
'Wrong tank status : it should pass the remaining '
'gas rule test (result:%s)'
% self.profile2.tanks[0].check_rule())
def test_no_flight(self):
no_flight_time = self.profile2.no_flight_time()
self.assertEqual(no_flight_time, 18360, 'Bad no flight time: %s'
% no_flight_time)
def test_no_flight_wo_exc(self):
no_flight_time = self.profile2.no_flight_time_wo_exception()
self.assertEqual(no_flight_time, 18360, 'Bad no flight time: %s'
% no_flight_time)
def test_surfaceint(self):
self.assertEqual(self.profile2.get_surface_interval(),
' 60:00',
'wrong surface interval:%s'
% self.profile2.get_surface_interval())