1
0
Fork 0

Speedbrake to PTS

This commit is contained in:
legoboyvdlp R 2020-07-12 14:24:16 +01:00
parent 040feca174
commit a61de8e6e9
2 changed files with 15 additions and 14 deletions

View file

@ -386,29 +386,29 @@ controls.stepSpoilers = func(step) {
}
var deploySpeedbrake = func {
if (getprop("/gear/gear[1]/wow") == 1 or getprop("/gear/gear[2]/wow") == 1) {
if (getprop("/controls/flight/speedbrake") < 1.0) {
setprop("/controls/flight/speedbrake", 1.0);
if (pts.Gear.Wow[1].getBoolValue() or pts.Gear.Wow[2].getBoolValue()) {
if (pts.Controls.Flight.speedbrake.getValue() < 1.0) {
pts.Controls.Flight.speedbrake.setValue(1.0);
}
} else {
if (getprop("/controls/flight/speedbrake") < 0.5) {
setprop("/controls/flight/speedbrake", 0.5);
} else if (getprop("/controls/flight/speedbrake") < 1.0) {
setprop("/controls/flight/speedbrake", 1.0);
if (pts.Controls.Flight.speedbrake.getValue() < 0.5) {
pts.Controls.Flight.speedbrake.setValue(0.5);
} else if (pts.Controls.Flight.speedbrake.getValue() < 1.0) {
pts.Controls.Flight.speedbrake.setValue(1.0);
}
}
}
var retractSpeedbrake = func {
if (getprop("/gear/gear[1]/wow") == 1 or getprop("/gear/gear[2]/wow") == 1) {
if (getprop("/controls/flight/speedbrake") > 0.0) {
setprop("/controls/flight/speedbrake", 0.0);
if (pts.Gear.Wow[1].getBoolValue() or pts.Gear.Wow[2].getBoolValue()) {
if (pts.Controls.Flight.speedbrake.getValue() > 0.0) {
pts.Controls.Flight.speedbrake.setValue(0.0);
}
} else {
if (getprop("/controls/flight/speedbrake") > 0.5) {
setprop("/controls/flight/speedbrake", 0.5);
} else if (getprop("/controls/flight/speedbrake") > 0.0) {
setprop("/controls/flight/speedbrake", 0.0);
if (pts.Controls.Flight.speedbrake.getValue() > 0.5) {
pts.Controls.Flight.speedbrake.setValue(0.5);
} else if (pts.Controls.Flight.speedbrake.getValue() > 0.0) {
pts.Controls.Flight.speedbrake.setValue(0.0);
}
}
}

View file

@ -32,6 +32,7 @@ var Controls = {
flaps: props.globals.getNode("/controls/flight/flaps"),
flapsTemp: 0,
flapsPos: props.globals.getNode("/controls/flight/flaps-pos"),
speedbrake: props.globals.getNode("/controls/flight/speedbrake"),
speedbrakeArm: props.globals.getNode("/controls/flight/speedbrake-arm"),
},
Gear: {