dronetag / drone-scanner

Multi-platform mobile application for receiving Remote ID information broadcasted by nearby UAVs, compatible with ASTM F3411, ASD-STAN prEN 4709-002 standards
142 stars 28 forks source link

feat: add units setting and improve exports #83

Closed matejglejtek closed 2 months ago

matejglejtek commented 3 months ago

Add units settings do Drone Scanner, mainly adding imperial units. Add distance, altitude, speed units. Motivation for this task is the number of bad reviews from the US because we were missing their clever units.

The implementation is to large extent inspired by the app. Add UnitValue class and UnitsSettingsCubit. Add units_converter package for the actual conversions. Conversions are implemented in UnitsConversionService, which is then used by the units cubit or the CSVLogger.

Convert distance/altitude/speed values in the UI, app's backend still works with default units, for example proximity alert distance is still saved in meters, but input/output in UI is converted.

Add units selection dropdowns to app preferences.

Exported files are optionally converted. Exports were improved by moving units to headers and adding timestamp to exported file name.

This is quite a big change because it affects drone radar, spoofer detection, exports. Please test these features as well.

Screenshot 2024-06-16 at 18 33 31 Screenshot 2024-06-16 at 18 42 35 Screenshot 2024-06-16 at 18 33 21
albertmoravec commented 3 months ago

IMG_20240617_175644.jpg

Not sure if converting everything from meters is the best idea, as the values look completely arbitrary when using other units. Thoughts @marianhlavac?

albertmoravec commented 3 months ago

image

Classification type conversion to string seems to be broken, but it might be unrelated to this PR.

matejglejtek commented 3 months ago

Classification type conversion to string seems to be broken, but it might be unrelated to this PR.

This is actually the result of UAClassificationEurope.toString()from dart-opendroneid, but it is unnecessary because category and class are in following columns. I changed it to just 'europe'/'undeclared'.