Skip to content

Commit

Permalink
Add tracking of dntoeu states on frontend (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
aywaldron committed Oct 22, 2019
1 parent fdbd819 commit 55dff20
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
8 changes: 7 additions & 1 deletion ait/gui/static/js/ait/gui/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ const Field =
* retrieving the packet value.
*/
getValue (packet, raw=false) {
return packet && packet[this._fname]
if ( !raw ) {
if ( packet && this._fname in packet['dntoeu']) {
return packet && packet['dntoeu'][this._fname]
}
}

return packet && packet['raw'][this._fname]
},


Expand Down
4 changes: 2 additions & 2 deletions ait/gui/static/js/ait/gui/Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions ait/gui/static/js/ait/gui/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
9 changes: 7 additions & 2 deletions ait/gui/static/js/ait/tlm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
Expand Down

0 comments on commit 55dff20

Please sign in to comment.