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"
|
2025-05-25 14:30:24 +02:00
|
|
|
#include "testgl.h"
|
2025-05-26 19:42:16 +01:00
|
|
|
#include "utils/time.h"
|
2025-06-24 17:13:16 +02:00
|
|
|
#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";
|
|
|
|
|
|
2025-09-26 10:25:46 +02:00
|
|
|
auto tle = db_tle->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)
|
|
|
|
|
{
|
2025-06-24 17:13:16 +02:00
|
|
|
#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();
|
2025-05-25 14:30:24 +02:00
|
|
|
|
|
|
|
|
// ImGui::SetNextWindowPos({0, 0});
|
|
|
|
|
// ImGui::SetNextWindowSize({wwidth, wheight});
|
|
|
|
|
// ImGui::Begin("TestGL");
|
2025-06-24 17:13:16 +02:00
|
|
|
#endif
|
2025-05-25 14:30:24 +02:00
|
|
|
|
|
|
|
|
GLFWwindow *window = glfwGetCurrentContext();
|
|
|
|
|
|
|
|
|
|
if (scene == nullptr)
|
|
|
|
|
scene = new OpenGLScene();
|
|
|
|
|
|
2025-06-24 17:13:16 +02:00
|
|
|
GLuint text = scene->draw(window, win_size.x, win_size.y);
|
|
|
|
|
ImGui::Image((void *)(intptr_t)text, {win_size.x, win_size.y});
|
2025-05-25 14:30:24 +02:00
|
|
|
// ImGui::End();
|
2025-05-20 20:33:41 +02:00
|
|
|
}
|
2025-05-10 22:20:46 +02:00
|
|
|
} // namespace satdump
|