web: floor the optical power at -40 dBm

A dark receiver reports 0 mW, which printed as -Infinity dBm. The DOM
value has a resolution of 0.1 uW, so -40 dBm is the lowest reading the
module can express; clamp there.
This commit is contained in:
bloqaudio committed 2026-09-14 08:03:36 -05:00
1 parent 472811cc9a
commit 206c72b5ef
1 file changed
+1 -1
+1 -1
View File
@@ -629,7 +629,7 @@ function calRx(val,cal){
return v.getFloat32(0)*Math.pow(val,4)+v.getFloat32(4)*Math.pow(val,3)
+v.getFloat32(8)*Math.pow(val,2)+v.getFloat32(12)*val+v.getFloat32(16);
}
function dBm(mw){return 10*Math.log10(mw)}
function dBm(mw){return 10*Math.log10(Math.max(mw,1e-4))}
function portRows(p){
var rows=[[t("c_port"),String(p.portNum)],[t("c_type"),p.isSFP?"SFP":"RJ45"]];
if(p.name)rows.push([t("c_name"),p.name]);