diff --git a/systems_design/src/standardPlot.cpp b/systems_design/src/standardPlot.cpp index 477eb57eb52a9158acd7247986314cd355207063..80ec9e281da0c71ff985bbe48df89005d8f59100 100644 --- a/systems_design/src/standardPlot.cpp +++ b/systems_design/src/standardPlot.cpp @@ -29,7 +29,6 @@ void standardSystemsDesign::generatePlotData() { if (data_->configuration.designCase) { - this->generatePlotMassBreakdown(); this->generatePlotSystemsMass(); } for (size_t n = 0; n < data_->Systems.energySink.size(); n++) { @@ -52,59 +51,6 @@ void standardSystemsDesign::generatePlotData() { this->generatePlotEnergySinksMaxEnergy(); } -void standardSystemsDesign::generatePlotMassBreakdown() { - Plot MassBreakdownPlot(rtIO_, "systems_design_mass_breakdown"); - std::ofstream plot; - std::string plotDataFile(rtIO_->getCsvFilesDir() + "/" + data_->configuration.theProgramName + "_mass_breakdown_plot.csv"); - plot.open(plotDataFile.c_str()); - if (!plot) { - myRuntimeInfo->err << std::string(data_->configuration.theProgramName) + "_mass_breakdown_plot.csv could not be opened!" << std::endl; - exit(1); - } else { - plot << "# " + win2lin(rtIO_->getCsvFilesDir()) + "/" + data_->configuration.theProgramName + "_mass_breakdown_plot.csv" << std::endl; - /* Adjust data structure: **/ - plot << "# Mass Breakdown" << std::endl; - plot << "# (1)Component; (2) Mass [kg];" << std::endl; - plot << "OME; " << data_->data.Mass.OME << std::endl; - plot << "MME; " << data_->data.Mass.MME << std::endl; - plot << "Structure; " << data_->data.Mass.Structure << std::endl; - plot << "Gear; " << data_->data.Mass.Gear << std::endl; - plot << "Propulsion; " << data_->data.Mass.totalGroupAllEngines << std::endl; - plot << "Systems; " << data_->data.Mass.systemsGroup << std::endl; - plot << "not Alloc; " << data_->data.Mass.notAllocatedSystems << std::endl; - } - plot.close(); - - std::vector<std::string> components = {"OME", "MME", "Structure", "Gear", "Propulsion", "Systems", "not Alloc"}; - std::vector<double> masses = { - data_->data.Mass.OME, - data_->data.Mass.MME, - data_->data.Mass.Structure, - data_->data.Mass.Gear, - data_->data.Mass.totalGroupAllEngines, - data_->data.Mass.systemsGroup, - data_->data.Mass.notAllocatedSystems - }; - - // Plot with matplotplusplus - auto fig = matplot::figure(true); - auto ax = fig->current_axes(); - ax->bar(masses); - ax->grid(true); - - ax->title("Mass Breakdown"); - ax->xlabel("Component"); - ax->ylabel("Mass [kg]"); - ax->x_axis().tickangle(45); - ax->x_axis().ticklabels(components); - ax->ylim({0, *max_element(masses.begin(), masses.end())}); - ax->y_axis().tick_label_format("%1.0f"); - - // Save the plot - std::string plotFilePath = rtIO_->getPlotDir() + "/" + data_->configuration.theProgramName + "_mass_breakdown_plot.svg"; - matplot::save(fig, plotFilePath); -} - void standardSystemsDesign::generatePlotSystemsMass() { std::ofstream plot; std::string plotDataFile(rtIO_->getCsvFilesDir() + "/" + data_->configuration.theProgramName + "_systems_mass_plot.csv"); diff --git a/systems_design/src/standardReport.cpp b/systems_design/src/standardReport.cpp index f58db81153ea8054bf6f666fb27e788c613fe963..322f8a13d3b9697d7f2d547346433e82a736a2a2 100644 --- a/systems_design/src/standardReport.cpp +++ b/systems_design/src/standardReport.cpp @@ -25,6 +25,7 @@ #include <vector> void standardSystemsDesign::setHtmlBody() { + std::string plot_path = relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName; /* Add box data */ report_.htmlReportStream() << "<div class=\"box data\">\n"; /* Add headline Data*/ @@ -34,49 +35,6 @@ void standardSystemsDesign::setHtmlBody() { } else { report_.htmlReportStream() << "Analysis Mode" << std::endl; } -/* Mass Breakdown Section */ - /* Add headline */ - report_.htmlReportStream() << "<h2>Mass Breakdown</h2>" << std::endl; - if (data_->configuration.designCase == true) { - report_.htmlReportStream() << "<div id=\"leftCol\">" << std::endl - //Table: - << "<table class=\"content-table\">\n" << std::endl - << "<caption> Aircraft Mass Breakdown </caption>\n" - << "<tr>" << std::endl - << std::setprecision(5) << "<td>OME</td><td>" << data_->data.Mass.OME << " kg</td><td>" - << "(Previous OME: " << data_->PreviousOME << " kg)" << "</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>MME</td><td>" << data_->data.Mass.MME << " kg</td><td>" "(Previous MME: " << data_->PreviousMME << " kg)" << "</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>+</td><td>Structures</td><td>" << data_->data.Mass.Structure << - " kg</td><td>(Fuselage, Wing, Empennage, Landing Gear, Pylons)</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>+</td><td>Power Unit</td><td>" << data_->data.Mass.totalGroupAllEngines << - " kg</td><td>(including Bleed Air System & Fuel System)</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>+</td><td>Systems Group</td><td>" << data_->data.Mass.systemsGroup << " kg</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>+</td><td>Furnishings Group</td><td>" << data_->data.Mass.furnishingsGroup << " kg</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>+</td><td>not Allocated</td><td>" << data_->data.Mass.notAllocatedSystems << " kg</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl - << "</div>" << std::endl - << "<div id=\"rightCol\">" << std::endl - //Graphic: - << "<img class=\"image-plot\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_MassBreakdown_plot.svg\">" << std::endl - << "</div>" << std::endl; - } else { - report_.htmlReportStream() << "<td>The program was run in analysis mode.</td>" << std::endl - << "<td>The masses were not redetermined!</td>" << std::endl; - } report_.htmlReportStream() << "<h2>Systems Masses</h2>" << std::endl; if (data_->configuration.designCase == true) { report_.htmlReportStream() << "<div id=\"leftCol\">" << std::endl @@ -201,8 +159,7 @@ void standardSystemsDesign::setHtmlBody() { << "</div>" << std::endl << "<div id=\"rightCol\">" << std::endl //Graphic: - << "<img class=\"image-plot\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_SystemsMass_plot.svg\">" << std::endl + << "<img class=\"image-plot\" src=\"" + plot_path + "_systems_mass_plot.svg\">" << std::endl << "</div>" << std::endl; } else { report_.htmlReportStream() << "<td>The program was run in analysis mode..</td>" << std::endl @@ -217,17 +174,15 @@ void standardSystemsDesign::setHtmlBody() { // report << "<h1>Mission: " << missionFile << "</h1>" << std::endl << "<h2>Required Power during the Mission</h2>" << std::endl << "<font size=\"-1\">Values at the end of the mission step are given in each case.</font>" << std::endl - << "<img class=\"image-plot\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_MissionSteps_plot.svg\">" << std::endl - << "<img class=\"image-plot\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_accumulatedPower_plot.svg\">" << std::endl + << "<img class=\"image-plot\" src=\"" + plot_path + "_mission_steps_plot.svg\">" << std::endl + << "<img class=\"image-plot\" src=\"" + plot_path + "_accumulated_power_plot.svg\">" << std::endl << "</div>" << std::endl << "<div id=\"rightCol\">" << std::endl /* Off-takes from energy sources */ << "<h2>Power Off-takes</h2>" << std::endl; for (size_t n = 0; n < data_->Systems.energySource.size(); n++) { - report_.htmlReportStream() << "<img class=\"image-plot\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_MissionPower_" + data_->Systems.energySource.at(n)->ATA + "_plot.svg\">" << std::endl; + report_.htmlReportStream() << "<img class=\"image-plot\" src=\"" + plot_path + + "_mission_power_" + data_->Systems.energySource.at(n)->ATA + "_plot.svg\">" << std::endl; } report_.htmlReportStream() << "<font size=\"-1\">APU is sized (only) for ground operations at gate (not visible in this mission).</font>" << std::endl << "</div>\n" @@ -235,20 +190,20 @@ void standardSystemsDesign::setHtmlBody() { /* Mission power of energy conductors */ << "<h2>Energy Conductors</h2>" << std::endl; for (size_t n = 0; n < data_->Systems.energyConductor.size(); n++) { - report_.htmlReportStream() << "<img class=\"ceras2Col\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_MissionPower_" + data_->Systems.energyConductor.at(n)->ATA + "_plot.svg\">" << std::endl; + report_.htmlReportStream() << "<img class=\"ceras2Col\" src=\"" + plot_path + + "_mission_power_" + data_->Systems.energyConductor.at(n)->ATA + "_plot.svg\">" << std::endl; } /* Mission power of energy sinks */ report_.htmlReportStream() << "<h2>Energy Sinks</h2>" << std::endl; for (size_t n = 0; n < data_->Systems.energySink.size(); n++) { - report_.htmlReportStream() << "<img class=\"ceras2Col\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_MissionPower_" + data_->Systems.energySink.at(n)->ATA + "_plot.svg\">" << std::endl; + report_.htmlReportStream() << "<img class=\"ceras2Col\" src=\"" + plot_path + + "_mission_power_" + data_->Systems.energySink.at(n)->ATA + "_plot.svg\">" << std::endl; } /* Design Power Section */ report_.htmlReportStream() << "<h2>Design Power: </h2>" << std::endl //<< "<div class=\"box plot\">\n" - << "<img class=\"ceras2Col\" src=\"" + relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir()) + "/" + data_->configuration.theProgramName + - "_EnergySinksMaxEnergy_plot.svg\">" << std::endl + << "<img class=\"ceras2Col\" src=\"" + plot_path + + "_energy_sinks_max_energy_plot.svg\">" << std::endl << "</div>\n" << "<!-- ################################################################################################### -->" << std::endl; } diff --git a/systems_design/src/standardSystemsDesign.h b/systems_design/src/standardSystemsDesign.h index c40179bfd0b3cb29f30e073ea4cbc8657485ce22..9e66faa75e45ebb9a58e7e1f185674d0daf6e31e 100644 --- a/systems_design/src/standardSystemsDesign.h +++ b/systems_design/src/standardSystemsDesign.h @@ -272,11 +272,6 @@ class standardSystemsDesign : public Strategy { void generatePlotScripts(); - /** \brief Generats bar plot of aircraft masses (OME, MME, op. items, structure, gear, propulsion, systems, - * not allocated) */ - void generatePlotMassBreakdown(); - void generatePlotScriptMassBreakdown(); - /** \brief Generates bar plot of individual system masses */ void generatePlotSystemsMass(); diff --git a/systems_design/systems_design_conf.xml b/systems_design/systems_design_conf.xml index abf7d540426c36c9a1b856cd6757e7f868224db9..b730358c38ee533f371ed8c7ce109846da16d466 100644 --- a/systems_design/systems_design_conf.xml +++ b/systems_design/systems_design_conf.xml @@ -5,7 +5,7 @@ <value>CSMR-2020.xml</value> </aircraft_exchange_file_name> <aircraft_exchange_file_directory description="Specify the direction in which the aircraft exchange file can be found"> - <value>X:\04_UNICADO\04_Testing/</value> + <value>..\projects\</value> </aircraft_exchange_file_directory> <own_tool_level description="Specify the tool level of this tool"> <value>1</value>