Describe the bug
When LiveTraffic shows the maximum allowed number of planes (e.g. 100, I hit that limit quite frequently at KLAX), then only the planes closest to the camera are shown. That works fine.
In DEBUG logs it can be seen, though, that LiveTraffic tries to create additional father away planes only to remove them immediately again because they are father away than the closest 100 planes.
This might not even be noticeable to the user, but is a waste of resources and also means (with current implementation) that the entire track record of that plane is thrown away.
To Reproduce
Steps to reproduce the behavior:
Go to KLAX, maybe reduce max number allowed planes in Advanced Settings
Switch logging level to DEBUG
Wait for the number of planes to hit the configured max
Check Log.txt
Expected behavior
[x] Don't even create planes that would be destoyed immediately.
[x] Keep tracking data in memory for far away planes so they are readily available when coming closer.
[x] Enhancement beyond the above: When removing plane models (because they are beyond the configured limits) remove only the Aircraft object, but keep the flight tracking data, so the plane can quickly be re-instantiated in case it comes into reach. This enhancement was in essence discussed here.
Technical Info:
OS: all
X-Plane version: all
LiveTraffic version: v2.20
Log.txt
1:13:07.926 LiveTraffic INFO LTAircraft.cpp:1270/LTAircraft: Added aircraft ICAO A7A0E8 (BE33 N5908S), operator '', a/c model 'BB_GA BE20_BGT', flight model [GA], bearing 128, distance 55.1nm, from channel OpenSky Live Online
1:13:07.926 LiveTraffic INFO LTAircraft.cpp:1286/~LTAircraft: Removed aircraft ICAO A7A0E8 (BE33 N5908S)
1:13:07.926 LT/XPMP2 INFO CSLModels.cpp:1216/CSLFindMatch: MATCH INPUT: Type=BE9L (WTC=L,Class=L2T,Related=128), Airline=EJA, Livery=N620QS
1:13:07.926 LT/XPMP2 INFO CSLModels.cpp:1322/CSLFindMatch: MATCH FOUND: Type=BE20 (WTC=L,Class=L2T,Related=128), Airline=JEI, Livery= / Quality = 16 -> BB_GA BE20_DIKOB
1:13:07.926 LiveTraffic INFO LTAircraft.cpp:1270/LTAircraft: Added aircraft ICAO A817AC (BE9L 1I620), operator '', a/c model 'BB_GA BE20_DIKOB', flight model [MediumJets], bearing 12, distance 47.5nm, from channel OpenSky Live Online
1:13:07.926 LiveTraffic INFO LTAircraft.cpp:1286/~LTAircraft: Removed aircraft ICAO A817AC (BE9L 1I620)
1:13:07.926 LT/XPMP2 INFO CSLModels.cpp:1216/CSLFindMatch: MATCH INPUT: Type=AS50 (WTC=L,Class=H1T,Related=183), Airline=N66, Livery=N66103
1:13:07.926 LT/XPMP2 INFO CSLModels.cpp:1322/CSLFindMatch: MATCH FOUND: Type=B06 (WTC=L,Class=H1T,Related=183), Airline=TXB, Livery= / Quality = 16 -> BB_Heli B06_GHSDW
1:13:07.926 LiveTraffic INFO LTAircraft.cpp:1270/LTAircraft: Added aircraft ICAO A8BA64 (AS50 N66103), operator '', a/c model 'BB_Heli B06_GHSDW', flight model [Heli], bearing 87, distance 43.2nm, from channel OpenSky Live Online
1:13:07.926 LiveTraffic INFO LTAircraft.cpp:1286/~LTAircraft: Removed aircraft ICAO A8BA64 (AS50 N66103)
Describe the bug When LiveTraffic shows the maximum allowed number of planes (e.g. 100, I hit that limit quite frequently at KLAX), then only the planes closest to the camera are shown. That works fine. In DEBUG logs it can be seen, though, that LiveTraffic tries to create additional father away planes only to remove them immediately again because they are father away than the closest 100 planes. This might not even be noticeable to the user, but is a waste of resources and also means (with current implementation) that the entire track record of that plane is thrown away.
To Reproduce Steps to reproduce the behavior:
Log.txt
Expected behavior
Technical Info:
Log.txt