inav icon indicating copy to clipboard operation
inav copied to clipboard

Reorganise stats screens

Open MrD-RC opened this issue 2 years ago • 8 comments

This started as a basic re-organisation of the stats screens. But kinda grew a little. The main result is still a slightly more organised stats screen. But it adds a few more stats. Also, where things are now separated, it will be easier to make stats customisable.

Here's an example of the stats screen in Avatar (HITL) from 2 sequential flights. Stats - 2 sequential flights

Here are examples of the analogue stats screen. Note, that I have updated the AVG EFFICIENCY F/T to fit. image image

Bug Fixes

Not all stats were resetting on arm. As these are flight stats, this should be the case. I have gone through and made sure that all stats now reset when armed. But, not reset after an in-flight re-arm. The exception is the energy used from the battery. It is understandable that this stat would be useful if it were persistent. So both are shown. Total from when the battery was plugged in and the amount since arming.

New data on the stats screen

  • Min Volts now shows both pack and cell voltage
  • Used energy now shows total and flight use
  • Average efficiency also shows total and flight energy efficiency
  • Min and Max satellites
  • Min and Max ESC temperature
  • If using a non-metric OSD. The metric efficiency can be shown by enabling set osd_stats_show_metric_efficiency = on
  • Blackbox file number

Other things of note

  • osd_stats_min_voltage_unit has been removed, as both battery and cell voltages are shown now
  • Some stats titles have been subtly renamed, to make them easier to understand and fit better on screen:
    • Fly Time -> Flight Time
    • Traveled (sp) Distance -> Flight Distance
    • Max Distance -> Distance from home
    • Min Battery Volt -> Min Volts Pack/Cell
    • Used Capacity -> Used Energy Flight/Total
  • The headers and setting save status messages are now centred

Requires Configurator https://github.com/iNavFlight/inav-configurator/pull/1941

MrD-RC avatar Jan 04 '24 08:01 MrD-RC

Very nice update. I see the blackbox filename is available too - very useful.
Is the proposal to encode part of the model name in the blackbox filename deferred for a later update?

MartinHugh avatar Jan 04 '24 08:01 MartinHugh

Seems there is a discrepancy in compilers. The build is failing with image

Yet my compiler thinks it should be a long image

So which is correct. Should an int32_t be a long integer or integer.

EDIT Looks like the non-MAC build routines also think it should be a long, not an int?? image

@stronnag @DzikuVx any ideas?

MrD-RC avatar Jan 04 '24 21:01 MrD-RC

Just a comment ... I really don't like copying buff onto itself, when instead one could:

 tfp_sprintf(buff+strlen(buff), " %c%05" PRId32 " ",  SYM_BLACKBOX, logNumber);

Couldn't you? For the same effect.

Done. I found a few other occurrences throughout the OSD.c file.

MrD-RC avatar Jan 07 '24 21:01 MrD-RC

@MrD-RC We can't push it to 7.1. The change in osd_stats_min_voltage_unit is a breaking change comparing to 7.0.

DzikuVx avatar Jan 12 '24 09:01 DzikuVx

@MrD-RC We can't push it to 7.1. The change in osd_stats_min_voltage_unit is a breaking change comparing to 7.0.

I was wondering about that. But, I figured that both options for osd_stats_min_voltage_unit are now displayed. It wasn’t so much of an issue. But yes, it will cause an error in the diff.

MrD-RC avatar Jan 12 '24 12:01 MrD-RC

Then agreed. @MrD-RC please resolve conflicts and let's merge to master waiting for INAV 8

DzikuVx avatar Jan 12 '24 14:01 DzikuVx

Very nice update. I see the blackbox filename is available too - very useful. Is the proposal to encode part of the model name in the blackbox filename deferred for a later update?

I'll change that separately.

MrD-RC avatar Jan 13 '24 10:01 MrD-RC

image Now with added stats

MrD-RC avatar Feb 17 '24 22:02 MrD-RC

I guess also missed to be merged and got a few new conflicts @DzikuVx

b14ckyy avatar Mar 20 '24 12:03 b14ckyy

I guess also missed to be merged and got a few new conflicts @DzikuVx

I’ve been holding off merging until 7.1 comes out and those changes are merged with master.

MrD-RC avatar Mar 20 '24 14:03 MrD-RC

I need to test in flight on an MSP DisplayPort platform and disarm in flight. If that all goes ok, this will be good to merge.

MrD-RC avatar Mar 29 '24 12:03 MrD-RC

Tested in flight with MSP DisplayPort. It worked as expected.

MrD-RC avatar Mar 31 '24 08:03 MrD-RC