Browse Source

AP_OSD: Add fence indicator panel

zr-v5.1
Hwurzburg 4 years ago committed by Andrew Tridgell
parent
commit
fda07e7dc8
  1. 2
      libraries/AP_OSD/AP_OSD.h
  2. 35
      libraries/AP_OSD/AP_OSD_Screen.cpp
  3. 172
      libraries/AP_OSD/fonts/bfstyle.mcm
  4. BIN
      libraries/AP_OSD/fonts/bfstyle.png
  5. 172
      libraries/AP_OSD/fonts/bold.mcm
  6. BIN
      libraries/AP_OSD/fonts/bold.png
  7. 172
      libraries/AP_OSD/fonts/clarity.mcm
  8. BIN
      libraries/AP_OSD/fonts/clarity.png
  9. 172
      libraries/AP_OSD/fonts/clarity_medium.mcm
  10. BIN
      libraries/AP_OSD/fonts/clarity_medium.png
  11. 172
      libraries/AP_OSD/fonts/digital.mcm
  12. BIN
      libraries/AP_OSD/fonts/digital.png
  13. BIN
      libraries/AP_OSD/fonts/font0.bin
  14. BIN
      libraries/AP_OSD/fonts/font1.bin
  15. BIN
      libraries/AP_OSD/fonts/font2.bin
  16. BIN
      libraries/AP_OSD/fonts/font3.bin
  17. BIN
      libraries/AP_OSD/fonts/font4.bin

2
libraries/AP_OSD/AP_OSD.h

@ -184,6 +184,7 @@ private: @@ -184,6 +184,7 @@ private:
AP_OSD_Setting callsign{false, 0, 0};
AP_OSD_Setting vtx_power{false, 0, 0};
AP_OSD_Setting hgt_abvterr{true, 23, 7};
AP_OSD_Setting fence{true, 14, 9};
#if HAL_PLUSCODE_ENABLE
AP_OSD_Setting pluscode{false, 0, 0};
#endif
@ -256,6 +257,7 @@ private: @@ -256,6 +257,7 @@ private:
void draw_current2(uint8_t x, uint8_t y);
void draw_vtx_power(uint8_t x, uint8_t y);
void draw_hgt_abvterr(uint8_t x, uint8_t y);
void draw_fence(uint8_t x, uint8_t y);
struct {

35
libraries/AP_OSD/AP_OSD_Screen.cpp

@ -46,6 +46,7 @@ @@ -46,6 +46,7 @@
#include <ctype.h>
#include <GCS_MAVLink/GCS.h>
#include <AC_Fence/AC_Fence.h>
const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
@ -961,6 +962,22 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = { @@ -961,6 +962,22 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
// @Description: Vertical position on screen
// @Range: 0 15
AP_SUBGROUPINFO(restvolt, "RESTVOLT", 58, AP_OSD_Screen, AP_OSD_Setting),
// @Param: FENCE_EN
// @DisplayName: FENCE_EN
// @Description: Displays indication of fence enable and breach
// @Values: 0:Disabled,1:Enabled
// @Param: FENCE_X
// @DisplayName: FENCE_X
// @Description: Horizontal position on screen
// @Range: 0 29
// @Param: FENCE_Y
// @DisplayName: FENCE_Y
// @Description: Vertical position on screen
// @Range: 0 15
AP_SUBGROUPINFO(fence, "FENCE", 59, AP_OSD_Screen, AP_OSD_Setting),
AP_GROUPEND
};
@ -1057,6 +1074,8 @@ AP_OSD_Screen::AP_OSD_Screen() @@ -1057,6 +1074,8 @@ AP_OSD_Screen::AP_OSD_Screen()
#define SYM_CLK 0xBC
#define SYM_KILO 0x4B
#define SYM_TERALT 0xEF
#define SYM_FENCE_ENABLED 0xF5
#define SYM_FENCE_DISABLED 0xF6
void AP_OSD_AbstractScreen::set_backend(AP_OSD_Backend *_backend)
@ -1949,6 +1968,21 @@ void AP_OSD_Screen::draw_hgt_abvterr(uint8_t x, uint8_t y) @@ -1949,6 +1968,21 @@ void AP_OSD_Screen::draw_hgt_abvterr(uint8_t x, uint8_t y)
}
#endif
void AP_OSD_Screen::draw_fence(uint8_t x, uint8_t y)
{
AC_Fence *fenceptr = AP::fence();
if (fenceptr == nullptr) {
return;
}
if (fenceptr->enabled() && fenceptr->present()) {
backend->write(x, y, fenceptr->get_breaches(), "%c", SYM_FENCE_ENABLED);
} else {
backend->write(x, y, false, "%c", SYM_FENCE_DISABLED);
}
}
#define DRAW_SETTING(n) if (n.enabled) draw_ ## n(n.xpos, n.ypos)
#if HAL_WITH_OSD_BITMAP
@ -1991,6 +2025,7 @@ void AP_OSD_Screen::draw(void) @@ -1991,6 +2025,7 @@ void AP_OSD_Screen::draw(void)
DRAW_SETTING(heading);
DRAW_SETTING(wind);
DRAW_SETTING(home);
DRAW_SETTING(fence);
DRAW_SETTING(roll_angle);
DRAW_SETTING(pitch_angle);
DRAW_SETTING(temp);

