diff --git a/ait/gui/__init__.py b/ait/gui/__init__.py index 47a1dbbc..d9e31104 100644 --- a/ait/gui/__init__.py +++ b/ait/gui/__init__.py @@ -727,7 +727,9 @@ def get_packet_delta(pkt_defn, packet): # previous packets of this type received else: - counters[pkt_defn.name] += 1 + count = counters[pkt_defn.name] + count = count + 1 if count < 2**31 - 1 else 0 + counters[pkt_defn.name] = count delta, dntoeus = {}, {} for field, new_value in json_pkt.items(): last_value = packet_states[pkt_defn.name][field] @@ -774,6 +776,7 @@ def handle(): delta, dntoeus, counter = get_packet_delta(pkt_defn, data) delta = replace_datetimes(delta) log.info(delta) + log.info('Packet #{}'.format(counter)) wsock.send(json.dumps({ 'packet': pkt_defn.name, diff --git a/ait/gui/static/js/ait/tlm.js b/ait/gui/static/js/ait/tlm.js index f5025dc6..e2845dbb 100644 --- a/ait/gui/static/js/ait/tlm.js +++ b/ait/gui/static/js/ait/tlm.js @@ -394,9 +394,11 @@ class TelemetryStream checkCounter (packetName, counter) { // returns true if counter is as expected, false if not let lastCounter = this._counters[packetName] - if ( counter == lastCounter + 1 ) { + if ( counter == lastCounter + 1) { return true - } + } else if ( lastCounter == Math.pow(2, 31) - 1 && counter == 0 ) { + return true + } console.log('counter mismatch: had ' + lastCounter + ' , got ' + counter) return false }