satdump/plugins/wip_tracking_app/tracking.cpp

65 lines
1.7 KiB
C++
Raw Permalink Normal View History

2025-05-10 22:20:46 +02:00
#include "tracking.h"
2025-05-20 20:33:41 +02:00
#include "common/tracking/tle.h"
#include "common/utils.h"
#include "imgui/implot3d/implot3d.h"
#include "testgl.h"
2025-05-26 19:42:16 +01:00
#include "utils/time.h"
#include <GLFW/glfw3.h>
2025-05-10 22:20:46 +02:00
namespace satdump
{
2025-05-20 20:33:41 +02:00
WipTrackingHandler::WipTrackingHandler()
{
handler_tree_icon = u8"\uf471";
2026-05-30 11:12:24 +02:00
auto tle = db_keplers->get_from_norad(40069);
2025-05-20 20:33:41 +02:00
satellite_object = predict_parse_tle(tle->line1.c_str(), tle->line2.c_str());
}
2025-05-10 22:20:46 +02:00
WipTrackingHandler::~WipTrackingHandler() {}
void WipTrackingHandler::drawMenu()
{
if (ImGui::CollapsingHeader("Tracking", ImGuiTreeNodeFlags_DefaultOpen))
{
////
}
}
void WipTrackingHandler::drawMenuBar() {}
2025-05-20 20:33:41 +02:00
void WipTrackingHandler::drawContents(ImVec2 win_size)
{
#if 0
2025-05-26 19:42:16 +01:00
double utc_time = satdump::getTime();
2025-05-20 20:33:41 +02:00
predict_orbit(satellite_object, &satellite_orbit, predict_to_julian_double(utc_time));
ImPlot3D::BeginPlot("ObjectsTest");
double x = 0, y = 0, z = 0;
ImPlot3D::PlotScatter("Earth", &x, &y, &z, 1);
x = satellite_orbit.position[0];
y = satellite_orbit.position[1];
z = satellite_orbit.position[2];
ImPlot3D::PlotScatter("METEOR-M 2", &x, &y, &z, 1);
ImPlot3D::EndPlot();
// ImGui::SetNextWindowPos({0, 0});
// ImGui::SetNextWindowSize({wwidth, wheight});
// ImGui::Begin("TestGL");
#endif
GLFWwindow *window = glfwGetCurrentContext();
if (scene == nullptr)
scene = new OpenGLScene();
GLuint text = scene->draw(window, win_size.x, win_size.y);
ImGui::Image((void *)(intptr_t)text, {win_size.x, win_size.y});
// ImGui::End();
2025-05-20 20:33:41 +02:00
}
2025-05-10 22:20:46 +02:00
} // namespace satdump