diff --git a/empennage_design/src/taw/conventional/low/lowConventionalEmpennageDesignPlot.cpp b/empennage_design/src/taw/conventional/low/lowConventionalEmpennageDesignPlot.cpp index 952e9c0361373af1cb7e32f14cb3d1a23a37f835..6eea5beca4917e49fe1e50040f368c58de7651b2 100644 --- a/empennage_design/src/taw/conventional/low/lowConventionalEmpennageDesignPlot.cpp +++ b/empennage_design/src/taw/conventional/low/lowConventionalEmpennageDesignPlot.cpp @@ -133,11 +133,6 @@ fs::path Conventional::plot_stabilizer_planform( chordwise.push_back(it->origin.x() + it->get_chord_length()); } - // /* Get mac coordinates */ - // auto mac_position_y = geom2::measure::mean_aerodynamic_chord_position(data->wing); - // auto mac_position = geom2::measure::offset_LE(data->wing,mac_position_y); - // auto mac = geom2::measure::chord(data->wing,mac_position_y); - /* Generate plot */ std::string name = surface.name; std::replace(name.begin(), name.end(), '_', ' '); @@ -203,17 +198,16 @@ fs::path Conventional::plot_stabilizer_planform( ax->legend()->box(true); ax->legend()->font_size(8); - fs::path plot_path = rtIO->getPlotDir() + "/" + surface.name + "_planfrom.svg"; + fs::path plot_path = rtIO->getPlotDir() + "/empennage_design_" + surface.name + "_planform.svg"; matplot::save(f, plot_path.string(), "svg"); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - system("pkill gnuplot"); return fs::relative(plot_path, fs::path(rtIO->getHtmlDir())); } fs::path Conventional::plot_thickness_and_twist_distribution( const geom2::MultisectionSurface<geom2::AirfoilSection>& surface) { /* Plot active */ - if (rtIO->plotOn) { + if (!rtIO->plotOn) { return ""; } std::vector<double> eta; @@ -245,10 +239,9 @@ fs::path Conventional::plot_thickness_and_twist_distribution( ax2->grid(true); ax2->ylim({*twist_min - 0.01, *twist_max + 0.01}); - fs::path plot_path = rtIO->getPlotDir() + "/" + surface.name + "_thickness_and_twist_distribution.svg"; + fs::path plot_path = rtIO->getPlotDir() + "/empennage_design_" + surface.name + "_thickness_and_twist_distribution.svg"; matplot::save(f, plot_path.string(), "svg"); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - system("pkill gnuplot"); return fs::relative(plot_path, fs::path(rtIO->getHtmlDir())); } @@ -296,11 +289,10 @@ std::vector<fs::path> Conventional::plot_airfoils(const geom2::MultisectionSurfa ax->xlim({0, 1}); ax->axis(matplot::equal); - fs::path plot_path = rtIO->getPlotDir() + "/" + surface.name + "_" + airfoil_data.first + "_airfoil.svg"; + fs::path plot_path = rtIO->getPlotDir() + "/empennage_design_" + surface.name + "_" + airfoil_data.first + "_airfoil.svg"; matplot::save(f, plot_path.string(), "svg"); airfoil_plots_path.push_back(fs::relative(plot_path, fs::path(rtIO->getHtmlDir()))); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - system("pkill gnuplot"); } } return airfoil_plots_path; diff --git a/wing_design/src/taw/cantilever/cantileverWingDesignPlot.cpp b/wing_design/src/taw/cantilever/cantileverWingDesignPlot.cpp index df7d70778076f10da9b0c4a100dbc11683c6319e..e587467ae7a61efce7b30cdb636535a4bc82755c 100644 --- a/wing_design/src/taw/cantilever/cantileverWingDesignPlot.cpp +++ b/wing_design/src/taw/cantilever/cantileverWingDesignPlot.cpp @@ -177,10 +177,9 @@ fs::path Wing::plot_wing_planform() { ax->legend()->font_size(8); - fs::path plot_path = rtIO->getPlotDir() + "/wing_planfrom.svg"; + fs::path plot_path = rtIO->getPlotDir() + "/wing_design_wing_planform.svg"; matplot::save(f, plot_path.string(), "svg"); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - system("pkill gnuplot"); return fs::relative(plot_path, fs::path(rtIO->getHtmlDir())); } @@ -214,36 +213,10 @@ fs::path Wing::plot_thickness_and_twist_distribution() { ax2->ylabel("\u03F5 [\u00b0]"); ax2->xlabel("\u03B7"); ax2->grid(true); - /* - // Plot the first set of data - ax1->plot(eta, thickness_to_chord_ratio, "g-")->use_y2(false).color("black").line_width(1.5); - ax1->xlabel("\u03B7"); - ax1->ylabel("t/c"); - ax1->limits_mode_automatic(); - ax1->legend({"t/c"}); - matplot::hold(true); - // Create a secondary y-axis - auto ax2 = f->add_axes(ax1, false, false); - ax2->plot(eta, twist, "b-")->use_y2(true).color("green").line_style("--").line_width(1.5); - ax2->y2_axis().limits({-1, 1}); - // ax2->visible(false); - ax2->grid(true); - ax2->y_axis().color("black"); - ax2->y2_axis().label("\u03F5 [\u00b0]"); - ax2->legend({"t/c", "\u03F5"}); - - // Set the secondary y-axis invisible except for the y-axis itself - ax2->x_axis().visible(true); - ax2->y2_axis().color("black"); - // Adjust limits and ticks if necessary - ax2->ylim({0, 0.2}); - ax2->y2lim({-1, 1}); - */ - fs::path plot_path = rtIO->getPlotDir() + "/thickness_and_twist_distribution.svg"; + fs::path plot_path = rtIO->getPlotDir() + "/wing_design_thickness_and_twist_distribution.svg"; matplot::save(f, plot_path.string(), "svg"); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - system("pkill gnuplot"); return fs::relative(plot_path, fs::path(rtIO->getHtmlDir())); } @@ -291,11 +264,11 @@ std::vector<fs::path> Wing::plot_airfoils() { ax->xlim({0, 1}); ax->axis(matplot::equal); - fs::path plot_path = rtIO->getPlotDir() + "/" + airfoil_data.first + "_airfoil.svg"; + fs::path plot_path = rtIO->getPlotDir() + "/wing_design_" + airfoil_data.first + "_airfoil.svg"; matplot::save(f, plot_path.string(), "svg"); airfoil_plots_path.push_back(fs::relative(plot_path, fs::path(rtIO->getHtmlDir()))); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - system("pkill gnuplot"); + } } return airfoil_plots_path;