Use whole/fractional timestamps in the whole chain. This prevents loss

of precision when setting time to UTC.
This commit is contained in:
Nick Foster
2015-04-17 14:07:28 -07:00
parent da15a2daf2
commit 9bdac2a499
6 changed files with 51 additions and 37 deletions

View File

@@ -423,12 +423,12 @@ def parse_TCAS_CRM(data):
def make_parser(pub):
publisher = pub
def publish(message):
[data, ecc, reference, timestamp] = message.split()
[data, ecc, reference, int_timestamp, frac_timestamp] = message.split()
try:
ret = air_modes.modes_report(modes_reply(int(data, 16)),
int(ecc, 16),
10.0*math.log10(max(1e-8,float(reference))),
air_modes.stamp(0, float(timestamp)))
air_modes.stamp(int(int_timestamp), float(frac_timestamp)))
pub["modes_dl"] = ret
pub["type%i_dl" % ret.data.get_type()] = ret
except ADSBError: