Mercurial > templog
comparison web/log.py @ 95:fd9cfa6829fd
fix rem calculation
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 16 Jul 2012 22:01:33 +0800 |
parents | 229b740a607f |
children | 1a88bb989afb |
comparison
equal
deleted
inserted
replaced
94:229b740a607f | 95:fd9cfa6829fd |
---|---|
158 value = struct.unpack('>h', binascii.unhexlify(reading))[0] | 158 value = struct.unpack('>h', binascii.unhexlify(reading))[0] |
159 return value * 0.0625 | 159 return value * 0.0625 |
160 | 160 |
161 def time_rem(name, entries): | 161 def time_rem(name, entries): |
162 val_ticks = int(entries[name]) | 162 val_ticks = int(entries[name]) |
163 val_rem = int(entries[name]) | 163 val_rem = int(entries['%s_rem' % name]) |
164 tick_wake = int(entries['tick_wake']) | 164 tick_wake = int(entries['tick_wake']) |
165 tick_secs = int(entries['tick_secs']) | 165 tick_secs = int(entries['tick_secs']) |
166 return val_ticks + float(val_rem) * tick_secs / tick_wake | 166 return val_ticks + float(val_rem) * tick_secs / tick_wake |
167 | 167 |
168 def parse(lines): | 168 def parse(lines): |