sireader.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pysport 作者: sportorg 项目源码 文件源码
def set_time(self, time):
        """Set si station internal time.
        @param time: time as a python datetime object.
        """
        bintime = (SIReader._to_str(int(time.strftime('%y')), 1)
                   + SIReader._to_str(time.month, 1)
                   + SIReader._to_str(time.day, 1)
                   + SIReader._to_str(((time.isoweekday() % 7) << 1) + time.hour // 12, 1)
                   + SIReader._to_str((time.hour % 12) * 3600 + time.minute * 60 + time.second, 2)
                   + SIReader._to_str(int(round(time.microsecond / 1000000.0 * 256)), 1)
                   )

        self._send_command(SIReader.C_SET_TIME, bintime)
        self.beep()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号