Skip to content

Commit

Permalink
Update dntoeu plot option (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Futabay committed May 19, 2020
1 parent 610d47a commit 7f7b35c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
12 changes: 6 additions & 6 deletions ait/gui/static/index.html
Original file line number Diff line number Diff line change
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" 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-series packet="1553_HS_Packet" name="Voltage_A" raw=true></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_B" raw=true></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_C" raw=true></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Voltage_D" raw=true></ait-plot-series>
</ait-plot>
</div>
<div class="col-sm-6">
Expand All @@ -226,13 +226,13 @@ <h4 class="telem-group-title">1553 HS Currents</h4>
"height": 300
}
</ait-plot-config>
<ait-plot-series packet="1553_HS_Packet" name="Current_A" dntoeu=true></ait-plot-series>
<ait-plot-series packet="1553_HS_Packet" name="Current_A"></ait-plot-series>
</ait-plot>
</div>
</ait-tab>
</ait-tabset>
</div>


<div class='ctrlcontainer'>
<ait-tabset class='nav-tabs'>
Expand Down
30 changes: 17 additions & 13 deletions ait/gui/static/js/ait/gui/Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class DygraphsBackend
}
}

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

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

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

Expand Down Expand Up @@ -306,9 +306,13 @@ class HighchartsBackend
* point to be removed from the queue. This is only used by the Dygraphs
* backend.
*
* raw
* If the `raw` parameter is true, the raw value will be returned.
* DN to EU conversions will be skipped. (Default: raw=false)
*
* .. code:: Javascript
*
* <ait-plot-series packet="1553_HS_Packet" field="Voltage_A"></ait-plot-series>
* <ait-plot-series packet="1553_HS_Packet" field="Voltage_A" raw=true></ait-plot-series>
*
* **ait-plot-config:**
*
Expand Down Expand Up @@ -347,19 +351,19 @@ class HighchartsBackend
* "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" raw=true></ait-plot-series>
* <ait-plot-series packet="1553_HS_Packet" name="Voltage_B" raw=true></ait-plot-series>
* <ait-plot-series packet="1553_HS_Packet" name="Voltage_C" raw=true></ait-plot-series>
* <ait-plot-series packet="1553_HS_Packet" name="Voltage_D" raw=true></ait-plot-series>
* </ait-plot>
*/
const Plot =
{
/**
* Plots data from the given packet.
*/
plot (packet, dntoeu=false) {
this._backend.plot(packet, dntoeu)
plot (packet, raw=false) {
this._backend.plot(packet, raw)
},


Expand Down Expand Up @@ -404,7 +408,7 @@ const Plot =
this._packets[packet] = this._packets[packet] || [ ]
this._packets[packet].push(name)

this._dntoeu = vnode.attrs.dntoeu
this._raw = vnode.attrs.raw
},


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

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

0 comments on commit 7f7b35c

Please sign in to comment.