Fix /path crash on clear-terrain diffraction loss
TerrainAnalysis.deygout_diffraction/2 short-circuits to integer 0 when the path has no interior points or the principal edge nu is below the shadow boundary, which then made Float.round/2 blow up inside compute_loss_budget when the rest of the losses were all floats. Multiply the diffraction value by 1.0 before it feeds into the total so clear paths coerce cleanly without touching TerrainAnalysis's (number()) contract.
This commit is contained in:
parent
8121257c59
commit
263c1bbdf5
1 changed files with 3 additions and 1 deletions
|
|
@ -380,7 +380,9 @@ defmodule MicrowavepropWeb.PathLive do
|
|||
|
||||
diffraction_loss =
|
||||
if terrain_result do
|
||||
terrain_result.analysis.diffraction_db
|
||||
# TerrainAnalysis.deygout_diffraction returns integer 0 for clear
|
||||
# paths; coerce to float so Float.round/2 below is happy.
|
||||
terrain_result.analysis.diffraction_db * 1.0
|
||||
else
|
||||
0.0
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue