Skip to content

Commit

Permalink
Add dntoeu plot option
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayo Kallas authored and Futabay committed May 19, 2020
1 parent a437eec commit 7aa9c54
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
14 changes: 7 additions & 7 deletions ait/gui/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h1>Welcome to the AMMOS Instrument Toolkit Telemetry Monitoring Interface!</h1>
The AIT UI is created from a number of <strong>components</strong>. These components are written in JavaScript and provided by the project to cover basic functionality needed in the user interface. Users can customize their interface by making minimal HTML or configuration file changes. If a user needs more control they can create their own components and include them in the interface.
</p>
<p>
The majority of the content that you're seeing is displayed in <strong>ait-tabset</strong> components. The tabset component helps keep our display split into logical blocks and displays additional status information to the user.
The majority of the content that you're seeing is displayed in <strong>ait-tabset</strong> components. The tabset component helps keep our display split into logical blocks and displays additional status information to the user.

<pre>
&lt;ait-tabset&gt;
Expand Down Expand Up @@ -202,10 +202,10 @@ <h4 class="telem-group-title">1553 HS Voltages</h4>
"height": 300
}
</ait-plot-config>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_A"></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_B"></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_C"></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_D"></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_A" dntoeu=false></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_B" dntoeu=false></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_C" dntoeu=false></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_D" dntoeu=false></ait-plot-series>
</ait-plot>
</div>
<div class="col-sm-6">
Expand All @@ -226,7 +226,7 @@ <h4 class="telem-group-title">1553 HS Currents</h4>
"height": 300
}
</ait-plot-config>
<ait-plot-series packet="1553_HS_Packet" name="Current_A"></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Current_A" dntoeu=true></ait-plot-series>
</ait-plot>
</div>
</ait-tab>
Expand Down Expand Up @@ -259,7 +259,7 @@ <h4 class="telem-group-title">1553 HS Currents</h4>
<ait-command-history></ait-command-history>
</ait-tab>
<ait-tab title='Sequences'>
<ait-sequence></ait-sequence>
<ait-sequence></ait-sequence>
</ait-tab>
<ait-tab title="Script Control">
<div class="row">
Expand Down
22 changes: 12 additions & 10 deletions ait/gui/static/js/ait/gui/Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class DygraphsBackend
}
}

plot (data) {
plot (data, dntoeu) {
const pname = data['packet']
let packet = data['data']['raw']
let packet = dntoeu ? data['data']['dntoeu']:data['data']['raw']
const names = this._plot._packets[pname]

if (!names) return
Expand Down Expand Up @@ -207,9 +207,9 @@ class HighchartsBackend
Object.assign(options, overrides)
}

plot(data) {
plot(data, dntoeu) {
const pname = data['packet']
let packet = data['data']['raw']
let packet = dntoeu ? data['data']['dntoeu']:data['data']['raw']
const names = this._plot._packets[pname]
if (!names) return

Expand Down Expand Up @@ -291,7 +291,7 @@ class HighchartsBackend
* The name of the field in the packet that defines this series.
*
* Optional attributes:
*
*
* type
* The type of series being displayed. This is not relevant for all plot
* backends. For instance, Highcharts would use this to define the type
Expand Down Expand Up @@ -322,7 +322,7 @@ class HighchartsBackend
* {
* "title": "Plot title",
* "xlabel": "X label",
* "ylabel": "Y label"
* "ylabel": "Y label"
* }
* </ait-plot-config>
*
Expand Down Expand Up @@ -350,15 +350,15 @@ class HighchartsBackend
* <ait-plot-series packet="1553_HS_Packet" name="Voltage_B"></ait-plot-series>
* <ait-plot-series packet="1553_HS_Packet" name="Voltage_C"></ait-plot-series>
* <ait-plot-series packet="1553_HS_Packet" name="Voltage_D"></ait-plot-series>
* </ait-plot>
* </ait-plot>
*/
const Plot =
{
/**
* Plots data from the given packet.
*/
plot (packet) {
this._backend.plot(packet)
plot (packet, dntoeu=false) {
this._backend.plot(packet, dntoeu)
},


Expand Down Expand Up @@ -402,6 +402,8 @@ const Plot =
// For each packet, maintain a list of fields to plot
this._packets[packet] = this._packets[packet] || [ ]
this._packets[packet].push(name)

this._dntoeu = vnode.attrs.dntoeu
},


Expand Down Expand Up @@ -455,7 +457,7 @@ const Plot =
this._time = new PlotTimeField()
}

ait.events.on('ait:tlm:packet', (p) => this.plot(p))
ait.events.on('ait:tlm:packet', (p) => this.plot(p, this._dntoeu))
ait.events.on('ait:playback:on', () => this.redraw())
ait.events.on('ait:playback:off', () => this.redraw())
},
Expand Down

0 comments on commit 7aa9c54

Please sign in to comment.