FlightGear next
|
#include <stdio.h>
#include <cstring>
#include <cstdlib>
#include <simgear/props/props.hxx>
#include <simgear/xml/easyxml.hxx>
#include <simgear/misc/sg_path.hxx>
#include "yasim-common.hpp"
#include "FGFDM.hpp"
#include "Atmosphere.hpp"
#include "RigidBody.hpp"
#include "Airplane.hpp"
Go to the source code of this file.
Functions | |
bool | fgSetFloat (const char *name, float val) |
Set a float value for a property. | |
bool | fgSetBool (char const *name, bool val) |
Set a bool value for a property. | |
bool | fgGetBool (char const *name, bool def) |
Get a bool value for a property. | |
bool | fgSetString (char const *name, char const *str) |
Set a string value for a property. | |
SGPropertyNode * | fgGetNode (const char *path, bool create) |
Get a property node. | |
SGPropertyNode * | fgGetNode (const char *path, int i, bool create) |
Get a property node with separate index. | |
float | fgGetFloat (const char *name, float defaultValue) |
Get a float value for a property. | |
double | fgGetDouble (const char *name, double defaultValue=0.0) |
Get a double value for a property. | |
bool | fgSetDouble (const char *name, double defaultValue=0.0) |
Set a double value for a property. | |
void | _setup (Airplane *a, Airplane::Configuration cfgID, float altitude) |
void | _calculateAcceleration (Airplane *a, float aoa_rad, float speed_mps, float *output) |
void | yasim_graph (Airplane *a, const float alt, const float kts, Airplane::Configuration cfgID) |
void | yasim_masses (Airplane *a) |
void | yasim_drag (Airplane *a, const float aoa, const float alt, Airplane::Configuration cfgID) |
float | yasim_find_zero_lift_aoa (Airplane *a, const float alt, float kts, Airplane::Configuration cfgID, float *acc) |
void | yasim_best_speed_at_height (Airplane *a, const float alt, Airplane::Configuration cfgID, bool verbose, float &o_best_speed_kts, float &o_best_drag, float &o_best_aoa_deg) |
void | yasim_show_best_speed_at_heights (Airplane *a, Airplane::Configuration cfgID) |
void | findMinSpeed (Airplane *a, float alt) |
void | yasim_graph_detailed (Airplane *a, const float alt, const float kts, Airplane::Configuration cfgID) |
void | yasim_drag_detailed (Airplane *a, const float aoa, const float alt, Airplane::Configuration cfgID) |
void | findMinSpeedDetailed (Airplane *a, float alt) |
void | report (Airplane *a) |
int | usage () |
int | main (int argc, char **argv) |
void _calculateAcceleration | ( | Airplane * | a, |
float | aoa_rad, | ||
float | speed_mps, | ||
float * | output ) |
Definition at line 50 of file yasim-test.cpp.
void _setup | ( | Airplane * | a, |
Airplane::Configuration | cfgID, | ||
float | altitude ) |
Definition at line 31 of file yasim-test.cpp.
bool fgGetBool | ( | const char * | name, |
bool | defaultValue = false ) |
Get a bool value for a property.
This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getBoolValue() method, to avoid the lookup overhead.
name | The property name. |
defaultValue | The default value to return if the property does not exist. |
Definition at line 22 of file yasim-test.cpp.
double fgGetDouble | ( | const char * | name, |
double | defaultValue = 0.0 ) |
Get a double value for a property.
This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getDoubleValue() method, to avoid the lookup overhead.
name | The property name. |
defaultValue | The default value to return if the property does not exist. |
Definition at line 27 of file yasim-test.cpp.
float fgGetFloat | ( | const char * | name, |
float | defaultValue = 0.0 ) |
Get a float value for a property.
This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getFloatValue() method, to avoid the lookup overhead.
name | The property name. |
defaultValue | The default value to return if the property does not exist. |
Definition at line 26 of file yasim-test.cpp.
SGPropertyNode * fgGetNode | ( | const char * | path, |
bool | create = false ) |
Get a property node.
path | The path of the node, relative to root. |
create | true to create the node if it doesn't exist. |
Definition at line 24 of file yasim-test.cpp.
SGPropertyNode * fgGetNode | ( | const char * | path, |
int | index, | ||
bool | create = false ) |
Get a property node with separate index.
This method separates the index from the path string, to make it easier to iterate through multiple components without using sprintf to add indices. For example, fgGetNode("foo[1]/bar", 3) will return the same result as fgGetNode("foo[1]/bar[3]").
path | The path of the node, relative to root. |
index | The index for the last member of the path (overrides any given in the string). |
create | true to create the node if it doesn't exist. |
Definition at line 25 of file yasim-test.cpp.
bool fgSetBool | ( | const char * | name, |
bool | val ) |
Set a bool value for a property.
Assign a bool value to a property. If the property does not yet exist, it will be created and its type will be set to BOOL; if it has a type of UNKNOWN, the type will also be set to BOOL; otherwise, the bool value will be converted to the property's type.
Definition at line 21 of file yasim-test.cpp.
bool fgSetDouble | ( | const char * | name, |
double | val ) |
Set a double value for a property.
Assign a double value to a property. If the property does not yet exist, it will be created and its type will be set to DOUBLE; if it has a type of UNKNOWN, the type will also be set to DOUBLE; otherwise, the double value will be converted to the property's type.
Definition at line 28 of file yasim-test.cpp.
bool fgSetFloat | ( | const char * | name, |
float | val ) |
Set a float value for a property.
Assign a float value to a property. If the property does not yet exist, it will be created and its type will be set to FLOAT; if it has a type of UNKNOWN, the type will also be set to FLOAT; otherwise, the bool value will be converted to the property's type.
Definition at line 20 of file yasim-test.cpp.
bool fgSetString | ( | const char * | name, |
const char * | val ) |
Set a string value for a property.
Assign a string value to a property. If the property does not yet exist, it will be created and its type will be set to STRING; if it has a type of UNKNOWN, the type will also be set to STRING; otherwise, the string value will be converted to the property's type.
Definition at line 23 of file yasim-test.cpp.
void findMinSpeed | ( | Airplane * | a, |
float | alt ) |
Definition at line 221 of file yasim-test.cpp.
void findMinSpeedDetailed | ( | Airplane * | a, |
float | alt ) |
Definition at line 309 of file yasim-test.cpp.
int main | ( | int | argc, |
char ** | argv ) |
Definition at line 421 of file yasim-test.cpp.
void report | ( | Airplane * | a | ) |
Definition at line 329 of file yasim-test.cpp.
int usage | ( | ) |
Definition at line 398 of file yasim-test.cpp.
void yasim_best_speed_at_height | ( | Airplane * | a, |
const float | alt, | ||
Airplane::Configuration | cfgID, | ||
bool | verbose, | ||
float & | o_best_speed_kts, | ||
float & | o_best_drag, | ||
float & | o_best_aoa_deg ) |
Definition at line 169 of file yasim-test.cpp.
void yasim_drag | ( | Airplane * | a, |
const float | aoa, | ||
const float | alt, | ||
Airplane::Configuration | cfgID ) |
Definition at line 127 of file yasim-test.cpp.
void yasim_drag_detailed | ( | Airplane * | a, |
const float | aoa, | ||
const float | alt, | ||
Airplane::Configuration | cfgID ) |
Definition at line 288 of file yasim-test.cpp.
float yasim_find_zero_lift_aoa | ( | Airplane * | a, |
const float | alt, | ||
float | kts, | ||
Airplane::Configuration | cfgID, | ||
float * | acc ) |
Definition at line 149 of file yasim-test.cpp.
void yasim_graph | ( | Airplane * | a, |
const float | alt, | ||
const float | kts, | ||
Airplane::Configuration | cfgID ) |
Definition at line 75 of file yasim-test.cpp.
void yasim_graph_detailed | ( | Airplane * | a, |
const float | alt, | ||
const float | kts, | ||
Airplane::Configuration | cfgID ) |
Definition at line 253 of file yasim-test.cpp.
void yasim_masses | ( | Airplane * | a | ) |
Definition at line 110 of file yasim-test.cpp.
void yasim_show_best_speed_at_heights | ( | Airplane * | a, |
Airplane::Configuration | cfgID ) |
Definition at line 204 of file yasim-test.cpp.