Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganise stats screens #9617

Merged
merged 41 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
afc87d2
add some icons for O3 with integra for ESP32 Radar instead of ?
druckgott Nov 18, 2023
7caf60c
trial
shota3527 Aug 9, 2023
c0842a2
initial cut on tail sitter support
shota3527 Aug 10, 2023
40986f0
tailsitter support
shota3527 Aug 11, 2023
2162b64
update tailsitter documents
shota3527 Aug 12, 2023
b55164f
add compass changing aliment
shota3527 Sep 28, 2023
aee7c4e
moved tailsitter platform type to tailsitter_board_orientation
shota3527 Oct 7, 2023
7b8dd3d
bug fixes
shota3527 Oct 7, 2023
4e47e14
update docs
shota3527 Oct 7, 2023
b9017ca
parameter rename
shota3527 Oct 16, 2023
dc7147d
logic condition RCcommand overide also works for angle mode
shota3527 Oct 20, 2023
41e5b17
USB MSC: Fix SCIS mode sense write protection bit (#9572)
mluessi Dec 16, 2023
88d4359
Reorganise stats screen
MrD-RC Dec 24, 2023
b1cbfaa
Added ESC temperature stat
MrD-RC Dec 24, 2023
952c833
Centred the settings saved message
MrD-RC Dec 24, 2023
d22c039
Some re-arrangement for HD
MrD-RC Dec 26, 2023
2632abb
Added Blackbox stuff
MrD-RC Dec 27, 2023
1753ed1
Added blackbox to multipage stats
MrD-RC Dec 29, 2023
1efec56
Update osd.c
MrD-RC Dec 31, 2023
46512f4
Updates
MrD-RC Jan 4, 2024
ed26058
Fix issues on GitHib compilers
MrD-RC Jan 4, 2024
ea17875
Set back to ld. Builds without issues on my system
MrD-RC Jan 4, 2024
b35cb0e
Missed #if defined(USE_ESC_SENSOR)
MrD-RC Jan 4, 2024
31cbfde
Fix Mac SITL test
MrD-RC Jan 5, 2024
1419e9a
Another one! Bloody Macs!!
MrD-RC Jan 5, 2024
be9da9a
Updates
MrD-RC Jan 7, 2024
c48f514
Removed round brackets from analogue stats headers
MrD-RC Jan 7, 2024
ac74878
Update osd.c
MrD-RC Jan 8, 2024
1e6a20f
Unfuck rebase
MrD-RC Jan 13, 2024
4f4e861
More rebase fixes
MrD-RC Jan 13, 2024
5001272
Changed OSD_BLACKBOX introduction version number
MrD-RC Jan 13, 2024
e1142c8
Merge branch 'master' into MrD_Reorganise-Stats-screens
MrD-RC Feb 17, 2024
57d84fc
Show stats if space & improve formatting
MrD-RC Feb 17, 2024
014942a
Corrected required remaining rows for stats check
MrD-RC Feb 17, 2024
dd9e459
Formatting changes
MrD-RC Feb 20, 2024
5aa15a5
Commented out currently unused function
MrD-RC Feb 20, 2024
87968eb
Merge branch 'master' into MrD_Reorganise-Stats-screens
MrD-RC Mar 29, 2024
9b94b4c
Temporarily remove the rearm period
MrD-RC Mar 29, 2024
62fcb48
Merge branch 'master' into MrD_Reorganise-Stats-screens
MrD-RC Mar 31, 2024
cf36eed
Merge branch 'master' into MrD_Reorganise-Stats-screens
MrD-RC Apr 1, 2024
601bcfe
Added missing include. Thought it was already there
MrD-RC Apr 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
339 changes: 190 additions & 149 deletions docs/OSD.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -4892,23 +4892,23 @@ Unit used for the drawn energy in the OSD stats [MAH/WH] (milliAmpere hour/ Watt

---

### osd_stats_min_voltage_unit
### osd_stats_page_auto_swap_time

Display minimum voltage of the `BATTERY` or the average per `CELL` in the OSD stats.
Auto swap display time interval between disarm stats pages (seconds). Reverts to manual control when Roll stick used to change pages. Disabled when set to 0.

| Default | Min | Max |
| --- | --- | --- |
| BATTERY | | |
| 3 | 0 | 10 |

---

### osd_stats_page_auto_swap_time
### osd_stats_show_metric_efficiency

Auto swap display time interval between disarm stats pages (seconds). Reverts to manual control when Roll stick used to change pages. Disabled when set to 0.
Enabling this option will show metric efficiency statistics on the post flight stats screen. In addition to the efficiency statistics in your chosen units.

| Default | Min | Max |
| --- | --- | --- |
| 3 | 0 | 10 |
| OFF | OFF | ON |

---

Expand Down
34 changes: 34 additions & 0 deletions src/main/blackbox/blackbox_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"

#ifdef USE_SDCARD
#include "drivers/sdcard/sdcard.h"
#endif

#include "io/asyncfatfs/asyncfatfs.h"
#include "io/flashfs.h"
#include "io/serial.h"
Expand Down Expand Up @@ -507,6 +511,36 @@ bool isBlackboxDeviceFull(void)
}
}

