diff --git a/design_evaluator/CMakeLists.txt b/design_evaluator/CMakeLists.txt index 1f4ec2bfa0a7aee10b176606531ea06b22306991..600d2648464a7ade7bd1d031322936ccecbd8ad1 100644 --- a/design_evaluator/CMakeLists.txt +++ b/design_evaluator/CMakeLists.txt @@ -38,10 +38,14 @@ set(MODULE_NAME design_evaluator) +find_package(Boost REQUIRED COMPONENTS system filesystem) + add_executable(${MODULE_NAME} src/main.cpp ) +target_link_libraries(${MODULE_NAME} Boost::system Boost::filesystem) + # Set the location where the executable will be placed to the current source directory set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/design_evaluator/design_evaluator_conf_propulsion_design.xml b/design_evaluator/design_evaluator_conf_propulsion_design.xml index 5842bd4e05284269c93a34983f948de83fe17b8d..1146e9b1b5735340841f3366acd57b0485e7a754 100644 --- a/design_evaluator/design_evaluator_conf_propulsion_design.xml +++ b/design_evaluator/design_evaluator_conf_propulsion_design.xml @@ -12,24 +12,27 @@ </aircraft_design> </program_settings> <parameters Desc="parameters to be compared"> - <sub_path ID="0" Name="Position_x">component_design/propulsion/position/x/value</sub_path> - <sub_path ID="1" Name="Position_y">component_design/propulsion/position/y/value</sub_path> - <sub_path ID="2" Name="Position_z">component_design/propulsion/position/z/value</sub_path> - <sub_path ID="3" Name="Engine_mass">component_design/propulsion/mass_properties/mass/value</sub_path> - <sub_path ID="4" Name="Engine_inertia_xx">component_design/propulsion/inertia/j_xx/value</sub_path> - <sub_path ID="5" Name="Engine_inertia_yy">component_design/propulsion/inertia/j_yy/value</sub_path> - <sub_path ID="6" Name="Engine_inertia_zz">component_design/propulsion/inertia/j_zz/value</sub_path> - <sub_path ID="7" Name="Engine_inertia_xy">component_design/propulsion/inertia/j_xy/value</sub_path> - <sub_path ID="8" Name="Engine_inertia_xz">component_design/propulsion/inertia/j_xz/value</sub_path> - <sub_path ID="9" Name="Engine_inertia_yz">component_design/propulsion/inertia/j_yz/value</sub_path> - <sub_path ID="10" Name="CoG_x">/component_design/propulsion/mass_properties/center_of_gravity/x/value</sub_path> - <sub_path ID="11" Name="CoG_y">/component_design/propulsion/mass_properties/center_of_gravity/y/value</sub_path> - <sub_path ID="12" Name="CoG_z">/component_design/propulsion/mass_properties/center_of_gravity/z/value</sub_path> - <sub_path ID="13" Name="Nacelle_0_position_x">component_design/propulsion/specific/propulsion/nacelle/position/x/value</sub_path> - <sub_path ID="14" Name="Nacelle_0_position_y">component_design/propulsion/specific/propulsion/nacelle/position/y/value</sub_path> - <sub_path ID="15" Name="Nacelle_0_position_z">component_design/propulsion/specific/propulsion/nacelle/position/z/value</sub_path> - <sub_path ID="16" Name="Pylon_0_position_x">component_design/propulsion/specific/propulsion/pylon/position/x/value</sub_path> - <sub_path ID="17" Name="Pylon_0_position_y">component_design/propulsion/specific/propulsion/pylon/position/y/value</sub_path> - <sub_path ID="18" Name="Pylon_0_position_z">component_design/propulsion/specific/propulsion/pylon/position/z/value</sub_path> - </parameters> + <sub_path ID="0" Name="Position_x">aircraft_exchange_file/component_design/propulsion/position/x/value</sub_path> + <sub_path ID="1" Name="Position_y">aircraft_exchange_file/component_design/propulsion/position/y/value</sub_path> + <sub_path ID="2" Name="Position_z">aircraft_exchange_file/component_design/propulsion/position/z/value</sub_path> + <sub_path ID="3" Name="Propulsion_mass">aircraft_exchange_file/component_design/propulsion/mass_properties/mass/value</sub_path> + <sub_path ID="4" Name="Propulsion_inertia_xx">aircraft_exchange_file/component_design/propulsion/mass_properties/inertia/j_xx/value</sub_path> + <sub_path ID="5" Name="Propulsion_inertia_yy">aircraft_exchange_file/component_design/propulsion/mass_properties/inertia/j_yy/value</sub_path> + <sub_path ID="6" Name="Propulsion_inertia_zz">aircraft_exchange_file/component_design/propulsion/mass_properties/inertia/j_zz/value</sub_path> + <sub_path ID="7" Name="Propulsion_inertia_xy">aircraft_exchange_file/component_design/propulsion/mass_properties/inertia/j_xy/value</sub_path> + <sub_path ID="8" Name="Propulsion_inertia_xz">aircraft_exchange_file/component_design/propulsion/mass_properties/inertia/j_xz/value</sub_path> + <sub_path ID="9" Name="Propulsion_inertia_yz">aircraft_exchange_file/component_design/propulsion/mass_properties/inertia/j_yz/value</sub_path> + <sub_path ID="10" Name="CoG_x">aircraft_exchange_file/component_design/propulsion/mass_properties/center_of_gravity/x/value</sub_path> + <sub_path ID="11" Name="CoG_y">aircraft_exchange_file/component_design/propulsion/mass_properties/center_of_gravity/y/value</sub_path> + <sub_path ID="12" Name="CoG_z">aircraft_exchange_file/component_design/propulsion/mass_properties/center_of_gravity/z/value</sub_path> + <sub_path ID="13" Name="Nacelle_0_position_x">aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/position/x/value</sub_path> + <sub_path ID="14" Name="Nacelle_0_position_y">aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/position/y/value</sub_path> + <sub_path ID="15" Name="Nacelle_0_position_z">aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/position/z/value</sub_path> + <sub_path ID="16" Name="Pylon_0_position_x">aircraft_exchange_file/component_design/propulsion/specific/propulsion/pylon/position/x/value</sub_path> + <sub_path ID="17" Name="Pylon_0_position_y">aircraft_exchange_file/component_design/propulsion/specific/propulsion/pylon/position/y/value</sub_path> + <sub_path ID="18" Name="Pylon_0_position_z">aircraft_exchange_file/component_design/propulsion/specific/propulsion/pylon/position/z/value</sub_path> + <sub_path ID="19" Name="Pylon_0_normal_x">aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/normal/x/value</sub_path> + <sub_path ID="20" Name="Pylon_0_normal_y">aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/normal/y/value</sub_path> + <sub_path ID="21" Name="Pylon_0_normal_z">aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/normal/z/value</sub_path> + </parameters> </config_file> \ No newline at end of file diff --git a/design_evaluator/src/main.cpp b/design_evaluator/src/main.cpp index 5e7866609cca4f1d7832433531e2f3627f22a318..18589d7cf4f621d1ac80f63802cc70b524e935b1 100644 --- a/design_evaluator/src/main.cpp +++ b/design_evaluator/src/main.cpp @@ -252,7 +252,7 @@ int main () { double local_value{NAN}; std::string unit{"?"}; - std::string node_path = node.second.get<std::string>("<xmlattr>.path"); + std::string node_path = node.second.get_value<std::string>(); if (containsSymbol(node_path, "@")) { std::string pre{node_path.substr(0, node_path.find_first_of('@'))}; std::string temp_string{node_path.substr(node_path.find_first_of('@'))}; @@ -273,7 +273,7 @@ int main () { local_value = tree.get<double>(boost::property_tree::ptree::path_type(node_path, '/')); unit = tree.get<std::string>(boost::property_tree::ptree::path_type(substractStringFromEnd(node_path, "value") + "unit", '/')); } - temp_tree.put(node.second.get<std::string>("<xmlattr>.Name"), upstream_value - local_value); + temp_tree.put(node.second.get<std::string>("<xmlattr>.Name"), local_value - upstream_value); temp_tree.put(node.second.get<std::string>("<xmlattr>.Name") + ".<xmlattr>.unit", unit); } result_tree.push_back(temp_tree); @@ -309,7 +309,7 @@ int main () { // Create body boost::property_tree::ptree temp_tree{}; temp_tree.put("<xmlattr>.class", "content"); - temp_tree.put("h1", "Report - <some name>"); + temp_tree.put("h1", "Design evaluation report"); temp_tree.put("div.<xmlattr>.class", "container"); // Create data tables unsigned int aircraft_counter{0}; @@ -343,7 +343,7 @@ int main () { // Write .html file boost::property_tree::xml_writer_settings<std::string> settings(' ', 4); // 4 spaces for indentation - boost::property_tree::write_xml("./projects/reporting/reportHTML/ReportXYZ.html", + boost::property_tree::write_xml("ReportXYZ.html", output_tree, std::locale(), settings);