1
0
Fork 0

FG1000: Fuel Publisher and PanDown bug-fix

Previously the GenericFuelPublisher would barf if tank contents
weren't defined properly with numbers.

Also the XML and .ac files were inconsistent in their use of PANDown
vs PanDown.

Both spotted by Mark JOSEPH (ePilot). Now fixed.
This commit is contained in:
Stuart Buchanan 2020-10-06 21:58:18 +01:00
parent d46ebde0b6
commit 5080ae8c99
17 changed files with 31 additions and 30 deletions

View file

@ -46,7 +46,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -99,7 +99,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -46,7 +46,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -99,7 +99,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -46,7 +46,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -99,7 +99,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -46,7 +46,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -99,7 +99,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -58,7 +58,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>
@ -123,7 +123,7 @@
<object-name>PANUp</object-name>
<object-name>PANLeft</object-name>
<object-name>PANRight</object-name>
<object-name>PanDown</object-name>
<object-name>PANDOWN</object-name>
<object-name>DidectTo</object-name>
<object-name>MENU</object-name>
<object-name>FPL</object-name>

View file

@ -48872,7 +48872,7 @@ refs 4
86 0.698556 0.475521
kids 0
OBJECT poly
name "PanDown"
name "PANDown"
loc 0.0025526 -0.0225207 -0.1297603
crease 61.0
texture "FG1000.png"

View file

@ -48872,7 +48872,7 @@ refs 4
86 0.698556 0.475521
kids 0
OBJECT poly
name "PanDown"
name "PANDown"
loc 0.0025553 -0.0225222 -0.1303993
crease 61.0
texture "FG1000.png"

View file

@ -48872,7 +48872,7 @@ refs 4
86 0.698556 0.475521
kids 0
OBJECT poly
name "PanDown"
name "PANDown"
loc 0.0025549 -0.0225220 -0.1303065
crease 61.0
texture "FG1000.png"

View file

@ -48872,7 +48872,7 @@ refs 4
86 0.698556 0.475521
kids 0
OBJECT poly
name "PanDown"
name "PANDown"
loc 0.0025552 -0.0225222 -0.1303819
crease 61.0
texture "FG1000.png"

View file

@ -37,6 +37,7 @@ var GenericFuelPublisher =
foreach(var tank; tanks) {
var actual = tank.getNode("level-gal_us", 1).getValue();
if ((actual == nil) or (! isnum(actual))) actual = 0;
var indicatedNode = tank.getNode("fg1000-indicated-level-gal_us", 1);
if (indicatedNode.getValue() == nil) indicatedNode.setValue(actual);
}
@ -53,9 +54,9 @@ var GenericFuelPublisher =
foreach(var tank; tanks) {
var indicatedNode = tank.getNode("fg1000-indicated-level-gal_us", 1);
var fuel = indicatedNode.getValue();
if (fuel == nil) fuel = 0;
if ((fuel == nil) or (! isnum(fuel))) fuel = 0;
var fuel_flow = getprop("/engines/engine[0]/fuel-flow-gph");
if (fuel_flow == nil) fuel_flow = 0;
if ((fuel_flow == nil) or (! isnum(fuel_flow))) fuel_flow = 0;
fuel = fuel - fuel_flow*me.deltaT/3600.0/2;
indicatedNode.setValue(fuel);
append(tank_data, {"FuelUSGal": fuel});