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

New Satellite Constellation Map #238

Merged
merged 6 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified images/dev/satelliteinfo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions lib/gps/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ void getGPSData()
satTracker[i].snr = (uint8_t)GPS.satellites[i].snr;
satTracker[i].active = GPS.satellites[i].tracked;
strncpy(satTracker[i].talker_id, GPS.satellites[i].talker_id, 3);
int H = canvasRadius * (90 - satTracker[i].elev) / 90;
satTracker[i].posX = canvasCenter_X + H * sin(DEG2RAD(satTracker[i].azim));
satTracker[i].posY = canvasCenter_Y - H * cos(DEG2RAD(satTracker[i].azim));
}
}

Expand Down
13 changes: 13 additions & 0 deletions lib/gps/gps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#include "settings.hpp"
#include "timezone.hpp"

#define DEG2RAD(a) ((a) / (180 / M_PI)) // Convert degrees to radians
#define RAD2DEG(a) ((a) * (180 / M_PI)) // Convert radians to degrees

extern uint8_t GPS_TX;
extern uint8_t GPS_RX;

Expand Down Expand Up @@ -82,4 +85,14 @@ void getGPSData();
long detectRate(int rxPin);
long autoBaudGPS();

/**
* @brief Satellite Constellation Canvas Definition
*
*/
static const uint8_t canvasOffset = 15;
static const uint8_t canvasSize = 180;
static const uint8_t canvasCenter_X = canvasSize / 2;
static const uint8_t canvasCenter_Y = canvasSize / 2;
static const uint8_t canvasRadius = canvasCenter_X - canvasOffset;

#endif
17 changes: 14 additions & 3 deletions lib/gui/src/mainScr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ void scrollTile(lv_event_t *event)
}

deleteMapScrSprites();
deleteSatInfoSprites();
}

/**
Expand Down Expand Up @@ -190,7 +189,6 @@ void updateMainScreen(lv_timer_t *t)
break;

case SATTRACK:
constelSprite.pushSprite(150 * scale, 40 * scale);
lv_obj_send_event(satTrackTile, LV_EVENT_VALUE_CHANGED, NULL);
break;

Expand Down Expand Up @@ -276,7 +274,8 @@ void updateSatTrack(lv_event_t *event)

lv_label_set_text_fmt(altLabel, "ALT: %4dm.", gpsData.altitude);

fillSatInView();
drawSatSNR();
drawSatSky();
}

/**
Expand Down Expand Up @@ -539,6 +538,18 @@ void createMainScr()

// Satellite Tracking and info Tile
satelliteScr(satTrackTile);
#ifdef BOARD_HAS_PSRAM
#ifndef TDECK_ESP32S3
createConstCanvas(satTrackTile);
drawSatConst();
lv_obj_set_pos(constCanvas,( TFT_WIDTH / 2 ) - canvasCenter_X, 240);
#endif
#ifdef TDECK_ESP32S3
createConstCanvas(constMsg);
lv_obj_align(constCanvas,LV_ALIGN_CENTER,0,0);
drawSatConst();
#endif
#endif

// Satellite Tracking Event
lv_obj_add_event_cb(satTrackTile, updateSatTrack, LV_EVENT_VALUE_CHANGED, NULL);
Expand Down
1 change: 0 additions & 1 deletion lib/gui/src/mainScr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "globalGuiDef.h"
#include "lvglFuncs.hpp"
#include "misc/lv_color.h"
#include "satInfo.hpp"
#include "notifyBar.hpp"
#include "buttonBar.hpp"
#include "renderMaps.hpp"
Expand Down
155 changes: 0 additions & 155 deletions lib/gui/src/satInfo.cpp

This file was deleted.

39 changes: 0 additions & 39 deletions lib/gui/src/satInfo.hpp

This file was deleted.

Loading
Loading