show the SNR above the real time chart (#143)

* show the SNR above the real time chart

* uncomment chart line that was commented by mistake

* fixes for 3.17
This commit is contained in:
Trevor Paskett 2018-08-23 09:55:50 -06:00 committed by dman776
parent 8d3b63a3f3
commit 2678e9ad4a
1 changed files with 8 additions and 2 deletions

View File

@ -98,7 +98,7 @@ $header = <<EOF;
text: "$dmode Signal to Noise" text: "$dmode Signal to Noise"
}, },
legend: { legend: {
horizontalAlign: "right", // left, center ,right horizontalAlign: "right", // left, center ,right
verticalAlign: "center", // top, center, bottom verticalAlign: "center", // top, center, bottom
}, },
axisX: { axisX: {
@ -153,8 +153,9 @@ $header = <<EOF;
var updateRealtimeChart = function () { var updateRealtimeChart = function () {
\$.getJSON("/cgi-bin/signal.json?realtime=1&device=$parms{device}", function (result) { \$.getJSON("/cgi-bin/signal.json?realtime=1&device=$parms{device}", function (result) {
dps[0].push(result[0][0]); dps[0].push(result[0][0]);
// dps[1].push(result[1][0]);
chart.render(); chart.render();
var snr = (result[0][0].y[1] * -1) - (result[0][0].y[0] * -1);
\$('#snr').html(snr);
}); });
}; };
@ -228,6 +229,11 @@ $page = $page . "<input type='hidden' name='realtime' value='1'></input>\n" if($
$page = $page . <<EOF; $page = $page . <<EOF;
</form> </form>
</div> </div>
<div id="snrValues">
<h2>
SNR: <span id="snr">0</span>dBm
</h2>
</div>
<div id="chartContainer" style="width: 80%; height: 60%;"></div> <div id="chartContainer" style="width: 80%; height: 60%;"></div>
</center> </center>
EOF EOF