172
libraries/AP_OSD/fonts/bfstyle.mcm

@ -15679,22 +15679,60 @@ MAX7456 @@ -15679,22 +15679,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010101
00100000
00010101
01010101
00101000
00010101
01010101
00100000
00010101
01010101
00100000
00010101
01010101
00000000
00000001
01010101
01010010
10100001
01010101
01010010
00000001
01010101
01010010
10000001
01010101
01010010
00000001
01010101
01010010
10100000
00000000
01010000
00000010
00001000
01010101
01010010
10001000
01010101
01010010
10101000
01010101
01010010
00101000
01010101
01010010
00001000
01010101
01010000
00000000
01010101
01010101
01010101
@ -15705,98 +15743,60 @@ MAX7456 @@ -15705,98 +15743,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010100
00100000
00010101
01010010
00101000
00010101
01001010
00100000
00010101
00101000
00100000
00010100
10100001
00000000
00000010
10000101
01010010
10001010
00010101
01010010
00101000
01010101
01010000
10100001
01010101
01010010
10000001
01010101
01001010
00100000
00000000
00101000
00000010
00001000
10100001
01010010
10001000
10000101
01010010
10101000
00010101
01010010
00101000
01010101
01010010
00001000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
00000000
01010101
01010101
01010101

BIN
libraries/AP_OSD/fonts/bfstyle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

172
libraries/AP_OSD/fonts/bold.mcm

@ -15679,22 +15679,60 @@ MAX7456 @@ -15679,22 +15679,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010101
00100000
00010101
01010101
00101000
00010101
01010101
00100000
00010101
01010101
00100000
00010101
01010101
00000000
00000001
01010101
01010010
10100001
01010101
01010010
00000001
01010101
01010010
10000001
01010101
01010010
00000001
01010101
01010010
10100000
00000000
01010000
00000010
00001000
01010101
01010010
10001000
01010101
01010010
10101000
01010101
01010010
00101000
01010101
01010010
00001000
01010101
01010000
00000000
01010101
01010101
01010101
@ -15705,98 +15743,60 @@ MAX7456 @@ -15705,98 +15743,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010100
00100000
00010101
01010010
00101000
00010101
01001010
00100000
00010101
00101000
00100000
00010100
10100001
00000000
00000010
10000101
01010010
10001010
00010101
01010010
00101000
01010101
01010000
10100001
01010101
01010010
10000001
01010101
01001010
00100000
00000000
00101000
00000010
00001000
10100001
01010010
10001000
10000101
01010010
10101000
00010101
01010010
00101000
01010101
01010010
00001000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
00000000
01010101
01010101
01010101

BIN
libraries/AP_OSD/fonts/bold.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

172
libraries/AP_OSD/fonts/clarity.mcm

