Date started: 01/21/08
Purpose: Encapsulates the buoyant forces
- ------------- Copyright (C) 2008 - 2009 Anders Gidenstam -------------
+ ------------- Copyright (C) 2008 - 2010 Anders Gidenstam -------------
------------- Copyright (C) 2008 Jon S. Berndt (jon@jsbsim.org) -------------
This program is free software; you can redistribute it and/or modify it under
#include "FGBuoyantForces.h"
#include "FGMassBalance.h"
-#include "input_output/FGPropertyManager.h" // Need?
+#include "input_output/FGPropertyManager.h"
#include <iostream>
using namespace std;
namespace JSBSim {
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGBuoyantForces.cpp,v 1.14 2010/11/18 12:38:06 jberndt Exp $";
static const char *IdHdr = ID_BUOYANTFORCES;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
gasCellJ.InitMatrix();
- bind();
-
Debug(0);
}
gas_cell_element = document->FindNextElement("gas_cell");
}
- FGModel::PostLoad(element);
+ PostLoad(element, PropertyManager);
+
+ if (!NoneDefined) {
+ bind();
+ }
return true;
}
gasCellJ = FGMatrix33();
for (unsigned int i=0; i < size; i++) {
- FGColumnVector3 v = MassBalance->StructuralToBody( Cells[i]->GetXYZ() );
+ FGColumnVector3 v = FDMExec->GetMassBalance()->StructuralToBody( Cells[i]->GetXYZ() );
// Body basis is in FT.
const double mass = Cells[i]->GetMass();
void FGBuoyantForces::bind(void)
{
+ typedef double (FGBuoyantForces::*PMF)(int) const;
+ PropertyManager->Tie("moments/l-buoyancy-lbsft", this, eL,
+ (PMF)&FGBuoyantForces::GetMoments);
+ PropertyManager->Tie("moments/m-buoyancy-lbsft", this, eM,
+ (PMF)&FGBuoyantForces::GetMoments);
+ PropertyManager->Tie("moments/n-buoyancy-lbsft", this, eN,
+ (PMF)&FGBuoyantForces::GetMoments);
+ PropertyManager->Tie("forces/fbx-buoyancy-lbs", this, eX,
+ (PMF)&FGBuoyantForces::GetForces);
+ PropertyManager->Tie("forces/fby-buoyancy-lbs", this, eY,
+ (PMF)&FGBuoyantForces::GetForces);
+ PropertyManager->Tie("forces/fbz-buoyancy-lbs", this, eZ,
+ (PMF)&FGBuoyantForces::GetForces);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%