def __init__(self, l_hours, i_milis=2, i_sec=None):
'''
Initiate a NextStopTime object. Save all parameters as attributes
:param l_hours: list. Hours to be used in stoptime calculation
:param i_milis*: integer. Number of miliseconds between each stoptime
:param i_sec*: integer. Number of seconds between each stoptime. If
defined, the i_milis is not used
'''
i_noise = None
if i_milis > 4:
i_noise = min(1, i_milis/5)
self.gen_stoptime = get_next_stoptime(l_hours, i_milis, i_sec, i_noise)
self.gen_stoptime, self.gen_backup = itertools.tee(self.gen_stoptime)
self.s_last_stoptime = ''
self.s_stoptime_was_set = ''
self.s_time = "{:0>2}:{:0>2}:{:0>2}.{:0>3}"
self.b_use_last = False
评论列表
文章目录