comparison web/log.py @ 401:56c32a62b0cd

fix rem calculation
author Matt Johnston <matt@ucc.asn.au>
date Mon, 16 Jul 2012 22:01:33 +0800
parents 1137f315209b
children 1a88bb989afb
comparison
equal deleted inserted replaced
400:1137f315209b 401:56c32a62b0cd
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):