FlightGear next
|
#include <stdio.h>
#include <stdlib.h>
#include "yasim-common.hpp"
#include "Math.hpp"
#include "FGFDM.hpp"
#include "PropEngine.hpp"
#include "Propeller.hpp"
#include "Atmosphere.hpp"
#include <simgear/misc/sg_path.hxx>
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) |
Get a double value for a property. | |
bool | fgSetDouble (const char *name, double defaultValue) |
Set a double value for a property. | |
int | main (int argc, char **argv) |
Variables | |
const int | COUNT = 100 |
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 25 of file proptest.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 30 of file proptest.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 29 of file proptest.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 27 of file proptest.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 28 of file proptest.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 24 of file proptest.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 31 of file proptest.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 23 of file proptest.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 26 of file proptest.cpp.
int main | ( | int | argc, |
char ** | argv ) |
Definition at line 35 of file proptest.cpp.
const int COUNT = 100 |
Definition at line 33 of file proptest.cpp.