diff --git a/Aircraft/Instruments-3d/cdu/README b/Aircraft/Instruments-3d/cdu/README index e9e958e57..684673ba5 100644 --- a/Aircraft/Instruments-3d/cdu/README +++ b/Aircraft/Instruments-3d/cdu/README @@ -22,7 +22,7 @@ Add the following tags below the </sim> tag of your aircraft's -set.xml file. </config> <display>IDENT</display> <ident> - <type>747-400</type> + <model>747-400</model> <engines>-80C2B1F</engines> </ident> <input type="string"/> @@ -48,4 +48,4 @@ Each single CDU unit must be set in your aircraft's model .xml file, like: Currently there are two textures to choose from: - boeing_brown.png - - boeing_grey.png \ No newline at end of file + - boeing_grey.png diff --git a/Aircraft/Instruments-3d/cdu/boeing.nas b/Aircraft/Instruments-3d/cdu/boeing.nas index 8619157d6..e19df6a4c 100644 --- a/Aircraft/Instruments-3d/cdu/boeing.nas +++ b/Aircraft/Instruments-3d/cdu/boeing.nas @@ -103,14 +103,29 @@ var cdu = func{ if (page == "PERF_INIT") { title = "PERF INIT"; line1lt = "GR WT"; - line1l = sprintf("%3.1f", (getprop("/fdm/jsbsim/inertia/weight-lbs")/1000)); line1rt = "CRZ ALT"; line2lt = "FUEL"; - line2l = sprintf("%3.1f", (getprop("/fdm/jsbsim/propulsion/total-fuel-lbs")/1000)); line3lt = "ZFW"; - line3l = sprintf("%3.1f", (getprop("/fdm/jsbsim/inertia/empty-weight-lbs")/1000)); line6l = "<INDEX"; line6r = "THRUST LIM>"; + if (getprop("/sim/flight-model") == "jsb") { + line1l = sprintf("%3.1f", (getprop("/fdm/jsbsim/inertia/weight-lbs")/1000)); + line2l = sprintf("%3.1f", (getprop("/fdm/jsbsim/propulsion/total-fuel-lbs")/1000)); + line3l = sprintf("%3.1f", (getprop("/fdm/jsbsim/inertia/empty-weight-lbs")/1000)); + } + elsif (getprop("/sim/flight-model") == "yasim") { + 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_weights = props.globals.getNode("/sim").getChildren("weight"); + for (i = 0; i < size(yasim_weights); i += 1) { + yasim_emptyweight -= yasim_weights[i].getValue(); + } + yasim_emptyweight -= line2l; + + line3l = sprintf("%3.1f", yasim_emptyweight/1000); + } } if (page == "POS_INIT") { title = "POS INIT"; @@ -204,4 +219,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);