2025-01-01 05:57:58 +01:00
|
|
|
#include "dataset_handler.h"
|
|
|
|
|
|
|
|
|
|
#include "../dummy_handler.h"
|
|
|
|
|
#include "dataset_product_handler.h"
|
|
|
|
|
|
2025-01-03 10:03:04 +01:00
|
|
|
#include "../product/image_product_handler.h" // TODOREWORK CLEAN
|
|
|
|
|
#include "common/utils.h"
|
|
|
|
|
|
2025-01-01 05:57:58 +01:00
|
|
|
namespace satdump
|
|
|
|
|
{
|
|
|
|
|
namespace viewer
|
|
|
|
|
{
|
2025-01-03 10:03:04 +01: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);
|
|
|
|
|
std::shared_ptr<ProductHandler> prod_h = std::make_shared<ImageProductHandler>(prod);
|
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-01-01 05:57:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DatasetHandler::~DatasetHandler()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DatasetHandler::drawMenu()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DatasetHandler::drawContents(ImVec2 win_size)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-06 22:03:38 +01:00
|
|
|
}
|