Skip to content

Commit

Permalink
Update GPS menu (#83)
Browse files Browse the repository at this point in the history
clean up and present more/better info
  • Loading branch information
oxothnk423 authored Feb 25, 2025
1 parent 737b7d7 commit ab5fb2d
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 104 deletions.
Binary file modified FontCreation/bdf.tga
Binary file not shown.
128 changes: 96 additions & 32 deletions FontCreation/leaf_5x8.bdf
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,95 @@ ENDPROPERTIES
CHARS 96
STARTCHAR 032
ENCODING 32
SWIDTH 288 0
DWIDTH 4 0
SWIDTH 432 0
DWIDTH 6 0
BBX 0 0 0 0
BITMAP
ENDCHAR
STARTCHAR 033
ENCODING 33
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 216 0
DWIDTH 3 0
BBX 1 8 0 0
BITMAP
80
80
80
80
80
00
00
80
ENDCHAR
STARTCHAR 034
ENCODING 34
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 288 0
DWIDTH 4 0
BBX 3 3 0 5
BITMAP
A0
A0
A0
ENDCHAR
STARTCHAR 035
ENCODING 35
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 432 0
DWIDTH 6 0
BBX 5 8 0 0
BITMAP
50
50
F8
50
50
F8
50
50
ENDCHAR
STARTCHAR 036
ENCODING 36
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 432 0
DWIDTH 6 0
BBX 5 8 0 0
BITMAP
20
70
A8
60
30
A8
70
20
ENDCHAR
STARTCHAR 037
ENCODING 37
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 504 0
DWIDTH 7 0
BBX 6 8 0 0
BITMAP
40
A4
A8
50
28
54
94
08
ENDCHAR
STARTCHAR 038
ENCODING 38
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 432 0
DWIDTH 6 0
BBX 5 8 0 0
BITMAP
60
90
90
60
A8
90
98
68
ENDCHAR
STARTCHAR 039
ENCODING 39
Expand Down Expand Up @@ -346,31 +389,52 @@ C0
ENDCHAR
STARTCHAR 060
ENCODING 60
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 432 0
DWIDTH 6 0
BBX 5 5 0 1
BITMAP
18
60
80
60
18
ENDCHAR
STARTCHAR 061
ENCODING 61
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 432 0
DWIDTH 6 0
BBX 5 3 0 2
BITMAP
F8
00
F8
ENDCHAR
STARTCHAR 062
ENCODING 62
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 432 0
DWIDTH 6 0
BBX 5 5 0 1
BITMAP
C0
30
08
30
C0
ENDCHAR
STARTCHAR 063
ENCODING 63
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
SWIDTH 432 0
DWIDTH 6 0
BBX 5 8 0 0
BITMAP
70
88
88
10
20
20
00
20
ENDCHAR
STARTCHAR 064
ENCODING 64
Expand Down
62 changes: 32 additions & 30 deletions FontCreation/leaf_5x8.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,35 @@
Glyphs: 96/96
BBX Build Mode: 0
*/
const uint8_t leaf_5x8[910] U8G2_FONT_SECTION("leaf_5x8") =
"`\0\3\2\3\4\2\4\5\6\10\0\0\10\0\10\0\1\14\2U\3q \5\0\221\2!\5\0\61"
"\3\42\5\0\61\3#\5\0\61\3$\5\0\61\3%\5\0\61\3&\5\0\61\3'\5\31[b("
"\7BqF\351))\11Bq\42J\272(\0*\12-\325\252RY\232\42\0+\12-\325*\214\6"
")\214\0,\7\32qBQ\0-\6\15\331b\20.\6\22qb\10/\13D\261\256\224EY\224e"
"\0\60\12E\321f\311|K\26\0\61\10\303\321&\221z\31\62\12E\321f\311\302\254\343 \63\14E"
"\321b\320\212j\250%\13\0\64\14E\321.\223\222R\62ha\5\65\14E\321\342\30\16i\250%\13"
"\0\66\14E\321f\311\304!\311l\311\2\67\14E\321b\20\263\60\13\263\60\3\70\14E\321f\311\264"
"d\311l\311\2\71\14E\321f\311l\311\20j\311\2:\10\62sb\10\207\0;\10:qb\10\25"
"\5<\5\0\61\3=\5\0\61\3>\5\0\61\3\77\5\0\61\3@\16F\361j\312\244DI\226d"
"Z\342\5A\13E\321f\311l\303\220\331\2B\15E\321bH\62mP\62\333\240\0C\12E\321f"
"\311\304n\311\2D\12E\321b\252d\236\222\11E\13D\261b\320\262%\253\15\1F\12D\261b\320"
"\262%k\3G\14E\321f\311\304\322\246%\13\0H\12E\321\42\263\15C\346\26I\10C\221b\211"
"z\31J\12D\261Jk\223\244D\1K\13D\261\42\262$RR\62\5L\10D\261\42\353\333\20M"
"\14E\321\42[\226DI\64\267\0N\14E\321\42\233&%Q\22\351\26O\12E\321f\311|K\26"
"\0P\14E\321bH\62\333\240\204E\0Q\13E\321f\311\274(\221\242\4R\15E\321bH\62\333"
"\240DI\246\5S\13E\321f\311T\65\325\222\5T\11E\321b\220\302>\1U\11E\321\42\363["
"\262\0V\15E\321\42\263%\245$J\262\60\2W\15E\321\42sI\224DI\26\245\2X\16E\321"
"\42KJI\26fI\224\324\2Y\14E\321\42\323\222R\222\205M\0Z\14E\321b\320\302,\314\302"
"l\20[\7Bqb\351E\134\13D\261\42\13\263\60\13\263\0]\7BqB\351e^\5\0\61\3"
"_\6\14\261b\10`\6\33\233\42+a\12\64\261FL\206HJ\6b\13D\261\42\313\226\310iH"
"\0c\12\64\261F\211\264R\242\0d\12D\261\256\62DN\311\0e\11\64\261F\211\206-\34f\12"
"D\261F\211\264%k\3g\13\64\261F\211\244d\33\22\0h\12D\261\42\313\226\310S\0i\10B"
"q\42K:\5j\11Bq&KZ\24\0k\14D\261\42+)\211$%\245\0l\10Bq\42\351"
"S\0m\14\65\321BiQ\22%\321\264\0n\11\64\261\42ILN\1o\11\64\261F\211\234\22\5"
"p\13\64\261b\211\244!\311\62\0q\13\65\321f\211\222(\32C\1r\11\64\261\42\31\242\254\15s"
"\13\64\261F\211\222\60\211\22\5t\11C\221\42\212\206\250Mu\10\64\261\42\362\242\24v\11\64\261\42"
"r\211\244\10w\13\65\321\42\263$J\242t\1x\13\64\261\42\222\22I\211\244\0y\12\64\261\42\62"
"%\333\220\0z\11\64\261b\310\242\266!{\5\0\61\3|\5\0\61\3}\5\0\61\3~\5\0\61"
"\3\177\5\0\61\3\0\0\0\4\377\377\0";
const uint8_t leaf_5x8[970] U8G2_FONT_SECTION("leaf_5x8") =
"`\0\3\2\3\4\2\4\5\6\10\0\0\10\0\10\0\1H\2\221\3\255 \5\0\321\2!\7Aq"
"b\220\2\42\7\33\233\42\261\4#\20E\321\246\224$\203RJ\222A)%\11\0$\14E\321*["
"ZD\245e\213\0%\21F\361&L\42\245\224\204I\224$R\22&\0&\17E\321F\252D\221\224"
"$R\22)J\0'\5\31[b(\7BqF\351))\11Bq\42J\272(\0*\12-\325\252"
"RY\232\42\0+\12-\325*\214\6)\214\0,\7\32qBQ\0-\6\15\331b\20.\6\22q"
"b\10/\13D\261\256\224EY\224e\0\60\12E\321f\311|K\26\0\61\10\303\321&\221z\31\62"
"\12E\321f\311\302\254\343 \63\14E\321b\320\212j\250%\13\0\64\14E\321.\223\222R\62ha"
"\5\65\14E\321\342\30\16i\250%\13\0\66\14E\321f\311\304!\311l\311\2\67\14E\321b\20\263"
"\60\13\263\60\3\70\14E\321f\311\264d\311l\311\2\71\14E\321f\311l\311\20j\311\2:\10\62"
"sb\10\207\0;\10:qb\10\25\5<\10-\323N\221R\3=\10\35\325bP\7\1>\11-"
"\323BU#E\3\77\13E\321f\311\264\306\34\212\0@\16F\361j\312\244DI\226dZ\342\5A"
"\13E\321f\311l\303\220\331\2B\15E\321bH\62mP\62\333\240\0C\12E\321f\311\304n\311"
"\2D\12E\321b\252d\236\222\11E\13D\261b\320\262%\253\15\1F\12D\261b\320\262%k\3"
"G\14E\321f\311\304\322\246%\13\0H\12E\321\42\263\15C\346\26I\10C\221b\211z\31J\12"
"D\261Jk\223\244D\1K\13D\261\42\262$RR\62\5L\10D\261\42\353\333\20M\14E\321\42"
"[\226DI\64\267\0N\14E\321\42\233&%Q\22\351\26O\12E\321f\311|K\26\0P\14E"
"\321bH\62\333\240\204E\0Q\13E\321f\311\274(\221\242\4R\15E\321bH\62\333\240DI\246"
"\5S\13E\321f\311T\65\325\222\5T\11E\321b\220\302>\1U\11E\321\42\363[\262\0V\15"
"E\321\42\263%\245$J\262\60\2W\15E\321\42sI\224DI\26\245\2X\16E\321\42KJI"
"\26fI\224\324\2Y\14E\321\42\323\222R\222\205M\0Z\14E\321b\320\302,\314\302l\20[\7"
"Bqb\351E\134\13D\261\42\13\263\60\13\263\0]\7BqB\351e^\5\0\61\3_\6\14\261"
"b\10`\6\33\233\42+a\12\64\261FL\206HJ\6b\13D\261\42\313\226\310iH\0c\12\64"
"\261F\211\264R\242\0d\12D\261\256\62DN\311\0e\11\64\261F\211\206-\34f\12D\261F\211"
"\264%k\3g\13\64\261F\211\244d\33\22\0h\12D\261\42\313\226\310S\0i\10Bq\42K:"
"\5j\11Bq&KZ\24\0k\14D\261\42+)\211$%\245\0l\10Bq\42\351S\0m\14"
"\65\321BiQ\22%\321\264\0n\11\64\261\42ILN\1o\11\64\261F\211\234\22\5p\13\64\261"
"b\211\244!\311\62\0q\13\65\321f\211\222(\32C\1r\11\64\261\42\31\242\254\15s\13\64\261F"
"\211\222\60\211\22\5t\11C\221\42\212\206\250Mu\10\64\261\42\362\242\24v\11\64\261\42r\211\244\10"
"w\13\65\321\42\263$J\242t\1x\13\64\261\42\222\22I\211\244\0y\12\64\261\42\62%\333\220\0"
"z\11\64\261b\310\242\266!{\5\0\61\3|\5\0\61\3}\5\0\61\3~\5\0\61\3\177\5\0"
"\61\3\0\0\0\4\377\377\0";
Binary file modified FontCreation/leaf_5x8.fon
Binary file not shown.
59 changes: 47 additions & 12 deletions src/vario/PageMenuGPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,54 @@ void GPSMenuPage::draw() {
u8g2.firstPage();
do {
// Title
display_menuTitle("GPS");
display_menuTitle("GPS");

uint8_t linespacing = 10; // for 5x8 font values like lat/lon/hdop

// GPS constellation and lat/long
drawConstellation(3, 22, 75);
uint8_t size = 75;
uint8_t x = 8;
uint8_t y = 22;

drawConstellation(x, y, size);

// GPS icon
display_GPS_icon(82, 14);

u8g2.setFont(leaf_5x8);

// Num of Sats (Upper left Corner)
u8g2.setCursor(0, y + 4);
u8g2.print("Sats:");
u8g2.setCursor(2, u8g2.getCursorY() + linespacing);
u8g2.print(gps.satellites.value());

// HDOP / accuracy (upper right corner)
u8g2.setCursor(70, y + 4);
u8g2.print("HDOP:");
u8g2.setCursor(76, u8g2.getCursorY() + linespacing);
u8g2.print(float(gps.hdop.value()) / 100, 2);

// draw lat long
u8g2.setCursor(0, size + y + linespacing + 2);
u8g2.print("Lat:");
u8g2.setCursor(25, u8g2.getCursorY());
u8g2.print(" ");
if (gps.location.lat() >= 0)
u8g2.print(" ");
u8g2.print(gps.location.lat(), 7);

u8g2.setCursor(0, u8g2.getCursorY() + linespacing);
u8g2.print("Lon:");
u8g2.setCursor(25, u8g2.getCursorY());
if (gps.location.lng() >= 0)
u8g2.print(" ");
u8g2.print(gps.location.lng(), 7);






// Menu Items
u8g2.setFont(leaf_6x12);
Expand Down Expand Up @@ -76,6 +120,7 @@ void GPSMenuPage::setting_change(Button dir, ButtonState state, uint8_t count) {
}
}


void GPSMenuPage::drawConstellation(uint8_t x, uint8_t y, uint16_t size) {
// Draw the satellite background
// u8g2.setDrawColor(0);
Expand Down Expand Up @@ -123,16 +168,6 @@ void GPSMenuPage::drawConstellation(uint8_t x, uint8_t y, uint16_t size) {
u8g2.setDrawColor(1);
}
}

// draw lat long
u8g2.setFont(leaf_5x8);
u8g2.setCursor(0, size + y + 12);
u8g2.print("Lat:");
u8g2.print(gps.location.lat(), 7);

u8g2.setCursor(0, size + y + 22);
u8g2.print("Lon:");
u8g2.print(gps.location.lng(), 7);
}

// helpful switch constructors to copy-paste as needed:
Expand Down
1 change: 1 addition & 0 deletions src/vario/PageMenuGPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class GPSMenuPage : public SettingsMenuPage {
}
void draw();

// draw satellite constellation with latitude and longitude left-justified
void drawConstellation(uint8_t x, uint8_t y, uint16_t size);

protected:
Expand Down
Loading

0 comments on commit ab5fb2d

Please sign in to comment.