2025-01-01 05:57:58 +01:00
|
|
|
#include "dataset_handler.h"
|
2025-04-19 12:01:12 +02:00
|
|
|
#include "logger.h"
|
2025-01-01 05:57:58 +01:00
|
|
|
|
|
|
|
|
#include "../dummy_handler.h"
|
|
|
|
|
#include "dataset_product_handler.h"
|
|
|
|
|
|
2025-04-06 10:27:54 +02:00
|
|
|
#include "../product/image_product_handler.h" // TODOREWORK CLEAN
|
|
|
|
|
#include "../product/punctiform_product_handler.h" // TODOREWORK CLEAN
|
2025-01-03 10:03:04 +01:00
|
|
|
#include "common/utils.h"
|
|
|
|
|
|
2025-01-01 05:57:58 +01:00
|
|
|
namespace satdump
|
|
|
|
|
{
|
|
|
|
|
namespace viewer
|
|
|
|
|
{
|
2025-04-19 11:52:54 +02:00
|
|
|
DatasetHandler::DatasetHandler(std::string path, products::DataSet d) : dataset(d)
|
2025-01-01 05:57:58 +01:00
|
|
|
{
|
2025-01-02 17:04:32 +01:00
|
|
|
instrument_products = std::make_shared<DummyHandler>("Instruments");
|
2025-01-01 05:57:58 +01:00
|
|
|
general_products = std::make_shared<DatasetProductHandler>();
|
2025-01-06 22:03:38 +01:00
|
|
|
((DatasetProductHandler *)general_products.get())->dataset_handler = this;
|
2025-01-02 17:20:09 +01:00
|
|
|
instrument_products->setCanBeDragged(false);
|
|
|
|
|
instrument_products->setCanBeDraggedTo(false);
|
|
|
|
|
instrument_products->setSubHandlersCanBeDragged(false);
|
|
|
|
|
general_products->setCanBeDragged(false);
|
2025-01-01 05:57:58 +01:00
|
|
|
addSubHandler(instrument_products);
|
|
|
|
|
addSubHandler(general_products);
|
2025-01-03 10:03:04 +01:00
|
|
|
|
|
|
|
|
dataset_name = d.satellite_name + " " + timestamp_to_string(d.timestamp);
|
|
|
|
|
|
|
|
|
|
// TODOREWORK Load more than just image products
|
|
|
|
|
for (auto &p : dataset.products_list)
|
|
|
|
|
{
|
2025-01-06 22:03:38 +01:00
|
|
|
auto prod = products::loadProduct(path + "/" + p);
|
2025-04-06 10:27:54 +02:00
|
|
|
std::shared_ptr<ProductHandler> prod_h;
|
|
|
|
|
if (prod->type == "image")
|
2025-04-19 11:52:54 +02:00
|
|
|
prod_h = std::make_shared<ImageProductHandler>(prod, true);
|
2025-04-06 10:27:54 +02:00
|
|
|
else if (prod->type == "punctiform")
|
2025-04-19 11:52:54 +02:00
|
|
|
prod_h = std::make_shared<PunctiformProductHandler>(prod, true);
|
2025-04-06 10:27:54 +02:00
|
|
|
else
|
|
|
|
|
logger->error("TODOREWORK!!!!!! Actually handle loading properly...");
|
2025-01-03 10:03:04 +01:00
|
|
|
instrument_products->addSubHandler(prod_h);
|
2025-01-06 22:03:38 +01:00
|
|
|
all_products.push_back(prod);
|
2025-01-03 10:03:04 +01:00
|
|
|
}
|
2025-02-07 22:57:27 +01:00
|
|
|
|
|
|
|
|
handler_tree_icon = "\uf6b7";
|
|
|
|
|
instrument_products->handler_tree_icon = "\uf970";
|
2025-01-01 05:57:58 +01:00
|
|
|
}
|
|
|
|
|
|
2025-04-19 11:52:54 +02:00
|
|
|
DatasetHandler::~DatasetHandler() {}
|
2025-01-01 05:57:58 +01:00
|
|
|
|
2025-04-19 11:52:54 +02:00
|
|
|
void DatasetHandler::drawMenu() {}
|
2025-01-01 05:57:58 +01:00
|
|
|
|
2025-04-19 11:52:54 +02:00
|
|
|
void DatasetHandler::drawContents(ImVec2 win_size) {}
|
|
|
|
|
} // namespace viewer
|
|
|
|
|
} // namespace satdump
|