Add setting parameter for surface source file reading

This commit is contained in:
YoungHui Park 2020-08-05 11:39:22 -05:00
parent 10e3e83f90
commit b5f6dacb7d
3 changed files with 22 additions and 0 deletions

View file

@ -72,6 +72,26 @@ IndependentSource::IndependentSource(pugi::xml_node node)
// Check for external source file
if (check_for_node(node, "file")) {
// Copy path of source file
settings::path_source = get_node_value(node, "file", false, true);
// Check if source file exists
if (!file_exists(settings::path_source)) {
fatal_error(fmt::format("Source file '{}' does not exist.",
settings::path_source));
}
// Check if it is a surface source file.
if (check_for_node(node, "surf_src_file")) {
settings::surf_src_read = get_node_value_bool(node, "surf_src_file");
}
} else if (check_for_node(node, "library")) {
settings::path_source_library = get_node_value(node, "library", false, true);
if (!file_exists(settings::path_source_library)) {
fatal_error(fmt::format("Source library '{}' does not exist.",
settings::path_source_library));
}
} else {