41#include "simgear/magvar/coremag.hxx"
56 INERTIAL_UPDATE_RATE(1000)
58 Propagate =
fcs->GetExec()->GetPropagate();
59 MassBalance =
fcs->GetExec()->GetMassBalance();
60 Inertial =
fcs->GetExec()->GetInertial();
66 cerr << element->ReadFrom()
67 <<
"No location given for magnetometer. " << endl;
68 throw(
"Malformed magnetometer specification.");
71 vRadius = MassBalance->StructuralToBody(vLocation);
78 #if defined(_MSC_VER) || defined(__MINGW32__)
79 gmtime_s(&ptm, &rawtime);
81 gmtime_r(&rawtime, &ptm);
84 int year = ptm.tm_year;
90 date = (yymmdd_to_julian_days(ptm.tm_year, ptm.tm_mon, ptm.tm_mday));
112void FGMagnetometer::updateInertialMag(
void)
114 if (counter++ % INERTIAL_UPDATE_RATE == 0)
121 calc_magvar( usedLat, usedLon, usedAlt, date, field );
131 vRadius = MassBalance->StructuralToBody(vLocation);
136 vMag = Propagate->GetTl2b() *
FGColumnVector3(field[3], field[4], field[5]);
169void FGMagnetometer::Debug(
int from)
171 string ax[4] = {
"none",
"X",
"Y",
"Z"};
177 cout <<
" Axis: " << ax[
axis] << endl;
181 if (from == 0) cout <<
"Instantiated: FGMagnetometer" << endl;
182 if (from == 1) cout <<
"Destroyed: FGMagnetometer" << endl;
FGColumnVector3 FindElementTripletConvertTo(const std::string &target_units)
Composes a 3-element column vector for the supplied location or orientation.
Element * FindElement(const std::string &el="")
Searches for a specified element.
This class implements a 3 element column vector.
virtual void SetOutput(void)
static constexpr double fttom
FGMagnetometer(FGFCS *fcs, Element *element)
void ResetPastStates(void) override
double GetGeodLatitudeRad(void) const
double GetLongitude(void) const
double GetGeodeticAltitude(void) const
FGSensorOrientation(Element *element)
FGSensor(FGFCS *fcs, Element *element)
void ResetPastStates(void) override
void ProcessSensorSignal(void)