Skip to content

Commit

Permalink
Issue #105 - Update highcharts plot function for JSON formatted packet
Browse files Browse the repository at this point in the history
  • Loading branch information
aywaldron authored and Futabay committed May 19, 2020
1 parent ebd3d67 commit 9f48361
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 0 additions & 4 deletions ait/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,6 @@ def handle():
if v.uid == uid:
pkt_defn = v
break
else:
continue

wsock.send(json.dumps({
'packet': pkt_defn.name,
Expand Down Expand Up @@ -705,8 +703,6 @@ def handle():
if v.uid == uid:
pkt_defn = v
break
else:
continue

wsock.send(json.dumps({
'packet': pkt_defn.name,
Expand Down
9 changes: 5 additions & 4 deletions ait/gui/static/js/ait/gui/Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,18 @@ class HighchartsBackend
Object.assign(options, overrides)
}

plot(delta) {
const pname = delta['packet']
plot(data) {
const pname = data['packet']
let delta = data['data']
const names = this._plot._packets[pname]
if (!names) return

names.forEach( (name) => {
const series = this._plot._chart.get(pname + '.' + name)

if (series) {
const x = this._plot._time.get(packet).getTime()
const y = packet.__get__(name)
const x = this._plot._time.get(delta).getTime()
const y = delta[name]

series.addPoint([x, y], false)

Expand Down

0 comments on commit 9f48361

Please sign in to comment.