diff --git a/plugins/aws_support/aws/instruments/navatt/navatt_reader.cpp b/plugins/aws_support/aws/instruments/navatt/navatt_reader.cpp index d3c668cb7..41a06c42d 100644 --- a/plugins/aws_support/aws/instruments/navatt/navatt_reader.cpp +++ b/plugins/aws_support/aws/instruments/navatt/navatt_reader.cpp @@ -5,6 +5,7 @@ #include "common/tracking/tle.h" #include "common/tracking/tracking.h" #include "common/utils.h" +#include "core/resources.h" #include "init.h" extern "C" @@ -93,7 +94,8 @@ namespace aws { if (ephems_n == 0) { - const char *arrr[] = {"/home/alan/Downloads/de440s.bsp"}; + std::string de440_f = resources::getResourcePath("spice/de440s.bsp"); + const char *arrr[] = {de440_f.c_str()}; t_calcephbin *de440 = calceph_open_array(1, arrr); //// calceph_open("/home/alan/Downloads/de440s.bsp"); if (!de440) fprintf(stderr, "ERROR! could not open ephemeris data\n"); diff --git a/plugins/metopsg_support/metopsg/module_metopsg_instruments.cpp b/plugins/metopsg_support/metopsg/module_metopsg_instruments.cpp index 4887efe86..0db5eb2a0 100644 --- a/plugins/metopsg_support/metopsg/module_metopsg_instruments.cpp +++ b/plugins/metopsg_support/metopsg/module_metopsg_instruments.cpp @@ -54,6 +54,7 @@ namespace metopsg } // Demuxers + ccsds::ccsds_aos::Demuxer demuxer_vcid9(884, false); ccsds::ccsds_aos::Demuxer demuxer_vcid10(884, false); ccsds::ccsds_aos::Demuxer demuxer_vcid13(884, false); ccsds::ccsds_aos::Demuxer demuxer_vcid14(884, false); @@ -81,7 +82,13 @@ namespace metopsg vcdu.spacecraft_id == METOPSG_B1_SCID || vcdu.spacecraft_id == METOPSG_B2_SCID || vcdu.spacecraft_id == METOPSG_B3_SCID) metop_scids.push_back(vcdu.spacecraft_id); - if (vcdu.vcid == 13) // MWS + if (vcdu.vcid == 9) // NAVATT + { + std::vector ccsdsFrames = demuxer_vcid9.work(cadu); + // for (ccsds::CCSDSPacket &pkt : ccsdsFrames) + // logger->critical("APID %d LEN %d", pkt.header.apid, pkt.payload.size() + 6); + } + else if (vcdu.vcid == 13) // MWS { std::vector ccsdsFrames = demuxer_vcid13.work(cadu); for (ccsds::CCSDSPacket &pkt : ccsdsFrames) diff --git a/resources/spice/de440s.bsp b/resources/spice/de440s.bsp new file mode 100644 index 000000000..b7d215c12 Binary files /dev/null and b/resources/spice/de440s.bsp differ diff --git a/src-core/db/iers/iers_handler.cpp b/src-core/db/iers/iers_handler.cpp index 09f957b58..e2a5ae2f7 100644 --- a/src-core/db/iers/iers_handler.cpp +++ b/src-core/db/iers/iers_handler.cpp @@ -26,7 +26,7 @@ namespace satdump // Update now, if needed time_t now = time(NULL); - if ((honor_setting && now > last_update + update_interval) || h->get_table_size("iers") <= 0) + if (/*(honor_setting && now > last_update + update_interval) ||*/ h->get_table_size("iers") <= 0) { updateIERS(); last_update = now; diff --git a/src-core/db/tle/tle_handler.cpp b/src-core/db/tle/tle_handler.cpp index f88becca9..5605981a9 100644 --- a/src-core/db/tle/tle_handler.cpp +++ b/src-core/db/tle/tle_handler.cpp @@ -53,7 +53,7 @@ namespace satdump // Update now, if needed time_t now = time(NULL); - if ((honor_setting && now > last_update + update_interval) || h->get_table_size("tle") <= 0) + if (/*(honor_setting && now > last_update + update_interval) ||*/ h->get_table_size("tle") <= 0) { updateTLEDatabase(); last_update = now; diff --git a/src-interface/settings.cpp b/src-interface/settings.cpp index 35a933fd3..e906b9e18 100644 --- a/src-interface/settings.cpp +++ b/src-interface/settings.cpp @@ -36,7 +36,9 @@ namespace satdump std::vector themes; std::string themes_str = ""; + bool iers_are_update = false; bool tles_are_update = false; + char iers_last_update[80]; char tle_last_update[80]; bool show_imgui_demo = false; @@ -158,6 +160,7 @@ namespace satdump for (std::pair &p : settings_general) p.second.draw(); + // TLEs ImGui::TableNextRow(); ImGui::TableSetColumnIndex(0); ImGui::Text("Update TLEs Now"); @@ -178,7 +181,7 @@ namespace satdump if (disable_update_button) style::endDisabled(); - time_t last_update = getValueOrDefault(satdump_cfg.main_cfg["user"]["tles_last_updated"], 0); + time_t last_update = std::stod(db->get_meta("tles_last_updated", "0")); if (last_update == 0) strcpy(tle_last_update, "Never"); else @@ -190,6 +193,39 @@ namespace satdump ImGui::SameLine(0.0f, 10.0f * ui_scale); ImGui::TextDisabled("Last updated: %s", tle_last_update); + // IERS + ImGui::TableNextRow(); + ImGui::TableSetColumnIndex(0); + ImGui::Text("Update IERS Bulletin Now"); + ImGui::TableSetColumnIndex(1); + disable_update_button = iers_are_update; + if (disable_update_button) + style::beginDisabled(); + if (ImGui::Button("Update###updateIERS")) + { + ui_thread_pool.push( + [](int) + { + iers_are_update = true; + db_iers->updateIERS(); + iers_are_update = false; + }); + } + if (disable_update_button) + style::endDisabled(); + + last_update = std::stod(db->get_meta("iers_last_updated", "0")); + if (last_update == 0) + strcpy(iers_last_update, "Never"); + else + { + struct tm ts; + ts = *gmtime(&last_update); + strftime(iers_last_update, sizeof(iers_last_update), "%Y-%m-%d %H:%M:%S UTC", &ts); + } + ImGui::SameLine(0.0f, 10.0f * ui_scale); + ImGui::TextDisabled("Last updated: %s", iers_last_update); + ImGui::TableNextRow(); ImGui::TableSetColumnIndex(0); ImGui::Text("Clear Tile Map (OSM) Cache");