mirror of
https://github.com/SatDump/SatDump
synced 2026-08-13 17:47:30 -04:00
The UI code is now common
This commit is contained in:
parent
ed8f31e5f9
commit
a15fd2f7e5
33 changed files with 106 additions and 7794 deletions
45
src-interface/processing.cpp
Normal file
45
src-interface/processing.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#include "logger.h"
|
||||
#include "module.h"
|
||||
#include "pipeline.h"
|
||||
#include <signal.h>
|
||||
#include <filesystem>
|
||||
#include "nlohmann/json.hpp"
|
||||
#include <fstream>
|
||||
#include "processing.h"
|
||||
|
||||
bool processing = false;
|
||||
|
||||
void process(std::string downlink_pipeline,
|
||||
std::string input_level,
|
||||
std::string input_file,
|
||||
std::string output_level,
|
||||
std::string output_file,
|
||||
std::map<std::string, std::string> parameters)
|
||||
{
|
||||
processing = true;
|
||||
|
||||
logger->info("Starting processing pipeline " + downlink_pipeline + "...");
|
||||
logger->debug("Input file (" + input_level + ") : " + input_file);
|
||||
logger->debug("Output file (" + output_level + ") : " + output_file);
|
||||
|
||||
if (!std::filesystem::exists(output_file))
|
||||
std::filesystem::create_directory(output_file);
|
||||
|
||||
std::vector<Pipeline>::iterator it = std::find_if(pipelines.begin(),
|
||||
pipelines.end(),
|
||||
[&downlink_pipeline](const Pipeline &e) {
|
||||
return e.name == downlink_pipeline;
|
||||
});
|
||||
|
||||
if (it != pipelines.end())
|
||||
{
|
||||
it->run(input_file, output_file, parameters, input_level, true, uiCallList, uiCallListMutex);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger->critical("Pipeline " + downlink_pipeline + " does not exist!");
|
||||
}
|
||||
|
||||
logger->info("Done! Goodbye");
|
||||
processing = false;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue