本文整理汇总了C++中Param::add_option方法的典型用法代码示例。如果您正苦于以下问题:C++ Param::add_option方法的具体用法?C++ Param::add_option怎么用?C++ Param::add_option使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Param
的用法示例。
在下文中一共展示了Param::add_option方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: System
Controls::Controls(Aeromatic *p) :
System(p, true),
_ctype(0)
{
_description.push_back("Aircraft control");
Param *controls = new Param("Control system", 0, _ctype);
_inputs.push_back(controls);
_control[0] = new CableControls(p);
controls->add_option(_control[0]->get_description());
_control[1] = new YawDamper(p);
controls->add_option(_control[1]->get_description());
_control[2] = new FlyByWire(p);
// controls->add_option(_control[2]->get_description());
}
示例2: Aircraft
Aeromatic::Aeromatic() : Aircraft(),
_atype(LIGHT),
_system_files(true),
_metric(0),
_stall_speed(0),
_stall_weight(0),
_max_weight(10000.0f),
_empty_weight(0),
_length(40.0f),
_payload(10000.0f),
_user_wing_data(-2),
_no_engines(0),
_wing_mounted_engines(false)
{
_inertia[0] = _inertia[1] = _inertia[2] = 0.0;
_payload = _max_weight;
_stall_weight = _max_weight;
_wing.span = 40.0f;
// Historically speaking most aircraft are modern since the
// number of aircraft types has exploded since the late sixties.
if (_atype == LIGHT) {
_wing.Ktf = 0.87f; // for NACA-6
} else {
_wing.Ktf = 0.95f; // for supercritical
}
_htail.flap_ratio = 0.27f; // elevator
_vtail.flap_ratio = 0.25f; // rudder
/* general information */
_general.push_back(new Param("Use dedicates System files?", "Select no to keep all systems in the aircraft configuration file", _system_files));
Param* units = new Param("Select a system of measurement", "The options affects all units for length, surface area, speed and thrust/power", _metric);
_general.push_back(units);
units->add_option("English (feet, pounds)");
units->add_option("Metric (meters, kilograms)");
/* performance, weight and balance */
_weight_balance.push_back(new Param("Stall speed VS1 (clean, no flaps)", "The stall speed at maximum takeoff weight", _stall_speed, _metric, SPEED));
_weight_balance.push_back(new Param("Maximum takeoff weight", 0, _max_weight, _metric, WEIGHT));
_weight_balance.push_back(new Param("Empty weight", _estimate, _empty_weight, _metric, WEIGHT));
_weight_balance.push_back(new Param("Inertia Ixx", _estimate, _inertia[X], _metric, INERTIA));
_weight_balance.push_back(new Param("Inertia Iyy", _estimate, _inertia[Y], _metric, INERTIA));
_weight_balance.push_back(new Param("Inertia Izz", _estimate, _inertia[Z], _metric, INERTIA));
/* geometry */
_geometry.push_back(new Param("Length", 0, _length, _metric, LENGTH));
Param* wingshape = new Param("Select a wing shape", "Wing shapes determaine the lift and drag of the aircraft", _wing.shape);
_geometry.push_back(wingshape);
wingshape->add_option("Straight");
wingshape->add_option("Elliptical");
wingshape->add_option("Delta");
// wingshape->add_option("Variable sweep");
_geometry.push_back(new Param("Wing span", 0, _wing.span, _metric, LENGTH));
_geometry.push_back(new Param("Wing area", _estimate, _wing.area, _metric, AREA));
_geometry.push_back(new Param("Wing aspect ratio", _estimate, _wing.aspect));
_geometry.push_back(new Param("Wing taper ratio", _estimate, _wing.taper));
_geometry.push_back(new Param("Wing chord", _estimate, _wing.chord, _metric, LENGTH));
_geometry.push_back(new Param("Wing incidence", _estimate, _wing.incidence));
_geometry.push_back(new Param("Wing dihedral", _estimate, _wing.dihedral));
_geometry.push_back(new Param("Wing sweep (quarter chord)", _estimate, _wing.sweep));
_geometry.push_back(new Param("Htail area", _estimate, _htail.area, _metric, AREA));
_geometry.push_back(new Param("Htail arm", _estimate, _htail.arm, _metric, LENGTH));
_geometry.push_back(new Param("Vtail area", _estimate, _vtail.area, _metric, AREA));
_geometry.push_back(new Param("Vtail arm", _estimate, _vtail.arm, _metric, LENGTH));
Param *param = new Param("Type of aircraft", "Select closest aerodynamic type", _atype);
_general.push_back(param);
_aircraft[0] = new Light(this);
param->add_option(_aircraft[0]->get_description());
_aircraft[1] = new Performance(this);
param->add_option(_aircraft[1]->get_description());
_aircraft[2] = new Fighter(this);
param->add_option(_aircraft[2]->get_description());
_aircraft[3] = new JetTransport(this);
param->add_option(_aircraft[3]->get_description());
_aircraft[4] = new PropTransport(this);
param->add_option(_aircraft[4]->get_description());
Aircraft::_aircraft = this;
_CLalpha[0] = _CLalpha[1] = _CLalpha[2] = 0.0f;
_CLmax[0] = _CLmax[1] = _CLmax[2] = 0.0f;
_CL0 = 0.0f; _CLde = 0.0f; _CLq = 0.0f; _CLadot = 0.0f;
_CD0 = 0.0f; _CDde = 0.0f; _CDbeta = 0.0f;
_Kdi = 0.0f; _Mcrit = 0.0f;
_CYbeta = 0.0f; _CYr = 0.0f; _CYp = 0.0f; _CYdr = 0.0f;
_Clbeta = 0.0f; _Clp = 0.0f; _Clr = 0.0f; _Clda = 0.0f; _Cldr = 0.0f;
_Cmalpha = 0.0f; _Cmde = 0.0f; _Cmq = 0.0f; _Cmadot = 0.0f;
_Cnbeta = 0.0f; _Cnr = 0.0f; _Cnp = 0.0f; _Cndr = 0.0f; _Cnda = 0.0f;
}