From: Patrick Grimm Date: Wed, 10 Jul 2013 18:11:09 +0000 (+0000) Subject: luci-olsr: fix snr calc olsr neighbours and unit in Legend X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=56b48f76a72da6ac6d255a5298adffe760ba93f0 luci-olsr: fix snr calc olsr neighbours and unit in Legend --- 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%>