Phase 2.2: performance optimizations, debug tools, app close fix
This commit is contained in:
@@ -273,4 +273,37 @@ class ReflectionService:
|
||||
return 10 * np.log10(total_power)
|
||||
|
||||
|
||||
def find_reflection_paths_sync(
|
||||
self,
|
||||
tx_lat: float, tx_lon: float, tx_height: float,
|
||||
rx_lat: float, rx_lon: float, rx_height: float,
|
||||
frequency_mhz: float,
|
||||
buildings: List[Building],
|
||||
include_ground: bool = True
|
||||
) -> List[ReflectionPath]:
|
||||
"""Sync version (no I/O in the async original)"""
|
||||
paths = []
|
||||
|
||||
for building in buildings:
|
||||
path = self._find_single_bounce(
|
||||
tx_lat, tx_lon, tx_height,
|
||||
rx_lat, rx_lon, rx_height,
|
||||
frequency_mhz, building
|
||||
)
|
||||
if path:
|
||||
paths.append(path)
|
||||
|
||||
if include_ground:
|
||||
ground_path = self._calculate_ground_reflection(
|
||||
tx_lat, tx_lon, tx_height,
|
||||
rx_lat, rx_lon, rx_height,
|
||||
frequency_mhz
|
||||
)
|
||||
if ground_path:
|
||||
paths.append(ground_path)
|
||||
|
||||
paths.sort(key=lambda p: p.total_loss)
|
||||
return paths[:5]
|
||||
|
||||
|
||||
reflection_service = ReflectionService()
|
||||
|
||||
Reference in New Issue
Block a user