50# define M_PI 3.14159265358979323846
107 prev_in = prev_out = 0.0;
108 double denom = 2.0 + coeff*dt;
110 cb = (2.0 - coeff*dt)/denom;
113 double out = (in + prev_in)*ca + prev_out*cb;
196 return 1.8*kelvin - 459.4;
203 return celsius * 1.8 + 491.67;
210 return (rankine - 491.67)/1.8;
231 return (fahrenheit - 32.0)/1.8;
238 return celsius * 1.8 + 32.0;
245 return celsius + 273.15;
252 return kelvin - 273.15;
259 return measure*0.3048;
302 double eps = 2.0*DBL_EPSILON;
303 return std::fabs(a - b) <= eps * std::max<double>(std::fabs(a), std::fabs(b));
311 float eps = 2.0*FLT_EPSILON;
312 return std::fabs(a - b) <= eps * std::max<double>(std::fabs(a), std::fabs(b));
333 static constexpr double Constrain(
double min,
double value,
double max) {
334 return value<
min?(
min):(value>max?(max):(value));
337 static constexpr double sign(
double num) {
return num>=0.0?1.0:-1.0;}
356 static constexpr double fttom = 0.3048;
368 static constexpr double kgtolb = 2.20462;
BaseException(const std::string &msg)
Filter(double coeff, double dt)
double execute(double in)
void PutMessage(const Message &msg)
Places a Message structure on the Message queue.
static unsigned int messageId
static constexpr double radtodeg
static double PitotTotalPressure(double mach, double p)
Compute the total pressure in front of the Pitot tube.
static char fgdef[6]
default text
static double MachFromImpactPressure(double qc, double p)
Compute the Mach number from the differential pressure (qc) and the static pressure.
static char halfint[5]
low intensity text
static constexpr double FahrenheitToCelsius(double fahrenheit)
Converts from degrees Fahrenheit to degrees Celsius.
static constexpr double ktstofps
static std::queue< Message > Messages
static constexpr double CelsiusToRankine(double celsius)
Converts from degrees Celsius to degrees Rankine.
FGJSBBase()
Constructor for FGJSBBase.
static constexpr double inchtoft
static constexpr double Constrain(double min, double value, double max)
Constrain a value between a minimum and a maximum value.
static double GaussianRandomNumber(void)
static constexpr double psftopa
static constexpr double slugtolb
Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can a...
static constexpr double m3toft3
static char highint[5]
highlights text
static constexpr double inhgtopa
static constexpr double in3tom3
int SomeMessages(void) const
Reads the message on the queue (but does not delete it).
static char reset[5]
resets text properties
static constexpr double KelvinToRankine(double kelvin)
Converts from degrees Kelvin to degrees Rankine.
static constexpr double sign(double num)
static constexpr double psftoinhg
static constexpr double kgtoslug
static char fgblue[6]
blue text
static const std::string & GetVersion(void)
Returns the version number of JSBSim.
static char normint[6]
normal intensity text
static int gaussian_random_number_phase
static constexpr double RankineToKelvin(double rankine)
Converts from degrees Rankine to degrees Kelvin.
static constexpr double kgtolb
static char fgred[6]
red text
static constexpr double CelsiusToKelvin(double celsius)
Converts from degrees Celsius to degrees Kelvin.
static constexpr double KelvinToCelsius(double kelvin)
Converts from degrees Kelvin to degrees Celsius.
static bool EqualToRoundoff(double a, double b)
Finite precision comparison.
static constexpr double fpstokts
void PutMessage(const std::string &text)
Creates a message with the given text and places it on the queue.
void PutMessage(const std::string &text, int iVal)
Creates a message with the given text and integer value and places it on the queue.
static bool EqualToRoundoff(float a, double b)
Finite precision comparison.
static constexpr double CelsiusToFahrenheit(double celsius)
Converts from degrees Celsius to degrees Fahrenheit.
static constexpr double FeetToMeters(double measure)
Converts from feet to meters.
static char fggreen[6]
green text
static constexpr double hptoftlbssec
Message * ProcessNextMessage(void)
Reads the next message on the queue and removes it from the queue.
virtual ~FGJSBBase()
Destructor for FGJSBBase.
void PutMessage(const std::string &text, double dVal)
Creates a message with the given text and double value and places it on the queue.
void disableHighLighting(void)
Disables highlighting in the console output.
static double VcalibratedFromMach(double mach, double p)
Calculate the calibrated airspeed from the Mach number.
static constexpr double degtorad
void ProcessMessage(void)
Reads the message on the queue and removes it from the queue.
static const std::string JSBSim_version
static char underoff[6]
underline off
static constexpr double lbtoslug
static double MachFromVcalibrated(double vcas, double p)
Calculate the Mach number from the calibrated airspeed.Based on the formulas in the US Air Force Airc...
static char underon[5]
underlines text
static constexpr double KelvinToFahrenheit(double kelvin)
Converts from degrees Kelvin to degrees Fahrenheit.
static bool EqualToRoundoff(double a, float b)
Finite precision comparison.
static const std::string needed_cfg_version
void PutMessage(const std::string &text, bool bVal)
Creates a message with the given text and boolean value and places it on the queue.
static bool EqualToRoundoff(float a, float b)
Finite precision comparison.
static constexpr double fttom
static char fgcyan[6]
cyan text
static std::string CreateIndexedPropertyName(const std::string &Property, int index)
static constexpr double RankineToCelsius(double rankine)
Converts from degrees Rankine to degrees Celsius.
JSBSim Message structure.
enum JSBSim::FGJSBBase::Message::mType type