-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benedikt Moritz Maurer
committed
Oct 19, 2024
1 parent
c074f01
commit 6c8ef32
Showing
20 changed files
with
0 additions
and
914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,3 @@ | ||
#include <constants/constants.h> | ||
#include <data_processing/config.h> | ||
#include <yaml-cpp/yaml.h> | ||
|
||
#include <boost/program_options.hpp> | ||
#include <iostream> | ||
#include <string> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
namespace po = boost::program_options; | ||
namespace dpc = flash::data_processing::config; | ||
namespace tp = flash::types; | ||
|
||
po::variables_map loadCommandLineArguments(int argc, char* argv[]) { | ||
|
||
po::options_description desc("Allowed options"); | ||
desc.add_options()("help,h", "produce help message")( | ||
"config-file,i", po::value<std::string>()->default_value("config.yaml"), "set path to a config.yaml"); | ||
|
||
po::variables_map vm; | ||
po::store(po::parse_command_line(argc, argv, desc), vm); | ||
|
||
if (vm.count("help")) { | ||
std::cout << desc << std::endl; | ||
std::exception(); | ||
} | ||
|
||
return vm; | ||
} | ||
|
||
dpc::Config setupConfigParameters(po::variables_map commandLineArguments) { | ||
|
||
auto configFile = commandLineArguments["config-file"].as<std::string>(); | ||
std::cout << "Load configuration from " << configFile << std::endl; | ||
try { | ||
auto configNode = YAML::LoadFile(configFile); | ||
auto params = dpc::Config(configNode); | ||
params.validate(); | ||
return params; | ||
|
||
} catch (YAML::BadFile BF) { | ||
std::cerr << "Flash is terminating: " | ||
<< "Could not open " << configFile << std::endl; | ||
} catch (dpc::InvalidKeyException IKE) { | ||
std::cerr << "Flash is terminating: " << IKE.what() << std::endl; | ||
} catch (dpc::MissingKeyException MKE) { | ||
std::cerr << "Flash is terminating: " << MKE.what() << std::endl; | ||
} catch (dpc::InvalidConfigurationException ICE) { | ||
std::cerr << "Flash is terminating: " << ICE.what() << std::endl; | ||
} | ||
} | ||
|
||
int main(int argc, char* argv[]) { | ||
auto commandLineArguments = loadCommandLineArguments(argc, argv); | ||
auto configParameters = setupConfigParameters(commandLineArguments); | ||
|
||
|
||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
201 changes: 0 additions & 201 deletions
201
dev/libs/data_processing/include/data_processing/config.h
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
dev/libs/data_processing/include/data_processing/read_hdf5.h
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.