parameter value conversion on GUI

Dan Morphis dan at milkcarton.com
Fri Jun 30 19:50:10 EDT 2017


You need to create a parameter renderer. In the gui modify
config/parameter_renderers.yml:
InternetGatewayDevice.WANDevice.1.WANGponInterfaceConfig.RXPower: mw_power
InternetGatewayDevice.WANDevice.1.WANGponInterfaceConfig.TXPower: mw_power

Then in your config/parameter_renderers dir add a file called mw_power.rb:
def mw_power(val)
  dbm = val * 0.1

  "#{dbm} dBm"
end

On Fri, Jun 30, 2017 at 12:35 PM, Tunde Oyeyemi <toyeyemi at ipnxnigeria.net>
wrote:

> I need advise on the integration of Parameters values conversion on the
> GUI. I have the values for the following parameters added to the summary
> list. However, the unit for the parameters is in mW but I need the values
> in dBm on the GUI using the formula below. Please how do I achieve this. I
> will appreciate your input on this.
>
> InternetGatewayDevice.WANDevice.1.WANGponInterfaceConfig.RXPower
> InternetGatewayDevice.WANDevice.1.WANGponInterfaceConfig.TXPower
>
> =====================================
>
> #!/usr/bin/perl
>
> use POSIX qw(log10);
>
> $P = shift;
> $RxP = $P/10000000;
> $log_10 = 10*log10($RxP*1000);
> $rounded = sprintf "%.2f", $log_10;
> print "\n";
> print $rounded."dBm";
> print "\n";
>
> ========================================
>
> Tunde Oyeyemi.
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20170630/734eba5d/attachment.html>


More information about the Users mailing list