08-19-2018, 09:49 AM (This post was last modified: 08-19-2018, 10:15 AM by PortalNET.)
Hi guys
i am having some troubles in trying to setup the following in PHP
i have a xml file that reads out the direct results of my card.
i want to parse it to php in code igniter but i am having some troubles
i need to convert a decimal result into dBm, which i found the code below
and want to print it on the php page with a menu bar signal kind of thing similar to wifi
basically it reads a DVB signal from the xml file and outputs it in php page but the current result is output in decimal which is weird cause i need to convert it to dBM
i have the following code to convert it to dBm
PHP Code:
function calcDb() { var frm = document.calc; if (frm.perc.value == null || frm.perc.value.length == 0) { return; } var perc = frm.perc.value; var db = Math.round(1000000000*20*(Math.log(perc*0.01)/Math.log(10)))/1000000000; document.getElementById("answerDb").innerHTML = db + " %"; }
which currently i need to input result manually
atm i am reading those with this.
PHP Code:
<td align="center">Signal:</td> <?php foreach ($signal as $item):
and the actual result is descbribed on the picture below
pic1
i would like to display the results in dbm example SNR 50% OR 70% dB and display it in a graphic similar to this one on pic2 fe has lock. status:SCVYL signal:60% snr:80% ber:0 unc:0