From 44a4f824819ec6410b5e2807f7175dbf9b71e6d1 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 16 Jan 2011 18:53:06 +0100 Subject: [PATCH] Fixed weight calculation for YASim. - Properties are below additional "weight-lb" branch. - Calculate empty weight based on lbs - not lbs/1000. --- Aircraft/Instruments-3d/cdu/boeing.nas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Aircraft/Instruments-3d/cdu/boeing.nas b/Aircraft/Instruments-3d/cdu/boeing.nas index 230ce7881..fc8bdd117 100644 --- a/Aircraft/Instruments-3d/cdu/boeing.nas +++ b/Aircraft/Instruments-3d/cdu/boeing.nas @@ -150,12 +150,12 @@ var cdu = func{ line1l = sprintf("%3.1f", (getprop("/yasim/gross-weight-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"); 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); } @@ -297,4 +297,4 @@ var cdu = func{ setprop("/instrumentation/cdu/output/line6/right-title",line6rt); settimer(cdu,0.2); } -_setlistener("/sim/signals/fdm-initialized", cdu); \ No newline at end of file +_setlistener("/sim/signals/fdm-initialized", cdu);