Mercurial > templog
comparison server/ts.py @ 92:c3eb67cd8b61
handle rem from btoff
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 16 Jul 2012 21:28:49 +0800 |
parents | 231662c6690c |
children | 229b740a607f |
comparison
equal
deleted
inserted
replaced
91:231662c6690c | 92:c3eb67cd8b61 |
---|---|
104 return None | 104 return None |
105 L("Next wake line %s" % l) | 105 L("Next wake line %s" % l) |
106 | 106 |
107 toks = dict(v.split('=') for v in l.split(',')) | 107 toks = dict(v.split('=') for v in l.split(',')) |
108 | 108 |
109 return int(toks['next_wake']) | 109 rem = int(toks['rem']) |
110 tick_secs = int(toks['tick_secs']) | |
111 tick_secs = int(toks['tick_wake']) | |
112 next_wake = int(toks['next_wake']) | |
113 | |
114 rem_secs = float(rem) / tick_wake * tick_secs | |
115 | |
116 next_wake_secs = next_wake - rem_secs | |
117 L("next_wake_secs %f\n", next_wake_secs) | |
118 return next_wake_secs | |
110 | 119 |
111 @retry() | 120 @retry() |
112 def clear_meas(sock): | 121 def clear_meas(sock): |
113 sock.send("clear\n"); | 122 sock.send("clear\n"); |
114 l = readline(sock) | 123 l = readline(sock) |