@ -15679,22 +15679,60 @@ MAX7456 @@ -15679,22 +15679,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010101
00100000
00010101
01010101
00101000
00010101
01010101
00100000
00010101
01010101
00100000
00010101
01010101
00000000
00000001
01010101
01010010
10100001
01010101
01010010
00000001
01010101
01010010
10000001
01010101
01010010
00000001
01010101
01010010
10100000
00000000
01010000
00000010
00001000
01010101
01010010
10001000
01010101
01010010
10101000
01010101
01010010
00101000
01010101
01010010
00001000
01010101
01010000
00000000
01010101
01010101
01010101
@ -15705,98 +15743,60 @@ MAX7456 @@ -15705,98 +15743,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010100
00100000
00010101
01010010
00101000
00010101
01001010
00100000
00010101
00101000
00100000
00010100
10100001
00000000
00000010
10000101
01010010
10001010
00010101
01010010
00101000
01010101
01010000
10100001
01010101
01010010
10000001
01010101
01001010
00100000
00000000
00101000
00000010
00001000
10100001
01010010
10001000
10000101
01010010
10101000
00010101
01010010
00101000
01010101
01010010
00001000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
00000000
01010101
01010101
01010101

BIN
libraries/AP_OSD/fonts/clarity.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

172
libraries/AP_OSD/fonts/clarity_medium.mcm

@ -15679,22 +15679,60 @@ MAX7456 @@ -15679,22 +15679,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010101
00100000
00010101
01010101
00101000
00010101
01010101
00100000
00010101
01010101
00100000
00010101
01010101
00000000
00000001
01010101
01010010
10100001
01010101
01010010
00000001
01010101
01010010
10000001
01010101
01010010
00000001
01010101
01010010
10100000
00000000
01010000
00000010
00001000
01010101
01010010
10001000
01010101
01010010
10101000
01010101
01010010
00101000
01010101
01010010
00001000
01010101
01010000
00000000
01010101
01010101
01010101
@ -15705,98 +15743,60 @@ MAX7456 @@ -15705,98 +15743,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010100
00100000
00010101
01010010
00101000
00010101
01001010
00100000
00010101
00101000
00100000
00010100
10100001
00000000
00000010
10000101
01010010
10001010
00010101
01010010
00101000
01010101
01010000
10100001
01010101
01010010
10000001
01010101
01001010
00100000
00000000
00101000
00000010
00001000
10100001
01010010
10001000
10000101
01010010
10101000
00010101
01010010
00101000
01010101
01010010
00001000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
00000000
01010101
01010101
01010101

BIN
libraries/AP_OSD/fonts/clarity_medium.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

172
libraries/AP_OSD/fonts/digital.mcm

@ -15679,22 +15679,60 @@ MAX7456 @@ -15679,22 +15679,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010101
00100000
00010101
01010101
00101000
00010101
01010101
00100000
00010101
01010101
00100000
00010101
01010101
00000000
00000001
01010101
01010010
10100001
01010101
01010010
00000001
01010101
01010010
10000001
01010101
01010010
00000001
01010101
01010010
10100000
00000000
01010000
00000010
00001000
01010101
01010010
10001000
01010101
01010010
10101000
01010101
01010010
00101000
01010101
01010010
00001000
01010101
01010000
00000000
01010101
01010101
01010101
@ -15705,98 +15743,60 @@ MAX7456 @@ -15705,98 +15743,60 @@ MAX7456
01010101
01010101
01010101
00000000
00010101
01010101
00101010
00010101
01010100
00100000
00010101
01010010
00101000
00010101
01001010
00100000
00010101
00101000
00100000
00010100
10100001
00000000
00000010
10000101
01010010
10001010
00010101
01010010
00101000
01010101
01010000
10100001
01010101
01010010
10000001
01010101
01001010
00100000
00000000
00101000
00000010
00001000
10100001
01010010
10001000
10000101
01010010
10101000
00010101
01010010
00101000
01010101
01010010
00001000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
00000000
01010101
01010101
01010101

BIN
libraries/AP_OSD/fonts/digital.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 502 KiB

BIN
libraries/AP_OSD/fonts/font0.bin

Binary file not shown.

BIN
libraries/AP_OSD/fonts/font1.bin

Binary file not shown.

BIN
libraries/AP_OSD/fonts/font2.bin

Binary file not shown.

BIN
libraries/AP_OSD/fonts/font3.bin

Binary file not shown.

BIN
libraries/AP_OSD/fonts/font4.bin

Binary file not shown.
Loading…
Cancel
Save