1
0
Fork 0

Fixed weight calculation for YASim.

- Properties are below additional "weight-lb" branch.
- Calculate empty weight based on lbs - not lbs/1000.
This commit is contained in:
ThorstenB 2011-01-16 18:53:06 +01:00
parent 5ae5154a40
commit 44a4f82481

View file

@ -150,12 +150,12 @@ var cdu = func{
line1l = sprintf("%3.1f", (getprop("/yasim/gross-weight-lbs")/1000)); line1l = sprintf("%3.1f", (getprop("/yasim/gross-weight-lbs")/1000));
line2l = sprintf("%3.1f", (getprop("/consumables/fuel/total-fuel-lbs")/1000)); line2l = sprintf("%3.1f", (getprop("/consumables/fuel/total-fuel-lbs")/1000));
yasim_emptyweight = line1l; yasim_emptyweight = getprop("/yasim/gross-weight-lbs");
yasim_emptyweight -= getprop("/consumables/fuel/total-fuel-lbs");
yasim_weights = props.globals.getNode("/sim").getChildren("weight"); yasim_weights = props.globals.getNode("/sim").getChildren("weight");
for (i = 0; i < size(yasim_weights); i += 1) { for (i = 0; i < size(yasim_weights); i += 1) {
yasim_emptyweight -= yasim_weights[i].getValue(); yasim_emptyweight -= yasim_weights[i].getChild("weight-lb").getValue();
} }
yasim_emptyweight -= line2l;
line3l = sprintf("%3.1f", yasim_emptyweight/1000); line3l = sprintf("%3.1f", yasim_emptyweight/1000);
} }