From 377b7dabdf2d0104e0f8b60d7f0e8ae93b746202 Mon Sep 17 00:00:00 2001 From: Anna Waldron Date: Fri, 22 Mar 2019 11:30:22 -0700 Subject: [PATCH] Issue #105 - Update highcharts plot function for JSON formatted packet --- ait/gui/__init__.py | 4 ---- ait/gui/static/js/ait/gui/Plot.js | 9 +++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ait/gui/__init__.py b/ait/gui/__init__.py index dc371eef..12db53fe 100644 --- a/ait/gui/__init__.py +++ b/ait/gui/__init__.py @@ -577,8 +577,6 @@ def handle(): if v.uid == uid: pkt_defn = v break - else: - continue wsock.send(json.dumps({ 'packet': pkt_defn.name, @@ -622,8 +620,6 @@ def handle(): if v.uid == uid: pkt_defn = v break - else: - continue wsock.send(json.dumps({ 'packet': pkt_defn.name, diff --git a/ait/gui/static/js/ait/gui/Plot.js b/ait/gui/static/js/ait/gui/Plot.js index 58ca4383..b77eedb5 100644 --- a/ait/gui/static/js/ait/gui/Plot.js +++ b/ait/gui/static/js/ait/gui/Plot.js @@ -204,8 +204,9 @@ 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 @@ -213,8 +214,8 @@ class HighchartsBackend 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)