1
0
Fork 0

Formatting

This commit is contained in:
legoboyvdlp R 2020-10-04 15:23:37 +01:00
parent 2b6e1520e3
commit 23dabc4b67
25 changed files with 267 additions and 267 deletions

View file

@ -26,7 +26,7 @@ var _unitconv = M2FT / 3.6;
var _debug = nil;
var _loop = func() {
if (!getprop("sim/model/autopush/available")) {
if (!getprop("/sim/model/autopush/available")) {
_stop();
return;
}
@ -37,9 +37,9 @@ var _loop = func() {
# Rollspeed is only adequate if the wheel is touching the ground.
if (getprop("gear/gear[0]/wow")) {
var V = getprop("gear/gear[0]/rollspeed-ms") * 3.6;
var deltaV = getprop("sim/model/autopush/target-speed-km_h") - V;
var deltaV = getprop("/sim/model/autopush/target-speed-km_h") - V;
var minus_dV = _V - V;
var time = getprop("sim/time/elapsed-sec");
var time = getprop("/sim/time/elapsed-sec");
var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p);
var dt = time - _time;
var deriv = 0.0;
@ -63,24 +63,24 @@ var _loop = func() {
} else {
force = accel * getprop("fdm/yasim/gross-weight-lbs") * _unitconv;
}
var pitch = getprop("sim/model/autopush/pitch-deg") * D2R;
var pitch = getprop("/sim/model/autopush/pitch-deg") * D2R;
z = math.sin(pitch);
var pz = math.cos(pitch);
var yaw = getprop("sim/model/autopush/yaw") * _K_yaw;
var yaw = getprop("/sim/model/autopush/yaw") * _K_yaw;
x = math.cos(yaw) * pz;
y = math.sin(yaw) * pz;
setprop("sim/model/autopush/force-x", x);
setprop("sim/model/autopush/force-y", y);
setprop("/sim/model/autopush/force-x", x);
setprop("/sim/model/autopush/force-y", y);
# JSBSim force's z is down.
setprop("sim/model/autopush/force-z", -z);
setprop("/sim/model/autopush/force-z", -z);
}
setprop("sim/model/autopush/force-lbf", force);
setprop("/sim/model/autopush/force-lbf", force);
if (_yasim) {
# The force is divided by YASim thrust="100000.0" setting.
setprop("sim/model/autopush/force-x-yasim", x * force * 0.00001);
setprop("/sim/model/autopush/force-x-yasim", x * force * 0.00001);
# YASim force's y is to the left.
setprop("sim/model/autopush/force-y-yasim", -y * force * 0.00001);
setprop("sim/model/autopush/force-z-yasim", z * force * 0.00001);
setprop("/sim/model/autopush/force-y-yasim", -y * force * 0.00001);
setprop("/sim/model/autopush/force-z-yasim", z * force * 0.00001);
}
}
@ -89,26 +89,26 @@ var _timer = maketimer(0.0167, func{_loop()});
var _start = func() {
# Else overwritten by dialog.
settimer(func() {
setprop("sim/model/autopush/target-speed-km_h", 0.0)
setprop("/sim/model/autopush/target-speed-km_h", 0.0)
}, 0.1);
_K_p = getprop("sim/model/autopush/K_p");
_F_p = getprop("sim/model/autopush/F_p");
_K_i = getprop("sim/model/autopush/K_i");
_F_i = getprop("sim/model/autopush/F_i");
_K_d = getprop("sim/model/autopush/K_d");
_F_d = getprop("sim/model/autopush/F_d");
_F = getprop("sim/model/autopush/F");
_T_f = getprop("sim/model/autopush/T_f");
_K_yaw = getprop("sim/model/autopush/yaw-mult") * D2R;
_yasim = (getprop("sim/flight-model") == "yasim");
_debug = getprop("sim/model/autopush/debug") or 0;
_K_p = getprop("/sim/model/autopush/K_p");
_F_p = getprop("/sim/model/autopush/F_p");
_K_i = getprop("/sim/model/autopush/K_i");
_F_i = getprop("/sim/model/autopush/F_i");
_K_d = getprop("/sim/model/autopush/K_d");
_F_d = getprop("/sim/model/autopush/F_d");
_F = getprop("/sim/model/autopush/F");
_T_f = getprop("/sim/model/autopush/T_f");
_K_yaw = getprop("/sim/model/autopush/yaw-mult") * D2R;
_yasim = (getprop("/sim/flight-model") == "yasim");
_debug = getprop("/sim/model/autopush/debug") or 0;
_int = 0.0;
_V = 0.0;
_time = getprop("sim/time/elapsed-sec");
setprop("sim/model/autopush/connected", 1);
_time = getprop("/sim/time/elapsed-sec");
setprop("/sim/model/autopush/connected", 1);
if (!_timer.isRunning) {
if (getprop("sim/model/autopush/chocks")) {
setprop("sim/model/autopush/chocks", 0);
if (getprop("/sim/model/autopush/chocks")) {
setprop("/sim/model/autopush/chocks", 0);
screen.log.write("(pushback): Pushback connected, chocks removed. Please release brakes.");
} else {
screen.log.write("(pushback): Pushback connected, please release brakes.");
@ -122,18 +122,18 @@ var _stop = func() {
screen.log.write("(pushback): Pushback and bypass pin removed.");
}
_timer.stop();
setprop("sim/model/autopush/force-lbf", 0.0);
setprop("/sim/model/autopush/force-lbf", 0.0);
if (_yasim) {
setprop("sim/model/autopush/force-x-yasim", 0.0);
setprop("sim/model/autopush/force-y-yasim", 0.0);
setprop("/sim/model/autopush/force-x-yasim", 0.0);
setprop("/sim/model/autopush/force-y-yasim", 0.0);
}
setprop("sim/model/autopush/connected", 0);
setprop("sim/model/autopush/enabled", 0);
setprop("/sim/model/autopush/connected", 0);
setprop("/sim/model/autopush/enabled", 0);
}
setlistener("/sim/model/autopush/enabled", func(p) {
var enabled = p.getValue();
if ((enabled) and getprop("sim/model/autopush/available")) {
if ((enabled) and getprop("/sim/model/autopush/available")) {
_start();
} else {
_stop();

View file

@ -46,7 +46,7 @@ var _advance_wp = func(flip_sign = 0) {
}
var _loop = func() {
if (!getprop("sim/model/autopush/connected")) {
if (!getprop("/sim/model/autopush/connected")) {
stop();
return;
}
@ -56,7 +56,7 @@ var _loop = func() {
var deltapsi = geo.normdeg180(A - psi_leg);
var psi = getprop("orientation/heading-deg") + _push * 180.0;
var deltaA = math.min(math.max(_K_psi * geo.normdeg180(A - psi), -_F_psi), _F_psi);
var time = getprop("sim/time/elapsed-sec");
var time = getprop("/sim/time/elapsed-sec");
var dt = time - _time;
var minus_psidot = (dt > 0.002) * math.min(math.max(_K_psidot * (_psi - psi) / dt, -_F_psidot), _F_psidot);
_psi = psi;
@ -83,8 +83,8 @@ var _loop = func() {
if (_debug > 1) {
print("autopush_driver to_wp " ~ _to_wp ~ ", A " ~ geo.normdeg(A) ~ ", deltaA " ~ deltaA ~ ", minus_psidot " ~ minus_psidot);
}
setprop("sim/model/autopush/target-speed-km_h", _sign * V);
setprop("sim/model/autopush/steer-cmd-norm", steering);
setprop("/sim/model/autopush/target-speed-km_h", _sign * V);
setprop("/sim/model/autopush/steer-cmd-norm", steering);
}
var _timer = maketimer(0.051, func{_loop()});
@ -100,7 +100,7 @@ var start = func() {
gui.popupTip("Already moving");
return;
}
if (!getprop("sim/model/autopush/connected")) {
if (!getprop("/sim/model/autopush/connected")) {
gui.popupTip("Pushback not connected");
return;
}
@ -112,15 +112,15 @@ var start = func() {
} else {
autopush_route.done();
}
_K_V = getprop("sim/model/autopush/driver/K_V");
_F_V = getprop("sim/model/autopush/driver/F_V");
_R_turn_min = getprop("sim/model/autopush/min-turn-radius-m");
_D_stop = getprop("sim/model/autopush/stopping-distance-m");
_K_psi = getprop("sim/model/autopush/driver/K_psi");
_F_psi = getprop("sim/model/autopush/driver/F_psi");
_K_psidot = getprop("sim/model/autopush/driver/K_psidot");
_F_psidot = getprop("sim/model/autopush/driver/F_psidot");
_debug = getprop("sim/model/autopush/debug") or 0;
_K_V = getprop("/sim/model/autopush/driver/K_V");
_F_V = getprop("/sim/model/autopush/driver/F_V");
_R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m");
_D_stop = getprop("/sim/model/autopush/stopping-distance-m");
_K_psi = getprop("/sim/model/autopush/driver/K_psi");
_F_psi = getprop("/sim/model/autopush/driver/F_psi");
_K_psidot = getprop("/sim/model/autopush/driver/K_psidot");
_F_psidot = getprop("/sim/model/autopush/driver/F_psidot");
_debug = getprop("/sim/model/autopush/debug") or 0;
if (!_to_wp) {
var (psi_park, D_park) = courseAndDistance(_route[0], _route[1]);
_push = (abs(geo.normdeg180(getprop("orientation/heading-deg") - psi_park)) > 90.0);
@ -128,7 +128,7 @@ var start = func() {
_advance_wp();
_psi = 0.0;
}
_time = getprop("sim/time/elapsed-sec");
_time = getprop("/sim/time/elapsed-sec");
_timer.start();
var endsign = _sign;
for (ii = _to_wp; ii < size(_route_reverse); ii += 1) {
@ -146,7 +146,7 @@ var start = func() {
var pause = func() {
_timer.stop();
setprop("sim/model/autopush/target-speed-km_h", 0.0);
setprop("/sim/model/autopush/target-speed-km_h", 0.0);
}
var stop = func() {

View file

@ -29,7 +29,7 @@ var _R_turn_min = 0;
var _invalid = 0;
# Make top-down view point north in old FG.
var __fg_version = num(string.replace(getprop("sim/version/flightgear"),".",""));
var __fg_version = num(string.replace(getprop("/sim/version/flightgear"),".",""));
if (__fg_version < 201920) {
_top_view_heading_offset_deg = 94.5;
}
@ -144,14 +144,14 @@ var top_view = func() {
return;
}
_top_view_index = view.indexof("Chase View Without Yaw");
_reset_view_index = getprop("sim/current-view/view-number");
setprop("sim/current-view/view-number", _top_view_index);
_view_pitch_offset_deg = getprop("sim/current-view/pitch-offset-deg");
_view_heading_offset_deg = getprop("sim/current-view/heading-offset-deg");
_view_z_offset = getprop("sim/current-view/z-offset-m");
setprop("sim/current-view/z-offset-m", -500.0);
setprop("sim/current-view/heading-offset-deg", _top_view_heading_offset_deg);
setprop("sim/current-view/pitch-offset-deg", 90.0);
_reset_view_index = getprop("/sim/current-view/view-number");
setprop("/sim/current-view/view-number", _top_view_index);
_view_pitch_offset_deg = getprop("/sim/current-view/pitch-offset-deg");
_view_heading_offset_deg = getprop("/sim/current-view/heading-offset-deg");
_view_z_offset = getprop("/sim/current-view/z-offset-m");
setprop("/sim/current-view/z-offset-m", -500.0);
setprop("/sim/current-view/heading-offset-deg", _top_view_heading_offset_deg);
setprop("/sim/current-view/pitch-offset-deg", 90.0);
_view_listener = setlistener("/sim/current-view/name", func {
_finalize_top_view();
}, 0, 0);
@ -164,11 +164,11 @@ var _finalize_top_view = func() {
removelistener(_view_listener);
_view_listener = nil;
# Go back to the view to restore settings, in case user has switched away.
setprop("sim/current-view/view-number", _top_view_index);
setprop("sim/current-view/z-offset-m", _view_z_offset);
setprop("sim/current-view/heading-offset-deg", _view_heading_offset_deg);
setprop("sim/current-view/pitch-offset-deg", _view_pitch_offset_deg);
setprop("sim/current-view/view-number", _reset_view_index);
setprop("/sim/current-view/view-number", _top_view_index);
setprop("/sim/current-view/z-offset-m", _view_z_offset);
setprop("/sim/current-view/heading-offset-deg", _view_heading_offset_deg);
setprop("/sim/current-view/pitch-offset-deg", _view_pitch_offset_deg);
setprop("/sim/current-view/view-number", _reset_view_index);
if (!_show) {
_clear_user_point_models();
_clear_waypoint_models();
@ -330,7 +330,7 @@ var _check_turn_radius = func() {
}
}
setprop("sim/model/autopush/route/invalid", _invalid);
setprop("/sim/model/autopush/route/invalid", _invalid);
}
setlistener("/sim/model/autopush/route/show", func(p) {
@ -351,7 +351,7 @@ setlistener("/sim/model/autopush/route/show", func(p) {
var enter = func() {
clear();
top_view();
_R_turn_min = getprop("sim/model/autopush/min-turn-radius-m");
_R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m");
var wp = geo.aircraft_position();
var H = geo.elevation(wp.lat(), wp.lon());
if (H != nil) {
@ -362,7 +362,7 @@ var enter = func() {
_add(geo.click_position());
});
# This property can be overridden manually, if needed.
var wingspan = getprop("sim/model/autopush/route/wingspan-m");
var wingspan = getprop("/sim/model/autopush/route/wingspan-m");
if ((wingspan == nil) or (wingspan == 0.0)) {
# JSBSim
wingspan = getprop("fdm/jsbsim/metrics/bw-ft");
@ -372,7 +372,7 @@ var enter = func() {
# YAsim
wingspan = getprop("fdm/yasim/model/wings/wing/wing-span");
}
setprop("sim/model/autopush/route/wingspan-m", wingspan);
setprop("/sim/model/autopush/route/wingspan-m", wingspan);
}
}

View file

@ -10,12 +10,12 @@ var DMC = {
new: func(num) {
var d = { parents:[DMC] };
d.activeADIRS = num;
d.airspeeds = [props.globals.getNode("systems/navigation/adr/output/cas-1", 1), props.globals.getNode("systems/navigation/adr/output/cas-2", 1), props.globals.getNode("systems/navigation/adr/output/cas-3", 1)];
d.altitudes = [props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)];
d.machs = [props.globals.getNode("systems/navigation/adr/output/mach-1", 1), props.globals.getNode("systems/navigation/adr/output/mach-2", 1), props.globals.getNode("systems/navigation/adr/output/mach-3", 1)];
d.airspeeds = [props.globals.getNode("/systems/navigation/adr/output/cas-1", 1), props.globals.getNode("/systems/navigation/adr/output/cas-2", 1), props.globals.getNode("/systems/navigation/adr/output/cas-3", 1)];
d.altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)];
d.machs = [props.globals.getNode("/systems/navigation/adr/output/mach-1", 1), props.globals.getNode("/systems/navigation/adr/output/mach-2", 1), props.globals.getNode("/systems/navigation/adr/output/mach-3", 1)];
d.altitudesPfd = [props.globals.getNode("instrumentation/altimeter[0]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[1]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[2]/indicated-altitude-ft-pfd", 1)];
d.sats = [props.globals.getNode("systems/navigation/adr/output/sat-1", 1), props.globals.getNode("systems/navigation/adr/output/sat-2", 1), props.globals.getNode("systems/navigation/adr/output/sat-3", 1)];
d.tats = [props.globals.getNode("systems/navigation/adr/output/tat-1", 1), props.globals.getNode("systems/navigation/adr/output/tat-2", 1), props.globals.getNode("systems/navigation/adr/output/tat-3", 1)];
d.sats = [props.globals.getNode("/systems/navigation/adr/output/sat-1", 1), props.globals.getNode("/systems/navigation/adr/output/sat-2", 1), props.globals.getNode("/systems/navigation/adr/output/sat-3", 1)];
d.tats = [props.globals.getNode("/systems/navigation/adr/output/tat-1", 1), props.globals.getNode("/systems/navigation/adr/output/tat-2", 1), props.globals.getNode("/systems/navigation/adr/output/tat-3", 1)];
d.trends = [props.globals.getNode("instrumentation/pfd/speed-lookahead-1", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-2", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-3", 1)];
d.outputs = [nil, nil, nil, nil, nil, nil, nil]; # airspeed, altitude, mach, pfd altitude, sat, tat, speed trend
return d;
@ -70,7 +70,7 @@ var DMController = {
me.DMCs = [DMC.new(0), DMC.new(1), DMC.new(2)];
# update DMC2 to correct properties for first officer PFD
me.DMCs[1].altitudes = [props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)];
me.DMCs[1].altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)];
me.DMCs[1].altitudesPfd = [props.globals.getNode("instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)];
me._init = 1;

View file

@ -12,7 +12,7 @@ var leftOverflow = props.globals.initNode("/ECAM/warnings/overflow-left", 0, "B
var rightOverflow = props.globals.initNode("/ECAM/warnings/overflow-right", 0, "BOOL");
var overflow = props.globals.initNode("/ECAM/warnings/overflow", 0, "BOOL");
var dc_ess = props.globals.getNode("systems/electrical/bus/dc-ess", 1);
var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1);
var lights = [props.globals.initNode("/ECAM/warnings/master-warning-light", 0, "BOOL"), props.globals.initNode("/ECAM/warnings/master-caution-light", 0, "BOOL")];
var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL")];

View file

@ -808,13 +808,13 @@ var messages_priority_3 = func {
if (FWC.Timer.gnd.getValue() != 1 and (FWC.Monostable.altAlert1Output.getValue() or bigThree)) {
if (!getprop("/sim/sound/warnings/cchord-inhibit")) {
setprop("sim/sound/warnings/cchord", 1);
setprop("/sim/sound/warnings/cchord", 1);
} else {
setprop("sim/sound/warnings/cchord", 0);
setprop("/sim/sound/warnings/cchord", 0);
}
} else {
setprop("sim/sound/warnings/cchord", 0);
setprop("sim/sound/warnings/cchord-inhibit", 0);
setprop("/sim/sound/warnings/cchord", 0);
setprop("/sim/sound/warnings/cchord-inhibit", 0);
}
if (FWC.Timer.gnd.getValue() != 1 and getprop("/ECAM/flipflop/alt-alert-3-rs-set") != 1 and alt750 and !alt200 and !altAlertInhibit) {

View file

@ -40,7 +40,7 @@ var clrLight = 0;
var ECAM = {
_cachePage: "",
init: func() {
setprop("systems/gear/landing-gear-warning-light", 0);
setprop("/systems/gear/landing-gear-warning-light", 0);
page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING");
apuLight = props.globals.initNode("/ECAM/Lower/light/apu", 0, "BOOL");
bleedLight = props.globals.initNode("/ECAM/Lower/light/bleed", 0, "BOOL");

View file

@ -115,14 +115,14 @@ var phaseLoop = func() {
}
if (eng == "IAE") {
eprlim = getprop("controls/engines/epr-limit");
eprlim = getprop("/controls/engines/epr-limit");
if ((!pts.Controls.Engines.Engine.reverser[0].getBoolValue() and !pts.Controls.Engines.Engine.reverser[1].getBoolValue()) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Thrust.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
FWC.toPower.setBoolValue(1);
} else {
FWC.toPower.setBoolValue(0);
}
} else {
n1lim = getprop("controls/engines/n1-limit");
n1lim = getprop("/controls/engines/n1-limit");
if ((!pts.Controls.Engines.Engine.reverser[0].getBoolValue() and !pts.Controls.Engines.Engine.reverser[1].getBoolValue()) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Thrust.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
FWC.toPower.setBoolValue(1);
} else {

View file

@ -120,7 +120,7 @@ var PitotIcing = [props.globals.getNode("/systems/pitot[0]/icing"),props.globals
var PitotServicable = [props.globals.getNode("/systems/pitot[0]/serviceable", 1),props.globals.getNode("/systems/pitot[1]/serviceable", 1),props.globals.getNode("/systems/pitot[2]/serviceable"), 1];
var icingInit = func {
iceables = props.globals.getNode("sim/model/icing", 1).getChildren("iceable");
iceables = props.globals.getNode("/sim/model/icing", 1).getChildren("iceable");
forindex(var i; iceables) {
iceables[i] = Iceable.new(iceables[i]);
}

View file

@ -3,7 +3,7 @@
# Thanks to BAWV12 / Thorsten
var als_on = props.globals.getNode("sim/rendering/shaders/skydome");
var als_on = props.globals.getNode("/sim/rendering/shaders/skydome");
var alt_agl = props.globals.getNode("position/gear-agl-ft");
var cur_alt = 0;
@ -67,30 +67,30 @@ var light_manager = {
flcpt: 0,
prev_view : 1,
nd_ref_light1_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m", 1),
nd_ref_light1_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m", 1),
nd_ref_light1_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m", 1),
nd_ref_light1_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir", 1),
nd_ref_light1_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m", 1),
nd_ref_light1_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m", 1),
nd_ref_light1_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m", 1),
nd_ref_light1_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir", 1),
nd_ref_light2_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]", 1),
nd_ref_light2_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]", 1),
nd_ref_light2_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]", 1),
nd_ref_light2_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[1]", 1),
nd_ref_light2_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]", 1),
nd_ref_light2_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]", 1),
nd_ref_light2_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]", 1),
nd_ref_light2_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[1]", 1),
nd_ref_light3_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]", 1),
nd_ref_light3_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]", 1),
nd_ref_light3_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]", 1),
nd_ref_light3_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[2]", 1),
nd_ref_light3_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]", 1),
nd_ref_light3_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]", 1),
nd_ref_light3_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]", 1),
nd_ref_light3_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[2]", 1),
nd_ref_light4_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[3]", 1),
nd_ref_light4_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[3]", 1),
nd_ref_light4_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[3]", 1),
nd_ref_light4_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[3]", 1),
nd_ref_light4_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[3]", 1),
nd_ref_light4_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[3]", 1),
nd_ref_light4_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[3]", 1),
nd_ref_light4_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[3]", 1),
nd_ref_light5_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[4]", 1),
nd_ref_light5_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[4]", 1),
nd_ref_light5_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[4]", 1),
nd_ref_light5_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[4]", 1),
nd_ref_light5_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[4]", 1),
nd_ref_light5_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[4]", 1),
nd_ref_light5_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[4]", 1),
nd_ref_light5_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[4]", 1),
init: func {
# define your lights here
@ -146,22 +146,22 @@ var light_manager = {
me.light5_size = 5;
setprop("sim/rendering/als-secondary-lights/flash-radius", 13);
setprop("/sim/rendering/als-secondary-lights/flash-radius", 13);
me.start();
},
start: func {
setprop("sim/rendering/als-secondary-lights/num-lightspots", 5);
setprop("/sim/rendering/als-secondary-lights/num-lightspots", 5);
setprop("sim/rendering/als-secondary-lights/lightspot/size", me.light1_size);
setprop("sim/rendering/als-secondary-lights/lightspot/size[1]", me.light2_size);
setprop("sim/rendering/als-secondary-lights/lightspot/size[2]", me.light3_size);
setprop("sim/rendering/als-secondary-lights/lightspot/size[3]", me.light4_size);
setprop("sim/rendering/als-secondary-lights/lightspot/size[4]", me.light5_size);
setprop("/sim/rendering/als-secondary-lights/lightspot/size", me.light1_size);
setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", me.light2_size);
setprop("/sim/rendering/als-secondary-lights/lightspot/size[2]", me.light3_size);
setprop("/sim/rendering/als-secondary-lights/lightspot/size[3]", me.light4_size);
setprop("/sim/rendering/als-secondary-lights/lightspot/size[4]", me.light5_size);
setprop("sim/rendering/als-secondary-lights/lightspot/stretch", me.light1_stretch);
setprop("sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch);
setprop("/sim/rendering/als-secondary-lights/lightspot/stretch", me.light1_stretch);
setprop("/sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch);
me.run = 1;
me.update();
@ -178,10 +178,10 @@ var light_manager = {
cur_alt = alt_agl.getValue();
if (als_on.getValue() == 1 and alt_agl.getValue() < 100.0) {
ll1 = getprop("controls/lighting/landing-lights[1]");
ll2 = getprop("controls/lighting/landing-lights[2]");
ll3 = getprop("sim/model/lights/nose-lights");
nav = getprop("sim/model/lights/nav-lights");
ll1 = getprop("/controls/lighting/landing-lights[1]");
ll2 = getprop("/controls/lighting/landing-lights[2]");
ll3 = getprop("/sim/model/lights/nose-lights");
nav = getprop("/sim/model/lights/nav-lights");
var apos = geo.aircraft_position();
var vpos = geo.viewer_position();
@ -320,89 +320,89 @@ var light_manager = {
light1_on : func {
if (me.light1_is_on == 1) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r", me.light1_r);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g", me.light1_g);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b", me.light1_b);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r", me.light1_r);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g", me.light1_g);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b", me.light1_b);
me.light1_is_on = 1;
},
light1_off : func {
if (me.light1_is_on == 0) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b", 0.0);
me.light1_is_on = 0;
},
light1_setSize : func(size) {
setprop("sim/rendering/als-secondary-lights/lightspot/size[0]", size);
setprop("/sim/rendering/als-secondary-lights/lightspot/size[0]", size);
},
light2_on : func {
if (me.light2_is_on == 1) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", me.light2_r);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", me.light2_g);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", me.light2_b);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", me.light2_r);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", me.light2_g);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", me.light2_b);
me.light2_is_on = 1;
},
light2_off : func {
if (me.light2_is_on == 0) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", 0.0);
me.light2_is_on = 0;
},
light2_setSize : func(size) {
setprop("sim/rendering/als-secondary-lights/lightspot/size[1]", size);
setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", size);
},
light3_on : func {
if (me.light3_is_on == 1) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", me.light3_r);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", me.light3_g);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", me.light3_b);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", me.light3_r);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", me.light3_g);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", me.light3_b);
me.light3_is_on = 1;
},
light3_off : func {
if (me.light3_is_on == 0) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", 0.0);
me.light3_is_on = 0;
},
light4_on : func {
if (me.light4_is_on == 1) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light4_r);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light4_g);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light4_b);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light4_r);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light4_g);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light4_b);
me.light4_is_on = 1;
},
light4_off : func {
if (me.light4_is_on == 0) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", 0.0);
me.light4_is_on = 0;
},
light5_on : func {
if (me.light5_is_on == 1) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", me.light5_r);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", me.light5_g);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", me.light5_b);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", me.light5_r);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", me.light5_g);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", me.light5_b);
me.light5_is_on = 1;
},
light5_off : func {
if (me.light5_is_on == 0) {return;}
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", 0.0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", 0.0);
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", 0.0);
me.light5_is_on = 0;
},
};

View file

@ -38,26 +38,26 @@ var thunder_listener = func {
var lightning_distance_norm = std.min(1.0, 1 / math.pow(lightning_distance / 5000.0, 2));
settimer(func {
var thunder1 = getprop("sim/sound/thunder1");
var thunder2 = getprop("sim/sound/thunder2");
var thunder3 = getprop("sim/sound/thunder3");
var thunder4 = getprop("sim/sound/thunder4");
var vol = getprop("sim/current-view/internal");
var thunder1 = getprop("/sim/sound/thunder1");
var thunder2 = getprop("/sim/sound/thunder2");
var thunder3 = getprop("/sim/sound/thunder3");
var thunder4 = getprop("/sim/sound/thunder4");
var vol = getprop("/sim/current-view/internal");
if (!thunder1) {
thunderCalls = 1;
setprop("sim/sound/dist-thunder1", lightning_distance_norm * vol * 1.75);
setprop("/sim/sound/dist-thunder1", lightning_distance_norm * vol * 1.75);
}
else if (!thunder2) {
thunderCalls = 2;
setprop("sim/sound/dist-thunder2", lightning_distance_norm * vol * 1.75);
setprop("/sim/sound/dist-thunder2", lightning_distance_norm * vol * 1.75);
}
else if (!thunder3) {
thunderCalls = 3;
setprop("sim/sound/dist-thunder3", lightning_distance_norm * vol * 1.75);
setprop("/sim/sound/dist-thunder3", lightning_distance_norm * vol * 1.75);
}
else if (!thunder4) {
thunderCalls = 4;
setprop("sim/sound/dist-thunder4", lightning_distance_norm * vol * 1.75);
setprop("/sim/sound/dist-thunder4", lightning_distance_norm * vol * 1.75);
}
else
return;

View file

@ -659,33 +659,33 @@ var masterFMGC = maketimer(0.2, func {
if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 and FMGCInternal.phase == 1) { # rejected takeoff
FMGCInternal.phase = 0;
setprop("systems/pressurization/mode", "GN");
setprop("/systems/pressurization/mode", "GN");
}
if (gear0 and FMGCInternal.phase == 0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) {
FMGCInternal.phase = 1;
setprop("systems/pressurization/mode", "TO");
setprop("/systems/pressurization/mode", "TO");
}
if (FMGCInternal.phase == 1 and ((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) {
FMGCInternal.phase = 2;
setprop("systems/pressurization/mode", "TO");
setprop("/systems/pressurization/mode", "TO");
}
if (FMGCInternal.phase == 2 and (mode == "ALT CRZ" or mode == "ALT CRZ*")) {
FMGCInternal.phase = 3;
setprop("systems/pressurization/mode", "CR");
setprop("/systems/pressurization/mode", "CR");
}
if (FMGCInternal.crzFl >= 200) {
if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < 20000)) {
FMGCInternal.phase = 4;
setprop("systems/pressurization/mode", "DE");
setprop("/systems/pressurization/mode", "DE");
}
} else {
if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < (FMGCInternal.crzFl * 100))) { # todo - not sure about crzFl condition, investigate what happens!
FMGCInternal.phase = 4;
setprop("systems/pressurization/mode", "DE");
setprop("/systems/pressurization/mode", "DE");
}
}
@ -701,7 +701,7 @@ var masterFMGC = maketimer(0.2, func {
if ((FMGCInternal.phase == 5) and state1 == "TOGA" and state2 == "TOGA") {
FMGCInternal.phase = 6;
setprop("systems/pressurization/mode", "TO");
setprop("/systems/pressurization/mode", "TO");
setprop("/it-autoflight/input/toga", 1);
}
@ -1012,23 +1012,23 @@ var reset_FMGC = func {
setprop("it-autoflight/input/kts", spd);
setprop("it-autoflight/input/hdg", hdg);
setprop("it-autoflight/input/alt", alt);
setprop("systems/pressurization/mode", "GN");
setprop("systems/pressurization/vs", "0");
setprop("systems/pressurization/targetvs", "0");
setprop("systems/pressurization/vs-norm", "0");
setprop("systems/pressurization/auto", 1);
setprop("systems/pressurization/deltap", "0");
setprop("systems/pressurization/outflowpos", "0");
setprop("systems/pressurization/deltap-norm", "0");
setprop("systems/pressurization/outflowpos-norm", "0");
setprop("/systems/pressurization/mode", "GN");
setprop("/systems/pressurization/vs", "0");
setprop("/systems/pressurization/targetvs", "0");
setprop("/systems/pressurization/vs-norm", "0");
setprop("/systems/pressurization/auto", 1);
setprop("/systems/pressurization/deltap", "0");
setprop("/systems/pressurization/outflowpos", "0");
setprop("/systems/pressurization/deltap-norm", "0");
setprop("/systems/pressurization/outflowpos-norm", "0");
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
setprop("systems/pressurization/cabinalt", altitude);
setprop("systems/pressurization/targetalt", altitude);
setprop("systems/pressurization/diff-to-target", "0");
setprop("systems/pressurization/ditchingpb", 0);
setprop("systems/pressurization/targetvs", "0");
setprop("systems/pressurization/ambientpsi", "0");
setprop("systems/pressurization/cabinpsi", "0");
setprop("/systems/pressurization/cabinalt", altitude);
setprop("/systems/pressurization/targetalt", altitude);
setprop("/systems/pressurization/diff-to-target", "0");
setprop("/systems/pressurization/ditchingpb", 0);
setprop("/systems/pressurization/targetvs", "0");
setprop("/systems/pressurization/ambientpsi", "0");
setprop("/systems/pressurization/cabinpsi", "0");
mcdu.ReceivedMessagesDatabase.clearDatabase();
}

View file

@ -50,7 +50,7 @@ setlistener("/sim/sounde/btn1", func {
return;
}
settimer(func {
props.globals.getNode("sim/sounde/btn1").setBoolValue(0);
props.globals.getNode("/sim/sounde/btn1").setBoolValue(0);
}, 0.05);
});
@ -59,7 +59,7 @@ setlistener("/sim/sounde/oh-btn", func {
return;
}
settimer(func {
props.globals.getNode("sim/sounde/oh-btn").setBoolValue(0);
props.globals.getNode("/sim/sounde/oh-btn").setBoolValue(0);
}, 0.05);
});
@ -68,7 +68,7 @@ setlistener("/sim/sounde/btn3", func {
return;
}
settimer(func {
props.globals.getNode("sim/sounde/btn3").setBoolValue(0);
props.globals.getNode("/sim/sounde/btn3").setBoolValue(0);
}, 0.05);
});
@ -77,7 +77,7 @@ setlistener("/sim/sounde/knb1", func {
return;
}
settimer(func {
props.globals.getNode("sim/sounde/knb1").setBoolValue(0);
props.globals.getNode("/sim/sounde/knb1").setBoolValue(0);
}, 0.05);
});
@ -86,21 +86,21 @@ setlistener("/sim/sounde/switch1", func {
return;
}
settimer(func {
props.globals.getNode("sim/sounde/switch1").setBoolValue(0);
props.globals.getNode("/sim/sounde/switch1").setBoolValue(0);
}, 0.05);
});
setlistener("/controls/lighting/seatbelt-sign", func {
props.globals.getNode("sim/sounde/seatbelt-sign").setBoolValue(1);
props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(1);
settimer(func {
props.globals.getNode("sim/sounde/seatbelt-sign").setBoolValue(0);
props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(0);
}, 2);
}, 0, 0);
setlistener("/controls/lighting/no-smoking-sign", func {
props.globals.getNode("sim/sounde/no-smoking-sign").setBoolValue(1);
props.globals.getNode("/sim/sounde/no-smoking-sign").setBoolValue(1);
settimer(func {
props.globals.getNode("sim/sounde/no-smoking-sign").setBoolValue(0);
props.globals.getNode("/sim/sounde/no-smoking-sign").setBoolValue(0);
}, 1);
}, 0, 0);

View file

@ -11,16 +11,16 @@ var incStep = 1;
var viewName = "XX";
var fovZoom = func(d) {
viewName = getprop("sim/current-view/name");
canChangeZOffset = getprop("sim/current-view/type") == "lookat" and viewName != "Tower View" and viewName != "Tower View AGL" and viewName != "Fly-By View" and viewName != "Chase View" and viewName != "Chase View Without Yaw" and viewName != "Walk View" and viewName != "Walker Orbit View";
viewName = getprop("/sim/current-view/name");
canChangeZOffset = getprop("/sim/current-view/type") == "lookat" and viewName != "Tower View" and viewName != "Tower View AGL" and viewName != "Fly-By View" and viewName != "Chase View" and viewName != "Chase View Without Yaw" and viewName != "Walk View" and viewName != "Walker Orbit View";
if (getprop("sim/current-view/z-offset-m") <= -20) {
if (getprop("/sim/current-view/z-offset-m") <= -20) {
decStep = -2;
} else {
decStep = -1;
}
if (getprop("sim/current-view/z-offset-m") < -20) { # Not a typo, the conditions are different
if (getprop("/sim/current-view/z-offset-m") < -20) { # Not a typo, the conditions are different
incStep = 2;
} else {
incStep = 1;
@ -28,11 +28,11 @@ var fovZoom = func(d) {
if (d == -1) {
if (canChangeZOffset) {
distance = getprop("sim/current-view/z-offset-m");
min_dist = getprop("sim/current-view/z-offset-min-m");
distance = getprop("/sim/current-view/z-offset-m");
min_dist = getprop("/sim/current-view/z-offset-min-m");
distance = math.round(std.min(-min_dist, distance + incStep) / incStep, 0.1) * incStep;
setprop("sim/current-view/z-offset-m", distance);
setprop("/sim/current-view/z-offset-m", distance);
gui.popupTip(sprintf("%d meters", abs(distance)));
} else {
@ -40,11 +40,11 @@ var fovZoom = func(d) {
}
} else if (d == 1) {
if (canChangeZOffset) {
distance = getprop("sim/current-view/z-offset-m");
max_dist = getprop("sim/current-view/z-offset-max-m");
distance = getprop("/sim/current-view/z-offset-m");
max_dist = getprop("/sim/current-view/z-offset-max-m");
distance = math.round(std.max(-max_dist, distance + decStep) / decStep, 0.1) * decStep;
setprop("sim/current-view/z-offset-m", distance);
setprop("/sim/current-view/z-offset-m", distance);
gui.popupTip(sprintf("%d meters", abs(distance)));
} else {
@ -52,11 +52,11 @@ var fovZoom = func(d) {
}
} else if (d == 0) {
if (canChangeZOffset) {
setprop("sim/current-view/z-offset-m", getprop("sim/current-view/z-offset-default") * -1);
gui.popupTip(sprintf("%d meters", getprop("sim/current-view/z-offset-default")));
setprop("/sim/current-view/z-offset-m", getprop("/sim/current-view/z-offset-default") * -1);
gui.popupTip(sprintf("%d meters", getprop("/sim/current-view/z-offset-default")));
} else {
setprop("sim/current-view/field-of-view", getprop("sim/view/config/default-field-of-view-deg"));
gui.popupTip(sprintf("FOV: %.1f", getprop("sim/current-view/field-of-view")))
setprop("/sim/current-view/field-of-view", getprop("/sim/view/config/default-field-of-view-deg"));
gui.popupTip(sprintf("FOV: %.1f", getprop("/sim/current-view/field-of-view")))
}
}
}

View file

@ -82,17 +82,17 @@ var initInputIRS = func(key, i) {
} else if (key == "R6") {
setprop("FMGC/internal/align-ref-lat-edit", 0);
setprop("FMGC/internal/align-ref-long-edit", 0);
if (fmgc.FMGCInternal.toFromSet and getprop("systems/navigation/adr/any-adr-on") == 1) {
if (fmgc.FMGCInternal.toFromSet and getprop("/systems/navigation/adr/any-adr-on") == 1) {
if (getprop("FMGC/internal/align-set") == 0) {
setprop("FMGC/internal/align-set", 1);
} else {
setprop("controls/adirs/mcducbtn", 1);
setprop("/controls/adirs/mcducbtn", 1);
setprop("FMGC/internal/align-set", 0);
setprop("MCDU[" ~ i ~ "]/page", "INITA");
}
} else if (!fmgc.FMGCInternal.toFromSet) {
# setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT REFERENCE");
} else if (getprop("systems/navigation/adr/any-adr-on") == 0) {
} else if (getprop("/systems/navigation/adr/any-adr-on") == 0) {
# setprop("MCDU[" ~ i ~ "]/scratchpad", "IRS NOT ALIGNED");
} else {
mcdu_message(i, "NOT ALLOWED");

View file

@ -6,7 +6,7 @@ var perfGAInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L5") {
if (scratchpad == "CLR") {
setprop("systems/thrust/clbreduc-ft", 1500);
setprop("/systems/thrust/clbreduc-ft", 1500);
setprop("/FMGC/internal/accel-agl-ft", 1500);
setprop("MCDUC/thracc-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
@ -17,7 +17,7 @@ var perfGAInput = func(key, i) {
var thrred = size(thracc[0]);
var acc = size(thracc[1]);
if (int(thrred) != nil and int(acc) != nil and (thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
setprop("systems/thrust/clbreduc-ft", thracc[0]);
setprop("/systems/thrust/clbreduc-ft", thracc[0]);
setprop("/FMGC/internal/accel-agl-ft", thracc[1]);
setprop("MCDUC/thracc-set", 1);
mcdu_scratchpad.scratchpads[i].empty();

View file

@ -100,7 +100,7 @@ var perfTOInput = func(key, i) {
}
} else if (key == "L5") {
if (scratchpad == "CLR") {
setprop("systems/thrust/clbreduc-ft", 1500);
setprop("/systems/thrust/clbreduc-ft", 1500);
setprop("/FMGC/internal/accel-agl-ft", 1500);
setprop("MCDUC/thracc-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
@ -113,7 +113,7 @@ var perfTOInput = func(key, i) {
var acc = thracc[1];
var accs = size(acc);
if (int(thrred) != nil and (thrreds >= 3 and thrreds <= 5) and thrred >= 400 and thrred <= 39000 and int(acc) != nil and (accs == 3 or accs == 4 or accs == 5) and acc >= 400 and acc <= 39000) {
setprop("systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
setprop("MCDUC/thracc-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
@ -124,7 +124,7 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
} else if (num(scratchpad) != nil and (tfs >= 3 and tfs <= 5) and scratchpad >= 400 and scratchpad <= 39000) {
setprop("systems/thrust/clbreduc-ft", int(scratchpad / 10) * 10);
setprop("/systems/thrust/clbreduc-ft", int(scratchpad / 10) * 10);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");

View file

@ -4,7 +4,7 @@
var radnavInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (!getprop("systems/radio/rmp[0]/nav") and !getprop("systems/radio/rmp[1]/nav")) {
if (!getprop("/systems/radio/rmp[0]/nav") and !getprop("/systems/radio/rmp[1]/nav")) {
if (key == "L1") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor1freq-set", 0);

View file

@ -5,9 +5,9 @@
var SwitchingPanel = {
Switches: {
attHdg: props.globals.getNode("controls/navigation/switching/att-hdg"),
airData: props.globals.getNode("controls/navigation/switching/air-data"),
eisDmc: props.globals.getNode("controls/navigation/switching/eis-dmc"),
attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"),
airData: props.globals.getNode("/controls/navigation/switching/air-data"),
eisDmc: props.globals.getNode("/controls/navigation/switching/eis-dmc"),
},
doAirData: func(newAirData) {

View file

@ -32,7 +32,7 @@ var init = func() {
}
var update_com1 = func() {
if (getprop("systems/acconfig/options/fo-view") == 1) {
if (getprop("/systems/acconfig/options/fo-view") == 1) {
if (vhf1_fo_recive.getValue()) {
com1_volume.setValue(vhf1_fo_volume.getValue());
} else {
@ -48,7 +48,7 @@ var update_com1 = func() {
}
var update_com2 = func() {
if (getprop("systems/acconfig/options/fo-view") == 1) {
if (getprop("/systems/acconfig/options/fo-view") == 1) {
if (vhf2_fo_recive.getValue()) {
com2_volume.setValue(vhf2_fo_volume.getValue());
} else {

View file

@ -6,7 +6,7 @@
var idCode = props.globals.getNode("instrumentation/transponder/id-code", 1);
var guiModes = ['OFF', 'STANDBY', 'TEST', 'GROUND', 'ON', 'ALTITUDE'];
var guiNode = props.globals.getNode("sim/gui/dialogs/radios/transponder-mode", 1);
var guiNode = props.globals.getNode("/sim/gui/dialogs/radios/transponder-mode", 1);
var forLoopFlag = 0;
var altimeter = props.globals.initNode("/instrumentation/transponder/altimeter-input-src", 0, "INT");
@ -24,10 +24,10 @@ var Transponder = {
serviceableNode: props.globals.getNode("instrumentation/transponder/serviceable", 1),
knobNode: props.globals.getNode("instrumentation/transponder/inputs/knob-mode", 1),
identNode: props.globals.getNode("instrumentation/transponder/inputs/ident-btn", 1),
ac1Node: props.globals.getNode("systems/electrical/bus/ac-1", 1),
ac1Node: props.globals.getNode("/systems/electrical/bus/ac-1", 1),
tcasNode: props.globals.getNode("instrumentation/tcas/inputs/mode"),
aglNode: props.globals.getNode("position/gear-agl-ft", 1),
electricNode: props.globals.getNode("systems/electrical/outputs/transponder", 1), # communicate to generic systems
electricNode: props.globals.getNode("/systems/electrical/outputs/transponder", 1), # communicate to generic systems
new: func(elecSrc, ADIRS) {
var t = {parents:[Transponder]};
t.mode = 1;
@ -145,7 +145,7 @@ var transponderPanel = {
failLight: 0,
clearFlag: 0,
keypad: func(keyNum) {
if (props.globals.getNode("controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("systems/electrical/bus/dc-ess", 1).getValue() < 25) {
if (props.globals.getNode("/controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("/systems/electrical/bus/dc-ess", 1).getValue() < 25) {
return;
}
if (keyNum < 0 or keyNum > 7) {
@ -163,7 +163,7 @@ var transponderPanel = {
}
},
clearKey: func() {
if (props.globals.getNode("controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("systems/electrical/bus/dc-ess", 1).getValue() < 25) {
if (props.globals.getNode("/controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("/systems/electrical/bus/dc-ess", 1).getValue() < 25) {
return;
}
if (me.codeDisp != "") {
@ -215,7 +215,7 @@ var transponderPanel = {
return;
}
me.failLight = newFail;
props.globals.getNode("systems/atc/failed").setBoolValue(me.failLight);
props.globals.getNode("/systems/atc/failed").setBoolValue(me.failLight);
},
identSwitch: func() {
Transponders.vector[me.atcSel - 1].ident();

View file

@ -395,23 +395,23 @@ var update_chan_sel = func(rmp_no) {
var transfer = func(rmp_no) {
rmp_no = rmp_no - 1;
var sel_chan = getprop("systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan");
var sel_crs = getprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs");
var sel_chan = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan");
var sel_crs = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs");
if (string.match(sel_chan, "vhf[1-3]")) {
var mod1 = int(string.replace(sel_chan, "vhf", ""));
var mod = mod1 - 1;
var mem = getprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz");
setprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz", getprop("systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby", mem);
setprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz", getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby"));
setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby", mem);
} elsif (string.match(sel_chan, "hf[1-2]")) {
var mod1 = int(string.replace(sel_chan, "hf", ""));
var mod = mod1 - 1;
var mem = systems.HFS[mod].selectedChannelKhz;
systems.HFS[mod].selectChannel(getprop("systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby", mem);
systems.HFS[mod].selectChannel(getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby"));
setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby", mem);
} elsif (sel_chan == "adf") {
var mem = getprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/selected-khz");
setprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/selected-khz", getprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/standby-khz"));
@ -420,21 +420,21 @@ var transfer = func(rmp_no) {
} elsif (sel_chan == "vor") {
if (sel_crs) {
setprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/standby-mhz", getprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/selected-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0);
setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0);
update_displays_nav(rmp_no + 3);
} else {
setprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/selected-mhz", getprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/standby-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1);
setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1);
update_displays_nav(rmp_no + 3);
}
} elsif (sel_chan == "ls") {
if (sel_crs) {
setprop("instrumentation/nav[0]/frequencies/standby-mhz", getprop("instrumentation/nav[0]/frequencies/selected-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0);
setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0);
update_displays_nav(1);
} else {
setprop("instrumentation/nav[0]/frequencies/selected-mhz", getprop("instrumentation/nav[0]/frequencies/standby-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1);
setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1);
update_displays_nav(1);
}
}

View file

@ -152,20 +152,20 @@ var ELEC = {
},
},
Switch: {
acEssFeed: props.globals.getNode("controls/electrical/switches/ac-ess-feed"),
busTie: props.globals.getNode("controls/electrical/switches/bus-tie"),
bat1: props.globals.getNode("controls/electrical/switches/bat-1"),
bat2: props.globals.getNode("controls/electrical/switches/bat-2"),
emerGenTest: props.globals.getNode("controls/electrical/switches/emer-gen-test"),
extPwr: props.globals.getNode("controls/electrical/switches/ext-pwr"),
galley: props.globals.getNode("controls/electrical/switches/galley"),
gen1: props.globals.getNode("controls/electrical/switches/gen-1"),
gen2: props.globals.getNode("controls/electrical/switches/gen-2"),
genApu: props.globals.getNode("controls/electrical/switches/apu"),
gen1Line: props.globals.getNode("controls/electrical/switches/gen-1-line-contactor"),
idg1Disc: props.globals.getNode("controls/electrical/switches/idg-1-disc"),
idg2Disc: props.globals.getNode("controls/electrical/switches/idg-2-disc"),
emerElecManOn: props.globals.getNode("controls/electrical/switches/emer-elec-man-on"), # non-reset
acEssFeed: props.globals.getNode("/controls/electrical/switches/ac-ess-feed"),
busTie: props.globals.getNode("/controls/electrical/switches/bus-tie"),
bat1: props.globals.getNode("/controls/electrical/switches/bat-1"),
bat2: props.globals.getNode("/controls/electrical/switches/bat-2"),
emerGenTest: props.globals.getNode("/controls/electrical/switches/emer-gen-test"),
extPwr: props.globals.getNode("/controls/electrical/switches/ext-pwr"),
galley: props.globals.getNode("/controls/electrical/switches/galley"),
gen1: props.globals.getNode("/controls/electrical/switches/gen-1"),
gen2: props.globals.getNode("/controls/electrical/switches/gen-2"),
genApu: props.globals.getNode("/controls/electrical/switches/apu"),
gen1Line: props.globals.getNode("/controls/electrical/switches/gen-1-line-contactor"),
idg1Disc: props.globals.getNode("/controls/electrical/switches/idg-1-disc"),
idg2Disc: props.globals.getNode("/controls/electrical/switches/idg-2-disc"),
emerElecManOn: props.globals.getNode("/controls/electrical/switches/emer-elec-man-on"), # non-reset
},
init: func() {
me.resetFail();

View file

@ -11,31 +11,31 @@ var ground_services = {
me.ice_time = 0;
# Catering Truck
setprop("services/catering/scissor-deg", 0);
setprop("services/catering/position-norm", 0);
setprop("/services/catering/scissor-deg", 0);
setprop("/services/catering/position-norm", 0);
# De-icing Truck
setprop("services/deicing_truck/enable", 0);
setprop("services/deicing_truck/de-ice", 0);
setprop("/services/deicing_truck/enable", 0);
setprop("/services/deicing_truck/de-ice", 0);
# Set them all to 0 if the aircraft is not stationary
if (getprop("velocities/groundspeed-kt") >= 2) {
setprop("services/chocks/enable", 0);
setprop("services/fuel-truck/enable", 0);
setprop("services/deicing_truck/enable", 0);
setprop("services/catering/enable", 0);
setprop("/services/chocks/enable", 0);
setprop("/services/fuel-truck/enable", 0);
setprop("/services/deicing_truck/enable", 0);
setprop("/services/catering/enable", 0);
}
me.reset();
},
update : func {
# Catering Truck Controls
var cater_pos = getprop("services/catering/position-norm");
var cater_pos = getprop("/services/catering/position-norm");
var scissor_deg = 3.325 * (1/D2R) * math.asin(cater_pos / (2 * 3.6612));
setprop("services/catering/scissor-deg", scissor_deg);
setprop("/services/catering/scissor-deg", scissor_deg);
# De-icing Truck
if (getprop("services/deicing_truck/enable") and getprop("services/deicing_truck/de-ice")) {
if (getprop("/services/deicing_truck/enable") and getprop("/services/deicing_truck/de-ice")) {
if (me.ice_time == 2) {
door.move(1);
ground_message ("Lifting De-icing Crane...");
@ -58,7 +58,7 @@ var ground_services = {
if (me.ice_time == 900) {
ground_message("De-icing Completed!", 1, 1, 1);
setprop("services/deicing_truck/de-ice", 0);
setprop("/services/deicing_truck/de-ice", 0);
}
} else {
@ -79,7 +79,7 @@ var ground_services = {
};
var ground_message = func (string) {
setprop("sim/messages/ground", string);
setprop("/sim/messages/ground", string);
}
setlistener("sim/signals/fdm-initialized", func {

View file

@ -3,13 +3,13 @@
var fuelSvc = {
_needCenter: 0,
enable: props.globals.getNode("services/fuel-truck/enable"),
connect: props.globals.getNode("services/fuel-truck/connect"),
operate: props.globals.getNode("services/fuel-truck/operate"),
enable: props.globals.getNode("/services/fuel-truck/enable"),
connect: props.globals.getNode("/services/fuel-truck/connect"),
operate: props.globals.getNode("/services/fuel-truck/operate"),
Nodes: {
requestLbs: props.globals.getNode("services/fuel-truck/request-lbs"),
requestTotalLbs: props.globals.getNode("services/fuel-truck/request-total-lbs"),
requestFuelLbs: props.globals.initNode("services/fuel-truck/fuel-on-board-at-request", pts.Consumables.Fuel.totalFuelLbs.getValue(), "DOUBLE"),
requestLbs: props.globals.getNode("/services/fuel-truck/request-lbs"),
requestTotalLbs: props.globals.getNode("/services/fuel-truck/request-total-lbs"),
requestFuelLbs: props.globals.initNode("/services/fuel-truck/fuel-on-board-at-request", pts.Consumables.Fuel.totalFuelLbs.getValue(), "DOUBLE"),
},
newRequest: func() {