From 0d1cb745d5dec4d185cb41452ca571af8e633096 Mon Sep 17 00:00:00 2001 From: Anna Waldron Date: Tue, 22 Oct 2019 11:21:09 -0700 Subject: [PATCH] Add tracking of dntoeu states on frontend (#105) --- ait/gui/static/js/ait/gui/Field.js | 6 +++++- ait/gui/static/js/ait/gui/Plot.js | 4 ++-- ait/gui/static/js/ait/gui/Search.js | 8 ++++++-- ait/gui/static/js/ait/tlm.js | 9 +++++++-- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ait/gui/static/js/ait/gui/Field.js b/ait/gui/static/js/ait/gui/Field.js index edcd23a6..5b9e94c2 100644 --- a/ait/gui/static/js/ait/gui/Field.js +++ b/ait/gui/static/js/ait/gui/Field.js @@ -83,7 +83,11 @@ const Field = * retrieving the packet value. */ getValue (packet, raw=false) { - return packet && packet[this._fname] + if ( packet && this._fname in packet['dntoeu']) { + return packet && packet['dntoeu'][this._fname] + } else { + return packet && packet['raw'][this._fname] + } }, diff --git a/ait/gui/static/js/ait/gui/Plot.js b/ait/gui/static/js/ait/gui/Plot.js index 2a631227..e9f9c4bf 100644 --- a/ait/gui/static/js/ait/gui/Plot.js +++ b/ait/gui/static/js/ait/gui/Plot.js @@ -80,7 +80,7 @@ class DygraphsBackend plot (data) { const pname = data['packet'] - let packet = data['data'] + let packet = data['data']['raw'] const names = this._plot._packets[pname] if (!names) return @@ -209,7 +209,7 @@ class HighchartsBackend plot(data) { const pname = data['packet'] - let packet = data['data'] + let packet = data['data']['raw'] const names = this._plot._packets[pname] if (!names) return diff --git a/ait/gui/static/js/ait/gui/Search.js b/ait/gui/static/js/ait/gui/Search.js index 33b769d6..84a51a50 100644 --- a/ait/gui/static/js/ait/gui/Search.js +++ b/ait/gui/static/js/ait/gui/Search.js @@ -139,8 +139,12 @@ const MnemonicSearch = { ) if (curPacket !== null) { - val = curPacket.__get__(this._selection) - raw = curPacket.__get__(this._selection, true) + if ( this._selection in curPacket['dntoeu']) { + val = curPacket['dntoeu'][this._selection] + } else { + val = curPacket['raw'][this._selection] + } + raw = curPacket['raw'][this._selection] } let data = {} diff --git a/ait/gui/static/js/ait/tlm.js b/ait/gui/static/js/ait/tlm.js index e9bdf59d..6c6eab14 100644 --- a/ait/gui/static/js/ait/tlm.js +++ b/ait/gui/static/js/ait/tlm.js @@ -423,7 +423,10 @@ class TelemetryStream if ( Object.keys(delta).length !== 0 ) { console.log('adding delta to pkt state') for ( var field in delta ) { - this._pkt_states[packet_name][field] = delta[field] + this._pkt_states[packet_name]['raw'][field] = delta[field] + } + for ( var field in dntoeus ) { + this._pkt_states[packet_name]['dntoeu'][field] = dntoeus[field] } } this._counters[packet_name] = counter @@ -434,7 +437,9 @@ class TelemetryStream // empty delta - request full packet from backend this.getFullPacketStates() } else { - this._pkt_states[packet_name] = delta + this._pkt_states[packet_name] = {} + this._pkt_states[packet_name]['raw'] = delta + this._pkt_states[packet_name]['dntoeu'] = dntoeus this._counters[packet_name] = counter } }