From 35ef5b06f847d43dc0cbebb62c7f42927b2b1fa6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 8 Apr 2023 14:58:00 +0200 Subject: [PATCH] Allow plots.xml to be read if model.xml doesn't contain plots --- src/initialize.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/initialize.cpp b/src/initialize.cpp index 6383af64e..9c0a05d37 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -358,7 +358,7 @@ bool read_model_xml() for (const auto& input : other_inputs) { if (file_exists(settings::path_input + input)) { warning((fmt::format("Other XML file input(s) are present. These files " - "will be ignored in favor of the {} file.", + "may be ignored in favor of the {} file.", model_filename))); break; } @@ -392,8 +392,16 @@ bool read_model_xml() // Initialize distribcell_filters prepare_distribcell(); - if (check_for_node(root, "plots")) + if (check_for_node(root, "plots")) { read_plots_xml(root.child("plots")); + } else { + // When no element is present in the model.xml file, check for a + // regular plots.xml file + std::string filename = settings::path_input + "plots.xml"; + if (file_exists(filename)) { + read_plots_xml(); + } + } return true; }