Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
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;
}