mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-04-20 22:13:48 +00:00
feat: show radio horizon on los profile
This commit is contained in:
parent
700e85b13d
commit
2bdd9d35cc
2 changed files with 155 additions and 3 deletions
|
|
@ -12,12 +12,14 @@ class LineOfSightSample {
|
|||
final double distanceMeters;
|
||||
final double terrainMeters;
|
||||
final double lineHeightMeters;
|
||||
final double radioHorizonMeters;
|
||||
final double clearanceMeters;
|
||||
|
||||
const LineOfSightSample({
|
||||
required this.distanceMeters,
|
||||
required this.terrainMeters,
|
||||
required this.lineHeightMeters,
|
||||
required this.radioHorizonMeters,
|
||||
required this.clearanceMeters,
|
||||
});
|
||||
}
|
||||
|
|
@ -238,6 +240,7 @@ class LineOfSightService {
|
|||
(2 * effectiveEarthRadius);
|
||||
final terrainHeight = elevations[i] + earthBulge;
|
||||
final clearance = lineHeight - terrainHeight;
|
||||
final radioHorizonHeight = lineHeight - earthBulge;
|
||||
|
||||
if (clearance < -obstructionToleranceMeters) {
|
||||
isClear = false;
|
||||
|
|
@ -253,6 +256,7 @@ class LineOfSightService {
|
|||
distanceMeters: distanceFromStart,
|
||||
terrainMeters: terrainHeight,
|
||||
lineHeightMeters: lineHeight,
|
||||
radioHorizonMeters: radioHorizonHeight,
|
||||
clearanceMeters: clearance,
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue