LCreal JSBSimModel::getFuelWt() const { if (fdmex == 0) return 0.0; JSBSim::FGPropulsion* Propulsion = fdmex->GetPropulsion(); if (Propulsion == 0) return 0.0; LCreal fuelWt = 0.0; for (unsigned int i = 0; i < Propulsion->GetNumTanks(); i++) { JSBSim::FGTank* tank = Propulsion->GetTank(i); fuelWt += (LCreal)tank->GetContents(); } return fuelWt; }
LCreal JSBSimModel::getFuelWtMax() const { if (fdmex == 0) return 0.0; JSBSim::FGPropulsion* Propulsion = fdmex->GetPropulsion(); if (Propulsion == 0) return 0.0; LCreal maxFuelWt = 0.0; for (unsigned int i = 0; i < Propulsion->GetNumTanks(); i++) { JSBSim::FGTank* tank = Propulsion->GetTank(i); maxFuelWt += (LCreal)(tank->GetContents() / tank->GetPctFull() * 100.0); } return maxFuelWt; }
double JSBSimModel::getFuelWtMax() const { if (fdmex == nullptr) return 0.0; JSBSim::FGPropulsion* Propulsion = fdmex->GetPropulsion(); if (Propulsion == nullptr) return 0.0; double maxFuelWt = 0.0; for (unsigned int i = 0; i < Propulsion->GetNumTanks(); i++) { JSBSim::FGTank* tank = Propulsion->GetTank(i); maxFuelWt += static_cast<double>(tank->GetContents() / tank->GetPctFull() * 100.0); } return maxFuelWt; }