]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/flight_control/FGMagnetometer.h
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / flight_control / FGMagnetometer.h
old mode 100755 (executable)
new mode 100644 (file)
index 456d14d..c7a850a
@@ -38,18 +38,19 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSensor.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
 #include "models/FGPropagate.h"
 #include "models/FGMassBalance.h"
 #include "models/FGInertial.h"
 #include "math/FGColumnVector3.h"
 #include "math/FGMatrix33.h"
+#include "FGSensorOrientation.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_MAGNETOMETER "$Id$"
+#define ID_MAGNETOMETER "$Id: FGMagnetometer.h,v 1.4 2009/12/11 06:03:06 jberndt Exp $"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -69,8 +70,13 @@ Syntax:
 
 @code
 <magnetometer name="name">
-  <input> property </input>
+  <axis> {X|Y|Z} </axis>
   <lag> number </lag>
+  <orientation unit=DEG">
+    <x> number </x>
+    <y> number </y>
+    <z> number </z>
+  </orientation>
   <noise variation="PERCENT|ABSOLUTE"> number </noise>
   <quantization name="name">
     <bits> number </bits>
@@ -86,8 +92,8 @@ Syntax:
 Example:
 
 @code
-<magnetometer name="aero/magnetometer/qbar">
-  <input> aero/qbar </input>
+<magnetometer name="aero/magnetometer/X">
+  <axis> X </axis>
   <lag> 0.5 </lag>
   <noise variation="PERCENT"> 2 </noise>
   <quantization name="aero/magnetometer/quantized/qbar">
@@ -100,8 +106,9 @@ Example:
 </magnetometer>
 @endcode
 
-The only required element in the magnetometer definition is the input element. In that
-case, no degradation would be modeled, and the output would simply be the input.
+The only required element in the magnetometer definition is the axis element. In
+the default case, no degradation would be modeled, and the output would simply be
+the input.
 
 For noise, if the type is PERCENT, then the value supplied is understood to be a
 percentage variance. That is, if the number given is 0.05, the the variance is
@@ -111,14 +118,14 @@ even varying all the way from 0.95 to 1.05 in adjacent frames - whatever the del
 time.
 
 @author Jon S. Berndt
-@version $Revision$
+@version $Revision: 1.4 $
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGMagnetometer  : public FGSensor
+class FGMagnetometer  : public FGSensor, public FGSensorOrientation
 {
 public:
   FGMagnetometer(FGFCS* fcs, Element* element);
@@ -131,13 +138,9 @@ private:
   FGMassBalance* MassBalance;
   FGInertial* Inertial;
   FGColumnVector3 vLocation;
-  FGColumnVector3 vOrient;
   FGColumnVector3 vRadius;
   FGColumnVector3 vMag;
-  FGMatrix33 mT;
-  void CalculateTransformMatrix(void);
   void updateInertialMag(void);
-  int axis;
   double field[6];
   double usedLat;
   double usedLon;