On Sunday 25 September 2011 16:46:32 Scott wrote:
> From: Scott <scott.hamil...@popplanet.biz>
> To: flightgear-devel@lists.sourceforge.net
> Subject: Re: [Flightgear-devel] latest Git next, endless loop from
> FGATCMgr and missing JSBsim fuel-used property
> Date: Mon, 26 Sep 2011 08:37:06 +1000
>
> On Sun, 2011-09-25 at 13:49 -0600, Ron Jensen wrote:
> > On Sunday 25 September 2011 01:36:25 Scott Hamilton wrote:
> > > Greetings,
> > >
> > >  I've noticed two small problems with the current Git
> > > "next" (as at 2011-09-25), is anyone else seeing these?
> > >
> > >  1. the JSBsim
> > > per-engine /fdm/jsbsim/propulsion/engine[]/fuel-used-lbs property has
> > > disappeared
> >
> > I see it in the code, and in my fgfs. It should be automatically created
> > for every JSBSim engine. What aircraft are you flying?
>
> Hi ya Ron,
>
>    I was flying the A380 and thought it was not being created as the
> A380 has a JSBsim Post function to convert it to fuel-used-kg, so I
> thought that was creating the fuel-used-lbs when reading it.
>    I then tried the 747-400 and I see fuel-used-lbs is being created as
> zero, but is not been updated, it remains at zero once you start the
> engines, so that looks like the problem, it is not being updated.
>
>    So I notice that when I did a 'git pull next' yesterday, a whole lot
> of FDM/jsbsim/propulsion changes, it was probably about 3 - 4 weeks
> prior that I did the last git pull next, when fuel-used-lbs property was
> updated correctly for each engine.
>
>
>
>    cheers
>       S.

Ah, the fuel consumption code was refactored and the mechanism for setting 
that property was removed. The attached patch, which is now in JSBSim head 
fixes the issue.

Sorry,
Ron
>From 67779f1d563d6d1661cb5295c210c6ac67ef74b4 Mon Sep 17 00:00:00 2001
From: rjensen <w...@jentronics.com>
Date: Sun, 25 Sep 2011 17:53:04 -0600
Subject: [PATCH] Make the total fuel expended counter work again.

---
 src/models/propulsion/FGPiston.cpp    |    1 +
 src/models/propulsion/FGTurbine.cpp   |    1 +
 src/models/propulsion/FGTurboProp.cpp |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/models/propulsion/FGPiston.cpp b/src/models/propulsion/FGPiston.cpp
index d055056..f8baaa8 100644
--- a/src/models/propulsion/FGPiston.cpp
+++ b/src/models/propulsion/FGPiston.cpp
@@ -481,6 +481,7 @@ void FGPiston::Calculate(void)
 double FGPiston::CalcFuelNeed(void)
 {
   FuelExpended = FuelFlowRate * in.TotalDeltaT;
+  if (!Starved) FuelUsedLbs += FuelExpended; 
   return FuelExpended;
 }
 
diff --git a/src/models/propulsion/FGTurbine.cpp b/src/models/propulsion/FGTurbine.cpp
index 5b676ed..b86bf76 100644
--- a/src/models/propulsion/FGTurbine.cpp
+++ b/src/models/propulsion/FGTurbine.cpp
@@ -385,6 +385,7 @@ double FGTurbine::CalcFuelNeed(void)
 {
   FuelFlowRate = FuelFlow_pph / 3600.0; // Calculates flow in lbs/sec from lbs/hr
   FuelExpended = FuelFlowRate * in.TotalDeltaT;     // Calculates fuel expended in this time step
+  if (!Starved) FuelUsedLbs += FuelExpended; 
   return FuelExpended;
 }
 
diff --git a/src/models/propulsion/FGTurboProp.cpp b/src/models/propulsion/FGTurboProp.cpp
index 41f7967..7def4fb 100644
--- a/src/models/propulsion/FGTurboProp.cpp
+++ b/src/models/propulsion/FGTurboProp.cpp
@@ -410,6 +410,7 @@ double FGTurboProp::CalcFuelNeed(void)
 {
   FuelFlowRate = FuelFlow_pph / 3600.0;
   FuelExpended = FuelFlowRate * in.TotalDeltaT;
+  if (!Starved) FuelUsedLbs += FuelExpended;
   return FuelExpended;
 }
 
-- 
1.7.4.4

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to