Mostly some UI stuff

This commit is contained in:
Aang23 2022-03-10 19:56:37 +01:00
parent e79169476b
commit bb73e355be
44 changed files with 2844 additions and 2880 deletions

View file

@ -1,38 +1,54 @@
#include "logger.h"
#include "core/module.h"
#include "core/pipeline.h"
#include <filesystem>
#include "nlohmann/json.hpp"
#include <fstream>
#include "processing.h"
#include "main_ui.h"
#include "logger.h"
#include "core/pipeline.h"
#include "error.h"
namespace processing
namespace satdump
{
void process(std::string downlink_pipeline,
std::string input_level,
std::string input_file,
std::string output_file,
nlohmann::json parameters)
namespace processing
{
isProcessing = true;
void process(std::string downlink_pipeline,
std::string input_level,
std::string input_file,
std::string output_file,
nlohmann::json parameters)
{
is_processing = true;
logger->info("Starting processing pipeline " + downlink_pipeline + "...");
logger->debug("Input file (" + input_level + ") : " + input_file);
logger->debug("Output file : " + output_file);
logger->info("Starting processing pipeline " + downlink_pipeline + "...");
logger->debug("Input file (" + input_level + ") : " + input_file);
logger->debug("Output file : " + output_file);
if (!std::filesystem::exists(output_file))
std::filesystem::create_directories(output_file);
if (!std::filesystem::exists(output_file))
std::filesystem::create_directories(output_file);
// Get pipeline
std::optional<Pipeline> pipeline = getPipelineFromName(downlink_pipeline);
// Get pipeline
std::optional<Pipeline> pipeline = getPipelineFromName(downlink_pipeline);
if (pipeline.has_value())
pipeline.value().run(input_file, output_file, parameters, input_level, true, uiCallList, uiCallListMutex);
else
logger->critical("Pipeline " + downlink_pipeline + " does not exist!");
if (pipeline.has_value())
{
try
{
pipeline.value().run(input_file, output_file, parameters, input_level);
}
catch (std::exception &e)
{
logger->error("Fatal error running pipeline : " + std::string(e.what()));
error::set_error("Pipeline Error", e.what());
is_processing = false;
return;
}
}
else
logger->critical("Pipeline " + downlink_pipeline + " does not exist!");
logger->info("Done! Goodbye");
isProcessing = false;
logger->info("Done! Goodbye");
is_processing = false;
}
std::shared_ptr<std::vector<std::shared_ptr<ProcessingModule>>> ui_call_list = std::make_shared<std::vector<std::shared_ptr<ProcessingModule>>>();
std::shared_ptr<std::mutex> ui_call_list_mutex = std::make_shared<std::mutex>();
bool is_processing = false;
}
}