Skip to content
Snippets Groups Projects
Commit 32850c7c authored by gPauls-TUHH's avatar gPauls-TUHH
Browse files

Merge branch 'fix/mission_XML_overwrite' into 'develop'

only 1 mission per run

See merge request !52
parents 85ac8006 7bdb4dd6
No related branches found
No related tags found
5 merge requests!263Apply 1 suggestion(s) to 1 file(s),!261Reintruduced automatic flight condition selection,!245Apply 1 suggestion(s) to 1 file(s),!233Initial open source version,!52only 1 mission per run
......@@ -47,9 +47,9 @@
</gnuplot_path>
</control_settings>
<program_settings description="Program Settings">
<mission_choice description="Pick a mission (by now only 1 implemented). Selector: standard">
<value>standard</value>
</mission_choice>
<mission_selector description="Pick a mission. Selector: design_mission / study_mission / requirements_mission">
<value>design_mission</value>
</mission_selector>
<maximum_operating_mach_number description="Specify the maximum operating Mach number by its delta to the initial cruise Mach number">
<enable description="Switch to enable the specification via initial cruise Mach number + delta. Switch: true (On) / false (Off-> read from aircraft exchange file)">
<value>false</value>
......@@ -81,13 +81,7 @@
<lower_boundary>-1</lower_boundary>
<upper_boundary>5000</upper_boundary>
</maximum_rate_of_climb>
<write_requirement_mission description="Switch if a mission file for requirement check mission shall be created. Switch: true (On) / false (Off)">
<value>true</value>
</write_requirement_mission>
<design_mission>
<write_mission_file description="Switch if a mission file for the design mission shall be created. Switch: true (On) / false (Off)">
<value>true</value>
</write_mission_file>
<output_file_name description="Specify the name of the created mission file">
<value>mission_design.xml</value>
</output_file_name>
......@@ -164,9 +158,6 @@
</destination_airport>
</design_mission>
<study_mission>
<write_mission_file description="Switch if a mission file for the study mission shall be created. Switch: true (On) / false (Off)">
<value>true</value>
</write_mission_file>
<copy_mach_number description="Switch if the Mach number is copied from the design mission's requirements block. Switch: true (On) / false (Off; only for parameter studies with Mach number variation)">
<value>false</value>
</copy_mach_number>
......
......@@ -13,9 +13,10 @@
#include <string>
#include <vector>
#include "create_mission_xml.h"
#include <moduleBasics/module.h>
#include <moduleBasics/strategySelector.h>
#include "create_mission_xml.h"
#include "standard_mission/standard_mission/standard_mission.h"
/**
......@@ -27,7 +28,7 @@
create_mission_xml::create_mission_xml(const int argc, char *argv[], const std::string &toolName,
const std::string &toolVersion)
: Module(argc, argv, toolName, toolVersion) {
std::string mission_choice = "standard";//std::string(rtIO_->acxml.at("program_settings/mission_choice/value"));
std::string mission_choice = EndnodeReadOnly<std::string>("program_settings/mission_selector").read(rtIO_->moduleConfig).value();
route_ = {mission_choice}; // By now, only one level depth vector
missionStrategy_.setStrategy(missionSelection_(route_)(rtIO_));
}
......@@ -35,9 +36,9 @@ create_mission_xml::create_mission_xml(const int argc, char *argv[], const std::
strategyaccess create_mission_xml::missionSelection_(const std::vector<std::string> &route) {
/* Routing table */
std::map<std::string, strategyaccess> table = {
{"standard", [](const std::shared_ptr<RuntimeIO>& arg) { return std::make_unique<standard_mission>(arg); }},
{"placeholder_1", [](const std::shared_ptr<RuntimeIO>& arg) { return std::make_unique<standard_mission>(arg); }},
{"placeholder_2", [](const std::shared_ptr<RuntimeIO>& arg) { return std::make_unique<standard_mission>(arg); }}
{"design_mission", [](const std::shared_ptr<RuntimeIO>& arg) { return std::make_unique<design_mission::standard_mission>(arg); }},
{"study_mission", [](const std::shared_ptr<RuntimeIO>& arg) { return std::make_unique<study_mission::standard_mission>(arg); }},
{"requirements_mission", [](const std::shared_ptr<RuntimeIO>& arg) { return std::make_unique<requirements_mission::standard_mission>(arg); }}
};
return table[route.at(0)];
}
......@@ -18,9 +18,49 @@
*/
standard_mission::standard_mission(const std::shared_ptr<RuntimeIO>& rtIO) :
rtIO(rtIO),
design_mission(nullptr),
study_mission(nullptr),
requirements_mission(nullptr),
mission_type(),
mission_xml_name(),
auto_select_initial_cruise_altitude(),
auto_select_flight_level(),
round_to_regular_flight_level(),
no_steps(),
/* Mission values */
range("range", "Mission range", 0, "m", 0, 100000000),
payload("payload", "Payload mass", 0, "kg", 0, 100000),
pax_number("number_of_pax", "Number of passenger (Mass per PAX = " + num2Str(
EndnodeReadOnly<double>("requirements_and_specifications/design_specification/transport_task/passenger_definition/mass_per_passenger").read(rtIO->acxml).value() +
EndnodeReadOnly<double>("requirements_and_specifications/design_specification/transport_task/passenger_definition/luggage_mass_per_passenger").read(rtIO->acxml).value()) +
" kg)", 0, "1", 0, 1000),
cargo_mass("cargo_mass", "Cargo mass", 0, "kg", 0, 100000),
initial_cruise_mach("desired_cruise_speed", "Planned cruise Mach number for fuel calculation", 0, "1", 0, 1),
alternate_distance("alternate_distance", "Distance from destination to alternate aerodrome", 0, "m", 0, 10000000),
taxi_time_origin("taxi_time_origin", "Taxi time at departure airport", 0, "s", 0, 10000),
taxi_time_destination("taxi_time_destination", "Taxi time at destination", 0, "s", 0, 10000),
taxiing_procedure("taxiing_procedure", "Taxiing procedure for start and landing."),
engine_warmup_time("engine_warmup_time", "Running time of the engines before take-off", 0, "s", 0, 10000),
terminal_operation_time("terminal_operation_time", "Time at the terminal for stopovers", 0, "s", 0, 10000),
origin_airport("origin_airport", "ICAO code of origin"),
destination_airport("destination_airport", "ICAO code of destination"),
auto_climb_altitude_steps(),
auto_rate_of_climb_steps(),
cruise_step_number(),
CAS_ATC_limit_climb(),
CAS_ATC_limit_descent(),
CAS_over_flight_level_100_climb(),
CAS_over_flight_level_100_descent(),
mach_climb(),
initial_cruise_altitude(),
delta_temperature_ISA(),
delta_mach_climb_to_mach_cruise(),
maximum_rate_of_climb(),
approach_speed(),
cruise_step_segments(),
departure_steps(),
cruise_steps(),
approach_steps(),
takeoff_procedure(),
approach_procedure(),
climb_thrust_setting(),
use_delta_max_operating_mach(EndnodeReadOnly<bool>("program_settings/maximum_operating_mach_number/delta").read(rtIO->moduleConfig).value()),
adapt_climb_speed(EndnodeReadOnly<bool>("program_settings/adapt_climb_speed_schedule/enable").read(rtIO->moduleConfig).value()),
use_design_mission_mach(EndnodeReadOnly<bool>("program_settings/study_mission/copy_mach_number").read(rtIO->moduleConfig).value()),
......@@ -31,81 +71,13 @@ standard_mission::standard_mission(const std::shared_ptr<RuntimeIO>& rtIO) :
void standard_mission::initialize() {
myRuntimeInfo->info << "Initialize Mission Parameters ..." << std::endl;
std::string subpath("requirements_and_specifications/design_specification/transport_task/passenger_definition/");
double single_PAX_mass = EndnodeReadOnly<double>(subpath + "mass_per_passenger").read(rtIO->acxml).value();
single_PAX_mass += EndnodeReadOnly<double>(subpath + "luggage_mass_per_passenger").read(rtIO->acxml).value();
design_mission = new mission_parameters("design_mission", single_PAX_mass);
this->initialize_mission(design_mission);
this->write_shell_output(design_mission);
study_mission = new mission_parameters("study_mission", single_PAX_mass);
this->initialize_mission(study_mission);
this->write_shell_output(study_mission);
/* Copy design mission for requirements mission and alter paths, name and cruise segment */
requirements_mission = new mission_parameters("design_mission", single_PAX_mass);
this->initialize_mission(requirements_mission);
requirements_mission->mission_type = "requirements_mission";
requirements_mission->mission_xml_name =
EndnodeReadOnly<std::string>("requirements_and_specifications/mission_files/requirements_mission_file").read(rtIO->acxml).value();
requirements_mission->write_mission_file =
EndnodeReadOnly<bool>("program_settings/write_requirement_mission").read(rtIO->moduleConfig).value();
requirements_mission->cruise_step_segments.clear(); // Clear cruise steps for requirement mission
requirements_mission->cruise_step_segments.push_back(design_mission->cruise_step_segments.front());
requirements_mission->cruise_step_segments.front().relative_segment_length = 1.; // Set the relative segment length for requirement mission
requirements_mission->cruise_step_segments.front().altitude = // Set flight level for requirement mission
convertUnit(HECTO, FOOT, NOPREFIX, METER, requirements_mission->initial_cruise_altitude);
}
void standard_mission::run() {
if (design_mission->write_mission_file == true) {
set_mission_profiles(design_mission);
}
if (study_mission->write_mission_file == true) {
set_mission_profiles(study_mission);
}
if (requirements_mission->write_mission_file == true) {
set_mission_profiles(requirements_mission);
}
}
void standard_mission::update() {
this->setup_mission_file(design_mission);
this->fill_mission_file(design_mission);
this->setup_mission_file(study_mission);
this->fill_mission_file(study_mission);
this->setup_mission_file(requirements_mission);
this->fill_mission_file(requirements_mission);
// std::string subPath("AcftExchangeFile/Performance/RequirementsChecks/TLARs/"); // TODO(Gerrit): Check if still needed!
// /* Mission type: requirement mission */
// if (myRequirementMissionSettingsPt->getWriteMissionFile() &&
// (!this->myMissionXMLPt->acXML.at(subPath + "h_initialCruise_Design").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "h_maxOperating").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "h_maxOEI").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "M_initialCruise_Design").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "TTC_Design").getIntAttrib("Checked"))) {
// this->myMissionXMLPt->acXML.at("AcftExchangeFile/Performance/RequirementsChecks/MissionFile").setAttrib("OfftakesWritten", 0);
// this->generateMissionXMLFile(myRequirementMissionProfilePt, myRequirementMissionSettingsPt, myRequirementMissionPt);
// }
}
void standard_mission::report() {
}
void standard_mission::save() {
}
void standard_mission::initialize_mission(standard_mission::mission_parameters* mission) {
this->set_module_settings(mission);
this->set_range_and_payload(mission);
this->set_cruise(mission);
this->set_climb_and_descent(mission);
this->set_start_and_landing(mission);
this->set_performance_limits(mission);
// TODO(GERRIT): Soll das nochmal rein?
this->set_module_settings();
this->set_range_and_payload();
this->set_cruise();
this->set_climb_and_descent();
this->set_start_and_landing();
this->set_performance_limits();
// TODO(GERRIT): Still needed?
/* Adjust maximum operating Mach number by delta to Mach_Cruise if necessary (for parameter studies with Mach variation) */
// if (mySettingsPt->getUseDeltaMaxOperatingMachNumber()) {
// double maxOperatingMachNumber(designMission->getMachInitialCruise() + mySettingsPt->getDeltaMaxOperatingMachNumber());
......@@ -113,43 +85,41 @@ void standard_mission::initialize_mission(standard_mission::mission_parameters*
// }
}
/* Write the shell output */
void standard_mission::write_shell_output(standard_mission::mission_parameters* mission) {
void standard_mission::run() {
/* Shell output */
myRuntimeInfo->out << "***************** Gathered input *****************" << std::endl;
myRuntimeInfo->out << "* Mission type: " + mission->mission_type << std::endl;
myRuntimeInfo->out << "* Mission type: " + this->mission_type << std::endl;
/* Range */
myRuntimeInfo->out << "* Range = " << convertUnit(METER, NAUTICALMILE, mission->range.value()) << " NM" << std::endl;
myRuntimeInfo->out << "* Range = " << convertUnit(METER, NAUTICALMILE, this->range.value()) << " NM" << std::endl;
/* Payload */
myRuntimeInfo->out << "* Payload = " << mission->payload.value() << " kg" << std::endl;
myRuntimeInfo->out << "* Payload = " << this->payload.value() << " kg" << std::endl;
/* Initial cruise parameters */
myRuntimeInfo->out << "* Cruise Mach number = " << mission->initial_cruise_mach.value() << std::endl; // Mach number
myRuntimeInfo->out << "* Initial cruise altitude = " << mission->initial_cruise_altitude << " FL" << std::endl; // Altitude
myRuntimeInfo->out << "* Cruise Mach number = " << this->initial_cruise_mach.value() << std::endl; // Mach number
myRuntimeInfo->out << "* Initial cruise altitude = " << this->initial_cruise_altitude << " FL" << std::endl; // Altitude
/* Speed schedule */
myRuntimeInfo->out << "* Climb speed under FL100 = " << mission->CAS_ATC_limit_climb << " m/s" << std::endl;
myRuntimeInfo->out << "* Climb speed above FL100 = " << mission->CAS_over_flight_level_100_climb << " m/s" << std::endl;
myRuntimeInfo->out << "* Climb Mach number = " << mission->mach_climb << std::endl;
myRuntimeInfo->out << "* Climb speed under FL100 = " << this->CAS_ATC_limit_climb << " m/s" << std::endl;
myRuntimeInfo->out << "* Climb speed above FL100 = " << this->CAS_over_flight_level_100_climb << " m/s" << std::endl;
myRuntimeInfo->out << "* Climb Mach number = " << this->mach_climb << std::endl;
myRuntimeInfo->out << "**************************************************" << std::endl;
myRuntimeInfo->out << std::endl;
}
void standard_mission::set_mission_profiles(standard_mission::mission_parameters* mission) {
this->set_departure_profile(mission);
this->set_cruise_profile(mission);
this->set_approach_profile(mission);
/* Set mission profiles */
this->set_departure_profile();
this->set_cruise_profile();
this->set_approach_profile();
}
void standard_mission::setup_mission_file(standard_mission::mission_parameters* mission) {
myRuntimeInfo->out << "Create " << mission->mission_xml_name << "..." << std::endl;
void standard_mission::update() {
myRuntimeInfo->out << "Create " << this->mission_xml_name << "..." << std::endl;
/* Open file */
std::ofstream outstream;
outstream.open(rtIO->getMissionDataDir() + "/" + mission->mission_xml_name.c_str());
outstream.open(rtIO->getMissionDataDir() + "/" + this->mission_xml_name.c_str());
/* Check if the file can be opened */
if (!outstream) { // File can not be opened -> create directory
rtIO->createMissionDataDir();
outstream.open(rtIO->getMissionDataDir() + "/" + mission->mission_xml_name.c_str());
outstream.open(rtIO->getMissionDataDir() + "/" + this->mission_xml_name.c_str());
}
if (!outstream) { // File can still not be opened, error message
myRuntimeInfo->err << "Could not open " << rtIO->getMissionDataDir() + "/" + mission->mission_xml_name << ". Abort progrm." << std::endl;
myRuntimeInfo->err << "Could not open " << rtIO->getMissionDataDir() + "/" + this->mission_xml_name << ". Abort progrm." << std::endl;
exit(1);
} else { // File can be opened, the generate mission XML output is created
/* Version and encoding */
......@@ -158,24 +128,22 @@ void standard_mission::setup_mission_file(standard_mission::mission_parameters*
outstream << "</mission>" << std::endl;
outstream.close();
}
}
void standard_mission::fill_mission_file(standard_mission::mission_parameters* mission) {
node& file(aixml::openDocument(rtIO->getMissionDataDir() + "/" + mission->mission_xml_name));
mission->range.update(file.at("mission"));
mission->payload.update(file.at("mission"));
mission->pax_number.update(file.at("mission"));
mission->cargo_mass.update(file.at("mission"));
mission->initial_cruise_mach.update(file.at("mission"));
mission->alternate_distance.update(file.at("mission"));
mission->taxi_time_origin.update(file.at("mission"));
mission->taxi_time_destination.update(file.at("mission"));
mission->engine_warmup_time.update(file.at("mission"));
mission->terminal_operation_time.update(file.at("mission"));
mission->taxiing_procedure.update(file.at("mission"));
if (!mission->origin_airport.value().empty() && !mission->origin_airport.value().empty()) {
mission->origin_airport.update(file.at("mission"));
mission->destination_airport.update(file.at("mission"));
node& file(aixml::openDocument(rtIO->getMissionDataDir() + "/" + this->mission_xml_name));
this->range.update(file.at("mission"));
this->payload.update(file.at("mission"));
this->pax_number.update(file.at("mission"));
this->cargo_mass.update(file.at("mission"));
this->initial_cruise_mach.update(file.at("mission"));
this->alternate_distance.update(file.at("mission"));
this->taxi_time_origin.update(file.at("mission"));
this->taxi_time_destination.update(file.at("mission"));
this->engine_warmup_time.update(file.at("mission"));
this->terminal_operation_time.update(file.at("mission"));
this->taxiing_procedure.update(file.at("mission"));
if (!this->origin_airport.value().empty() && !this->origin_airport.value().empty()) {
this->origin_airport.update(file.at("mission"));
this->destination_airport.update(file.at("mission"));
}
/* Setup departure blocks */
......@@ -189,10 +157,10 @@ void standard_mission::fill_mission_file(standard_mission::mission_parameters* m
file.at(subpath).addAttrib("description", description);
subpath += "/departure_step@";
for (uint16_t i(0); i < mission->departure_steps.size(); i++) {
for (uint16_t i(0); i < this->departure_steps.size(); i++) {
file[(subpath + num2Str(i))];
file.at(subpath + num2Str(i)).addAttrib("description", "Single departure step");
mission->departure_steps.at(i).write_departure_steps(subpath + num2Str(i), &file);
this->departure_steps.at(i).write_departure_steps(subpath + num2Str(i), &file);
}
/* Setup cruise blocks */
......@@ -208,10 +176,10 @@ void standard_mission::fill_mission_file(standard_mission::mission_parameters* m
file.at(subpath).addAttrib("description", description);
subpath += "/cruise_step@";
for (uint16_t i(0); i < mission->cruise_steps.size(); i++) {
for (uint16_t i(0); i < this->cruise_steps.size(); i++) {
file[(subpath + num2Str(i))];
file.at(subpath + num2Str(i)).addAttrib("description", "Single cruise step");
mission->cruise_steps.at(i).write_cruise_steps(subpath + num2Str(i), &file);
this->cruise_steps.at(i).write_cruise_steps(subpath + num2Str(i), &file);
}
/* Setup approach blocks */
......@@ -224,12 +192,29 @@ void standard_mission::fill_mission_file(standard_mission::mission_parameters* m
file.at(subpath).addAttrib("description", description);
subpath += "/approach_step@";
for (uint16_t i(0); i < mission->approach_steps.size(); i++) {
for (uint16_t i(0); i < this->approach_steps.size(); i++) {
file[(subpath + num2Str(i))];
file.at(subpath + num2Str(i)).addAttrib("description", "Single approach step");
mission->approach_steps.at(i).write_approach_steps(subpath + num2Str(i), &file);
this->approach_steps.at(i).write_approach_steps(subpath + num2Str(i), &file);
}
aixml::saveDocument(file);
aixml::closeDocument(file);
// std::string subPath("AcftExchangeFile/Performance/RequirementsChecks/TLARs/"); // TODO(Gerrit): Check if still needed!
// /* Mission type: requirement mission */
// if (myRequirementMissionSettingsPt->getWriteMissionFile() &&
// (!this->myMissionXMLPt->acXML.at(subPath + "h_initialCruise_Design").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "h_maxOperating").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "h_maxOEI").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "M_initialCruise_Design").getIntAttrib("Checked") ||
// !this->myMissionXMLPt->acXML.at(subPath + "TTC_Design").getIntAttrib("Checked"))) {
// this->myMissionXMLPt->acXML.at("AcftExchangeFile/Performance/RequirementsChecks/MissionFile").setAttrib("OfftakesWritten", 0);
// this->generateMissionXMLFile(myRequirementMissionProfilePt, myRequirementMissionSettingsPt, myRequirementMissionPt);
// }
}
void standard_mission::report() {
}
void standard_mission::save() {
}
......@@ -48,147 +48,100 @@ class standard_mission : public Strategy {
double relative_segment_length; /**< Relative segment length of the step [-] */
double altitude; /**< Altitude of the step [m] */
};
/** \class mission_parameters
* \brief gathers the attributes each mission needs for itself
* \param name: Name of the mission
* \param single_PAX_mass: Mass of a single passenger [m]
*/
class mission_parameters {
public:
explicit mission_parameters(const std::string &name, const double single_PAX_mas);
~mission_parameters();
/* Naming */
std::string mission_type; /**< Name of the mission */
std::string mission_xml_name; /**< Name of the generated mission XML file */
/* Boolean Config settings */
bool write_mission_file; /**< Switch for generating a mission file */
bool auto_select_initial_cruise_altitude; /**< Switch for selecting an initial cruise altitude */
bool auto_select_flight_level; /**< Switch for automatic selection of the flight level */
bool round_to_regular_flight_level; /**< Switch for rounding the flight level */
bool no_steps; /**< Switch for the number of steps */
/* Mission values */
Endnode<double> range; /**< Total range of the aircraft [m] */
Endnode<double> payload; /**< Payload of the aircraft [kg] */
Endnode<int> pax_number; /**< Number of the passengers [-] */
Endnode<double> cargo_mass; /**< Mass of the cargo [kg] */
Endnode<double> initial_cruise_mach; /**< Initial cruise Mach number [-] */
Endnode<double> alternate_distance; /**< Range of the alternate mission [NM] */
Endnode<double> taxi_time_origin; /**< Length of the taxiing time at start [s] */
Endnode<double> taxi_time_destination; /**< Length of the taxiing time after landing [s] */
Endnode<std::string> taxiing_procedure; /**< Switch to activate electric taxiing */
Endnode<double> engine_warmup_time; /**< Engine warm up time before start [s] */
Endnode<double> terminal_operation_time; /**< Time at terminal for intermediate landings [s] */
Endnode<std::string> origin_airport; /**< ICAO code of origin airport */
Endnode<std::string> destination_airport; /**< ICAO code of destination airport */
double auto_climb_altitude_steps; /**< Altitude step at cruising flight if automatic altitude adaption [m] */
double auto_rate_of_climb_steps; /**< Rate of climb for altitude step at cruising flight if automatic altitude adaption [m/s] */
int cruise_step_number; /**< Number of the cruise steps [-] */
double CAS_ATC_limit_climb; /**< Calibrated airspeed under flight level 100 during climb [m/s] */
double CAS_ATC_limit_descent; /**< Calibrated airspeed under flight level 100 during descent [m/s] */
double CAS_over_flight_level_100_climb; /**< Calibrated airspeed over flight level 100 during climb [m/s] */
double CAS_over_flight_level_100_descent; /**< Calibrated airspeed over flight level 100 during descent [m/s] */
double mach_climb; /**< Mach number for climb [-] */
double initial_cruise_altitude; /**< Initial cruise altitude [FL] */
double delta_temperature_ISA; /**< Temperature deviation from international standard atmosphere [K] */
double delta_mach_climb_to_mach_cruise; /**< Difference between Mach number over crossover-altitude to cruise Mach number [-] */
double maximum_rate_of_climb; /**< Limit for ROC in climb segments; if 0, full thrust is used for climb [m/s] */
double approach_speed; /* Given approach speed [m/s] */
std::vector<cruise_step_segment> cruise_step_segments; /* Vector of cruise speed segments to specify the cruise phases for a constant flight_level */
/* Mission steps */
std::vector<departure_step> departure_steps; /**< Vector for the flight steps on departure */
std::vector<cruise_step> cruise_steps; /**< Vector for the flight steps on cruising flight */
std::vector<approach_step> approach_steps; /**< Vector for the flight steps on approach */
/* Modes */
uint16_t takeoff_procedure; /* Definition of the takeoff procedure */
uint16_t approach_procedure; /* Definition of the approach procedure */
std::string climb_thrust_setting; /* Definition of the climb procedure */
};
mission_parameters* design_mission; /* mission parameters for the design mission */
mission_parameters* study_mission; /* mission parameters for the study mission */
mission_parameters* requirements_mission; /* mission parameters for the requirement mission */
/* Naming */
std::string mission_type; /**< Name of the mission */
std::string mission_xml_name; /**< Name of the generated mission XML file */
/* Boolean Config settings */
bool auto_select_initial_cruise_altitude; /**< Switch for selecting an initial cruise altitude */
bool auto_select_flight_level; /**< Switch for automatic selection of the flight level */
bool round_to_regular_flight_level; /**< Switch for rounding the flight level */
bool no_steps; /**< Switch for the number of steps */
/* Mission values */
Endnode<double> range; /**< Total range of the aircraft [m] */
Endnode<double> payload; /**< Payload of the aircraft [kg] */
Endnode<int> pax_number; /**< Number of the passengers [-] */
Endnode<double> cargo_mass; /**< Mass of the cargo [kg] */
Endnode<double> initial_cruise_mach; /**< Initial cruise Mach number [-] */
Endnode<double> alternate_distance; /**< Range of the alternate mission [NM] */
Endnode<double> taxi_time_origin; /**< Length of the taxiing time at start [s] */
Endnode<double> taxi_time_destination; /**< Length of the taxiing time after landing [s] */
Endnode<std::string> taxiing_procedure; /**< Switch to activate electric taxiing */
Endnode<double> engine_warmup_time; /**< Engine warm up time before start [s] */
Endnode<double> terminal_operation_time; /**< Time at terminal for intermediate landings [s] */
Endnode<std::string> origin_airport; /**< ICAO code of origin airport */
Endnode<std::string> destination_airport; /**< ICAO code of destination airport */
double auto_climb_altitude_steps; /**< Altitude step at cruising flight if automatic altitude adaption [m] */
double auto_rate_of_climb_steps; /**< Rate of climb for altitude step at cruising flight if automatic altitude adaption [m/s] */
int cruise_step_number; /**< Number of the cruise steps [-] */
double CAS_ATC_limit_climb; /**< Calibrated airspeed under flight level 100 during climb [m/s] */
double CAS_ATC_limit_descent; /**< Calibrated airspeed under flight level 100 during descent [m/s] */
double CAS_over_flight_level_100_climb; /**< Calibrated airspeed over flight level 100 during climb [m/s] */
double CAS_over_flight_level_100_descent; /**< Calibrated airspeed over flight level 100 during descent [m/s] */
double mach_climb; /**< Mach number for climb [-] */
double initial_cruise_altitude; /**< Initial cruise altitude [FL] */
double delta_temperature_ISA; /**< Temperature deviation from international standard atmosphere [K] */
double delta_mach_climb_to_mach_cruise; /**< Difference between Mach number over crossover-altitude to cruise Mach number [-] */
double maximum_rate_of_climb; /**< Limit for ROC in climb segments; if 0, full thrust is used for climb [m/s] */
double approach_speed; /* Given approach speed [m/s] */
std::vector<cruise_step_segment> cruise_step_segments; /* Vector of cruise speed segments to specify the cruise phases for a constant flight_level */
/* Mission steps */
std::vector<departure_step> departure_steps; /**< Vector for the flight steps on departure */
std::vector<cruise_step> cruise_steps; /**< Vector for the flight steps on cruising flight */
std::vector<approach_step> approach_steps; /**< Vector for the flight steps on approach */
/* Modes */
uint16_t takeoff_procedure; /* Definition of the takeoff procedure */
uint16_t approach_procedure; /* Definition of the approach procedure */
std::string climb_thrust_setting; /* Definition of the climb procedure */
/* Member functions */
/* Initialize */
/** \brief Function bundels the setter functions below to initialize the given mission
* \details Function reads the range and payload depending on the mission type out of the requirements block of the aircraft XML.
* \param mission: mission_parameters object which shall be filled
*/
void initialize_mission(standard_mission::mission_parameters* mission);
/** \brief Function sets the methods
* \details Function gets settings like the switches for automatic flight_level change or step calculation + names and paths.
* \param mission: mission_parameters object which shall be filled
*/
void set_module_settings(standard_mission::mission_parameters* mission);
void set_module_settings();
/** \brief Function sets the range, payload, number of passengers and the cargo mass of the aircraft
* \details Function reads the range and payload depending on the mission type out of the requirements block of the aircraft XML.
* \param mission: mission_parameters object which shall be filled
*/
void set_range_and_payload(standard_mission::mission_parameters* mission);
void set_range_and_payload();
/** \brief Function sets cruise parameters
* \details Function fills the cruise_step_segments which again will be used for the cruise steps.
* \param mission: mission_parameters object which shall be filled
*/
void set_cruise(standard_mission::mission_parameters* mission);
void set_cruise();
/** \brief Function sets climb and descent parameters
* \details Function calculates transition altitudes and calibrated airspeeds for the different climb and descent steps.
* \param mission: mission_parameters object which shall be filled
*/
void set_climb_and_descent(standard_mission::mission_parameters* mission);
void set_climb_and_descent();
/** \brief Function sets start and landing parameters
* \details Function gathers input for start, landing and further ground operation
* \param mission: mission_parameters object which shall be filled
*/
void set_start_and_landing(standard_mission::mission_parameters* mission);
void set_start_and_landing();
/** \brief Function to set performance limits
* \details Function gathers climb_thrust_setting and maximum_rate_of_climb.
* \param mission: mission_parameters object which shall be filled
*/
void set_performance_limits(standard_mission::mission_parameters* mission);
/** \brief Function to give shell output
* \details Function displays Range, Payload, Cruise Mach number, Initial cruise altitude, Climb speed under FL100, Climb speed above FL100 and Climb Mach number
* \param mission: mission_parameters object which shall be filled
*/
void write_shell_output(standard_mission::mission_parameters* mission);
void set_performance_limits();
/* Mission steps and profiles */
/** \brief Function bundels the setter functions below to define the mission profiles for the given mission
* \details set_cruise_profile, set_departure_profile and set_approach_profile are executed.
* \param mission: mission_parameters object which shall be filled
*/
void set_mission_profiles(standard_mission::mission_parameters* mission);
void set_mission_profiles();
/** \brief Function creates the cruise profile of the mission
* \details It creates objects for the different cruise steps and saves them in a vector.
* \param mission: mission_parameters object which shall be filled
*/
void set_cruise_profile(standard_mission::mission_parameters* mission);
void set_cruise_profile();
/** \brief Function creates the departure profile.
* \details It creates objects for the different departure steps and saves them in a vector.
* It checks the take off procedure and cancels the program if procedure in configuration file is unknown or not yet implemented.
* \param mission: mission_parameters object which shall be filled
*/
void set_departure_profile(standard_mission::mission_parameters* mission);
void set_departure_profile();
/** \brief Function creates the approach profile of the mission.
* \details It creates objects for the different approach steps and saves them in a vector.
* It checks the approach procedure and cancels the program if procedure in configuration file is unknown or not yet implemented.
* \param mission: mission_parameters object which shall be filled
*/
void set_approach_profile(standard_mission::mission_parameters* mission);
/* Write mission file */
/** \brief Function sets up global mission data for a given mission
* \details It opens an aixml sets its first node up via an input stream.
*/
void setup_mission_file(standard_mission::mission_parameters* mission);
/** \brief Function fills mission files with the mission's endnodes
* \details Endnodes for global mission parameters and cruise, approach and departure steps.
*/
void fill_mission_file(standard_mission::mission_parameters* mission);
void set_approach_profile();
private:
/* Attributes */
......@@ -215,4 +168,64 @@ class standard_mission : public Strategy {
}
};
/* Namespace for study mission (not needed explicitly, but good for uniformity and doxygen) */
namespace design_mission {
class standard_mission : public ::standard_mission {
public:
// Constructor that calls the base class constructor
explicit standard_mission(const std::shared_ptr<RuntimeIO>& rtIO)
: ::standard_mission(rtIO) {}
/* Overwrite method of standard_mission */
void initialize() override {
this->mission_type = "design_mission";
::standard_mission::initialize();
}
/* Own methods to replace within/add to standard_mission methods */
};
} // namespace design_mission
/* Namespace for study mission (not needed explicitly, but good for uniformity and doxygen) */
namespace study_mission {
class standard_mission : public ::standard_mission {
public:
// Constructor that calls the base class constructor
explicit standard_mission(const std::shared_ptr<RuntimeIO>& rtIO)
: ::standard_mission(rtIO) {}
/* Overwrite method of standard_mission */
void initialize() override {
this->mission_type = "study_mission";
::standard_mission::initialize();
}
/* Own methods to replace within/add to standard_mission methods */
};
} // namespace study_mission
/* Namespace for study mission (not needed explicitly, but good for uniformity and doxygen) */
namespace requirements_mission {
class standard_mission : public ::standard_mission {
public:
// Constructor that calls the base class constructor
explicit standard_mission(const std::shared_ptr<RuntimeIO>& rtIO)
: ::standard_mission(rtIO) {}
/* Overwrite method of standard_mission */
void initialize() override {
this->mission_type = "design_mission"; // Set to design mission to initialize
::standard_mission::initialize();
this->mission_type = "requirements_mission"; // Switch to requirements mission
this->mission_xml_name =
EndnodeReadOnly<std::string>("requirements_and_specifications/mission_files/requirements_mission_file").read(rtIO->acxml).value();
cruise_step_segment single_cruise_step(1., convertUnit(HECTO, FOOT, NOPREFIX, METER, this->initial_cruise_altitude));
this->cruise_step_segments.clear(); // Clear cruise steps for requirement mission
this->cruise_step_segments.push_back(single_cruise_step); // Only initial cruise altitude needed from which you climb to ceiling
}
/* Own methods to replace within/add to standard_mission methods */
};
} // namespace requirements_mission
#endif // CREATE_MISSION_XML_SRC_STANDARD_MISSION_STANDARD_MISSION_STANDARD_MISSION_H_
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment