#pragma once #include "dll_export.h" #include "nlohmann/json.hpp" #include #include #include namespace satdump { // Simple struct to hold TLE definitions struct TLE { int norad = -1; std::string name; std::string line1; std::string line2; uint64_t time; }; inline void to_json(nlohmann::json &j, const TLE &v) { j["norad"] = v.norad; j["name"] = v.name; j["line1"] = v.line1; j["line2"] = v.line2; } inline void from_json(const nlohmann::json &j, TLE &v) { v.norad = j["norad"].get(); v.name = j["name"].get(); v.line1 = j["line1"].get(); v.line2 = j["line2"].get(); } struct TLEsUpdatedEvent { }; int parseTLEStream(std::istream &inputStream, std::vector &new_registry); // Helper - Takes an input stream and parses out the valid TLEs std::vector tryFetchTLEsFromFileURL(std::string url_str); std::vector tryFetchSingleTLEwithNorad(int norad); std::optional get_from_spacetrack_time(int norad, time_t timestamp); std::vector get_from_spacetrack_latest_list(std::vector norad); std::optional get_from_norad_in_vec(std::vector vec, int norad); } // namespace satdump