bool isBlackboxDeviceWorking(void)
{
switch (blackboxConfig()->device) {
case BLACKBOX_DEVICE_SERIAL:
return blackboxPort != NULL;
#ifdef USE_SDCARD
case BLACKBOX_DEVICE_SDCARD:
return sdcard_isInserted() && sdcard_isFunctional() && (afatfs_getFilesystemState() == AFATFS_FILESYSTEM_STATE_READY);
#endif
#ifdef USE_FLASHFS
case BLACKBOX_DEVICE_FLASH:
return flashfsIsReady();
#endif
default:
return false;
}
}

int32_t blackboxGetLogNumber(void)
{
switch (blackboxConfig()->device) {
#ifdef USE_SDCARD
case BLACKBOX_DEVICE_SDCARD:
return blackboxSDCard.largestLogFileNumber;
#endif
default:
return -1;
}
}

/**
* Call once every loop iteration in order to maintain the global blackboxHeaderBudget with the number of bytes we can
* transmit this iteration.
Expand Down
2 changes: 2 additions & 0 deletions src/main/blackbox/blackbox_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ bool blackboxDeviceBeginLog(void);
bool blackboxDeviceEndLog(bool retainLog);

bool isBlackboxDeviceFull(void);
bool isBlackboxDeviceWorking(void);
int32_t blackboxGetLogNumber(void);

void blackboxReplenishHeaderBudget(void);
blackboxBufferReserveStatus_e blackboxDeviceReserveBufferSpace(int32_t bytes);
2 changes: 2 additions & 0 deletions src/main/common/maths.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#define METERS_TO_MILES(m) (m / 1609.344f)
#define METERS_TO_NAUTICALMILES(m) (m / 1852.00f)

#define MWH_TO_WH(mWh) (mWh / 1000.0f)

#define CMSEC_TO_CENTIMPH(cms) (cms * 2.2369363f)
#define CMSEC_TO_CENTIKPH(cms) (cms * 3.6f)
#define CMSEC_TO_CENTIKNOTS(cms) (cms * 1.943845f)
Expand Down
2 changes: 2 additions & 0 deletions src/main/drivers/osd_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
#define SYM_ALERT 0xDD // 221 General alert symbol
#define SYM_TERRAIN_FOLLOWING 0xFB // 251 Terrain following (also Alt adjust)
#define SYM_CROSS_TRACK_ERROR 0xFC // 252 Cross track error
#define SYM_ADSB 0xFD // 253 ADBS
#define SYM_BLACKBOX 0xFE // 254 Blackbox


#define SYM_ADSB 0xFD // 253 ADSB
Expand Down
4 changes: 4 additions & 0 deletions src/main/fc/fc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,10 @@ float getFlightTime(void)
return US2S(flightTime);
}

void resetFlightTime(void) {
flightTime = 0;
}

float getArmTime(void)
{
return US2S(armTime);
Expand Down
1 change: 1 addition & 0 deletions src/main/fc/fc_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ bool emergencyArmingUpdate(bool armingSwitchIsOn, bool forceArm);

bool areSensorsCalibrating(void);
float getFlightTime(void);
void resetFlightTime(void);
float getArmTime(void);

void fcReboot(bool bootLoader);
16 changes: 5 additions & 11 deletions src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ tables:
- name: osd_stats_energy_unit
values: ["MAH", "WH"]
enum: osd_stats_energy_unit_e
- name: osd_stats_min_voltage_unit
values: ["BATTERY", "CELL"]
enum: osd_stats_min_voltage_unit_e
- name: osd_video_system
values: ["AUTO", "PAL", "NTSC", "HDZERO", "DJIWTF", "AVATAR", "BF43COMPAT", "BFHDCOMPAT"]
enum: videoSystem_e
Expand Down Expand Up @@ -1204,8 +1201,6 @@ groups:
field: mixer_config.tailsitterOrientationOffset
type: bool



- name: PG_REVERSIBLE_MOTORS_CONFIG
type: reversibleMotorsConfig_t
members:
Expand Down Expand Up @@ -3175,18 +3170,17 @@ groups:
field: stats_energy_unit
table: osd_stats_energy_unit
type: uint8_t
- name: osd_stats_min_voltage_unit
description: "Display minimum voltage of the `BATTERY` or the average per `CELL` in the OSD stats."
default_value: "BATTERY"
field: stats_min_voltage_unit
table: osd_stats_min_voltage_unit
type: uint8_t
- name: osd_stats_page_auto_swap_time
description: "Auto swap display time interval between disarm stats pages (seconds). Reverts to manual control when Roll stick used to change pages. Disabled when set to 0."
default_value: 3
field: stats_page_auto_swap_time
min: 0
max: 10
- name: osd_stats_show_metric_efficiency
description: "Enabling this option will show metric efficiency statistics on the post flight stats screen. In addition to the efficiency statistics in your chosen units."
default_value: OFF
type: bool
field: stats_show_metric_efficiency
- name: osd_rssi_alarm
description: "Value below which to make the OSD RSSI indicator blink"
default_value: 20
Expand Down
Loading
Loading