From 56b48f76a72da6ac6d255a5298adffe760ba93f0 Mon Sep 17 00:00:00 2001 From: Patrick Grimm Date: Wed, 10 Jul 2013 18:11:09 +0000 Subject: [PATCH] luci-olsr: fix snr calc olsr neighbours and unit in Legend --- applications/luci-olsr/luasrc/controller/olsr.lua | 6 +++--- applications/luci-olsr/luasrc/view/status-olsr/legend.htm | 2 +- .../luci-olsr/luasrc/view/status-olsr/neighbors.htm | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua index daedcf54d..cdd5645b6 100644 --- a/applications/luci-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-olsr/luasrc/controller/olsr.lua @@ -227,9 +227,9 @@ function action_neigh(json) for assocmac, assot in pairs(val.list) do assocmac = string.lower(assocmac or "") if rmac == assocmac then - signal = tonumber(assot.signal)*-1 - noise = tonumber(assot.noise)*-1 - snr = noise - signal + signal = tonumber(assot.signal) + noise = tonumber(assot.noise) + snr = (noise*-1) - (signal*-1) end end end diff --git a/applications/luci-olsr/luasrc/view/status-olsr/legend.htm b/applications/luci-olsr/luasrc/view/status-olsr/legend.htm index 7575c122f..e70cf2c48 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/legend.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/legend.htm @@ -9,7 +9,7 @@
  • <%:Orange%>:<%:Still usable (4 < ETX < 10)%>
  • <%:Red%>:<%:Bad (ETX > 10)%>
  • -
  • SNR: <%:Signal Noise Ratio%>
  • +
  • SNR: <%:Signal Noise Ratio in dB%>