• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

davewalker5 / ADS-B-BaseStationReader / 17804934237

17 Sep 2025 04:40PM UTC coverage: 89.917% (-3.8%) from 93.692%
17804934237

push

github

web-flow
Merge pull request #41 from davewalker5/filtered-tracking

Filtered tracking

381 of 461 branches covered (82.65%)

Branch coverage included in aggregate %.

1465 of 1592 new or added lines in 52 files covered. (92.02%)

1465 of 1592 relevant lines covered (92.02%)

38.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/BaseStationReader.BusinessLogic/Tracking/SimpleAircraftBehaviourAssessor.cs
1
using BaseStationReader.Entities.Interfaces;
2
using BaseStationReader.Entities.Tracking;
3

4
namespace BaseStationReader.BusinessLogic.Tracking
5
{
6
    public class SimpleAircraftBehaviourAssessor : IAircraftBehaviourAssessor
7
    {
8
        /// <summary>
9
        /// Examine an aircrafts altitude history to determine if it's in level flight, climbing
10
        /// or descending
11
        /// </summary>
12
        /// <param name="aircraft"></param>
13
        /// <returns></returns>
14
        public AircraftBehaviour Assess(Aircraft aircraft)
NEW
15
        {
×
NEW
16
            AircraftBehaviour behaviour = AircraftBehaviour.Unknown;
×
17

18
            // Get the history as a list and make sure it has sufficient entries for assessment
NEW
19
            var history = aircraft.AltitudeHistory.Items.ToList();
×
NEW
20
            if (history.Count > 2)
×
NEW
21
            {
×
22
                // Calculate the average change across all entries
NEW
23
                var averageChange = history.Average(x => x);
×
24

25
                // Assess the behaviour based on the average change
NEW
26
                if (averageChange < 0)
×
NEW
27
                {
×
NEW
28
                    behaviour = AircraftBehaviour.Descending;
×
NEW
29
                }
×
NEW
30
                else if (averageChange > 0)
×
NEW
31
                {
×
NEW
32
                    behaviour = AircraftBehaviour.Climbing;
×
NEW
33
                }
×
34
                else
NEW
35
                {
×
NEW
36
                    behaviour = AircraftBehaviour.LevelFlight;
×
NEW
37
                }
×
NEW
38
            }
×
39

NEW
40
            return behaviour;
×
NEW
41
        }
×
42
    }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc