1
0
Fork 0
A320-family/Nasal/Sim/property-tree-setup.nas

151 lines
4.5 KiB
Text
Raw Normal View History

2019-10-29 15:19:43 +00:00
# A320 Property Tree Setup
# Copyright (c) 2019 Joshua Davidson (Octal450)
# Modified by Jonathan Redpath for A320
# Nodes organized like property tree, except when lots of identical (example: Gear wow), where vectors are used to make it easier
# Anything that says Temp is set by another file to avoid multiple getValue calls
# Usage Example: pts.Class.SubClass.node.getValue()
2019-11-19 18:04:01 +00:00
var APU = {
2020-02-07 16:10:54 +00:00
masterSw: props.globals.getNode("controls/APU/master"),
rpm: props.globals.getNode("systems/apu/rpm"),
2019-11-19 18:04:01 +00:00
};
var Consumables = {
Fuel: {
2020-02-07 16:10:54 +00:00
totalFuelLbs: props.globals.getNode("consumables/fuel/total-fuel-lbs"),
},
};
2019-10-29 15:19:43 +00:00
var Controls = {
Engines: {
2020-02-07 16:10:54 +00:00
startSw: props.globals.getNode("controls/engines/engine-start-switch"),
2019-10-29 15:19:43 +00:00
Engine1: {
2020-02-07 16:10:54 +00:00
cutoffSw: props.globals.getNode("controls/engines/engine[0]/cutoff-switch"),
firePb: props.globals.getNode("controls/engines/engine[0]/fire-btn"),
throttle: props.globals.getNode("controls/engines/engine[0]/throttle"),
2019-10-29 15:19:43 +00:00
},
Engine2: {
2020-02-07 16:10:54 +00:00
cutoffSw: props.globals.getNode("controls/engines/engine[1]/cutoff-switch"),
firePb: props.globals.getNode("controls/engines/engine[1]/fire-btn"),
throttle: props.globals.getNode("controls/engines/engine[1]/throttle"),
2019-10-29 15:19:43 +00:00
},
},
Flight: {
2020-02-07 16:10:54 +00:00
aileron: props.globals.getNode("controls/flight/aileron"),
},
2019-11-19 18:04:01 +00:00
Gear: {
2020-02-07 16:10:54 +00:00
gearDown: props.globals.getNode("controls/gear/gear-down"),
2019-11-19 18:04:01 +00:00
},
2019-10-29 15:19:43 +00:00
};
var ECAM = {
fwcWarningPhase: props.globals.initNode("/ECAM/warning-phase", 1, "INT"),
};
var Engines = {
Engine1: {
2020-02-07 16:10:54 +00:00
epractual: props.globals.getNode("engines/engine[0]/epr-actual"),
n1actual: props.globals.getNode("engines/engine[0]/n1-actual"),
n2actual: props.globals.getNode("engines/engine[0]/n2-actual"),
state: props.globals.getNode("engines/engine[0]/state"),
2019-10-29 15:19:43 +00:00
},
Engine2: {
2020-02-07 16:10:54 +00:00
epractual: props.globals.getNode("engines/engine[1]/epr-actual"),
n1actual: props.globals.getNode("engines/engine[1]/n1-actual"),
n2actual: props.globals.getNode("engines/engine[1]/n2-actual"),
state: props.globals.getNode("engines/engine[1]/state"),
2019-10-29 15:19:43 +00:00
},
};
var FMGC = {
CasCompare: {
2020-02-07 16:10:54 +00:00
rejectAll: props.globals.getNode("systems/fmgc/cas-compare/cas-reject-all"),
},
};
2019-10-29 15:19:43 +00:00
var Gear = {
2020-02-07 16:10:54 +00:00
compression: [props.globals.getNode("gear/gear[0]/compression-norm"),props.globals.getNode("gear/gear[1]/compression-norm"),props.globals.getNode("gear/gear[2]/compression-norm")],
wow: [props.globals.getNode("gear/gear[0]/wow"),props.globals.getNode("gear/gear[1]/wow"),props.globals.getNode("gear/gear[2]/wow")],
position: [props.globals.getNode("gear/gear[0]/position-norm"),props.globals.getNode("gear/gear[1]/position-norm"),props.globals.getNode("gear/gear[2]/position-norm")],
2019-10-29 15:19:43 +00:00
};
var Instrumentation = {
AirspeedIndicator: {
2020-02-07 16:10:54 +00:00
indicatedSpdKt: props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt"),
2019-10-29 15:19:43 +00:00
},
2020-04-08 21:49:27 +00:00
Altimeter: {
indicatedFt: props.globals.getNode("instrumentation/altimeter[0]/indicated-altitude-ft"),
},
TCAS: {
Inputs: {
2020-02-07 16:10:54 +00:00
mode: props.globals.getNode("instrumentation/tcas/inputs/mode"),
},
},
2019-10-29 15:19:43 +00:00
};
var JSBSIM = {
FCS: {
2020-02-07 16:10:54 +00:00
flapDeg: props.globals.getNode("fdm/jsbsim/fcs/flap-pos-deg"),
slatDeg: props.globals.getNode("fdm/jsbsim/fcs/slat-pos-deg"),
},
};
2019-11-08 18:22:29 +00:00
var JSBSim = {
2019-11-19 18:04:01 +00:00
FBW: {
2020-02-07 16:10:54 +00:00
aileron: props.globals.getNode("fdm/jsbsim/fbw/aileron-sidestick"),
elevator: props.globals.getNode("fdm/jsbsim/fbw/elevator-sidestick"),
2019-11-19 18:04:01 +00:00
},
2019-11-08 18:22:29 +00:00
Propulsion: {
Engine1: {
2020-02-07 16:10:54 +00:00
fuelUsed: props.globals.getNode("fdm/jsbsim/propulsion/engine[0]/fuel-used-lbs"),
2019-11-08 18:22:29 +00:00
},
Engine2: {
2020-02-07 16:10:54 +00:00
fuelUsed: props.globals.getNode("fdm/jsbsim/propulsion/engine[1]/fuel-used-lbs"),
2019-11-08 18:22:29 +00:00
},
},
};
2020-03-17 13:08:07 +00:00
var Modes = {
Altimeter: {
std: props.globals.getNode("modes/altimeter/std"),
},
};
2019-10-29 15:19:43 +00:00
var Options = {
2020-02-07 16:10:54 +00:00
eng: props.globals.getNode("options/eng"),
2019-10-29 15:19:43 +00:00
};
2019-12-08 19:51:37 +00:00
var Orientation = {
2020-02-07 16:10:54 +00:00
pitch: props.globals.getNode("orientation/pitch-deg"),
roll: props.globals.getNode("orientation/roll-deg"),
yaw: props.globals.getNode("orientation/yaw-deg"),
2019-12-08 19:51:37 +00:00
};
2019-10-29 15:19:43 +00:00
var Position = {
2020-02-07 16:10:54 +00:00
gearAglFt: props.globals.getNode("position/gear-agl-ft"),
latitude: props.globals.getNode("position/latitude-deg"),
longitude: props.globals.getNode("position/longitude-deg"),
2019-10-29 15:19:43 +00:00
};
var Sim = {
2020-02-07 16:10:54 +00:00
aero: props.globals.getNode("sim/aero"),
2019-10-31 18:57:19 +00:00
Replay: {
2020-02-07 16:10:54 +00:00
replayActive: props.globals.getNode("sim/replay/replay-state"),
2019-10-31 18:57:19 +00:00
},
2019-10-29 15:19:43 +00:00
Time: {
2020-02-07 16:10:54 +00:00
elapsedSec: props.globals.getNode("sim/time/elapsed-sec"),
2019-10-29 15:19:43 +00:00
},
};
2019-10-31 18:57:19 +00:00
var PTSSystems = {
Thrust: {
2020-02-07 16:10:54 +00:00
flex: props.globals.getNode("systems/thrust/lim-flex"),
2019-10-31 18:57:19 +00:00
},
};
2019-12-08 19:51:37 +00:00
var Velocities = {
2020-02-07 16:10:54 +00:00
groundspeed: props.globals.getNode("velocities/groundspeed-kt"),
2019-12-08 19:51:37 +00:00
};
2020-02-07 16:10:54 +00:00
setprop("systems/acconfig/property-tree-setup-loaded", 1);