1
0
Fork 0

More PTS / getValue()

This commit is contained in:
legoboyvdlp R 2020-09-15 18:41:40 +01:00
parent c71b92da13
commit bf4f576359
6 changed files with 25 additions and 34 deletions

View file

@ -241,7 +241,7 @@ var ECAM_controller = {
me.reset();
},
loop: func() {
if ((systems.ELEC.Bus.acEss.getValue() >= 110 or systems.ELEC.Bus.ac2.getValue() >= 110) and !getprop("systems/acconfig/acconfig-running")) {
if ((systems.ELEC.Bus.acEss.getValue() >= 110 or systems.ELEC.Bus.ac2.getValue() >= 110) and !pts.Acconfig.running.getBoolValue()) {
# update FWC phases
phaseLoop();
@ -274,7 +274,7 @@ var ECAM_controller = {
# write to ECAM
var counter = 0;
if (!getprop("systems/acconfig/autoconfig-running")) {
if (!pts.Acconfig.running.getBoolValue()) {
foreach (var w; warnings.vector) {
if (w.active == 1) {
if (counter < 9) {

View file

@ -116,14 +116,14 @@ var phaseLoop = func() {
if (eng == "IAE") {
eprlim = getprop("controls/engines/epr-limit");
if ((!getprop("controls/engines/engine[0]/reverser") and !getprop("controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Output.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
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.Output.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");
if ((!getprop("controls/engines/engine[0]/reverser") and !getprop("controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Output.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
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.Output.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);

View file

@ -157,13 +157,13 @@ var FCUController = {
if (ap1.getBoolValue() or ap2.getBoolValue()) {
apOff("soft", 0);
} else {
if (getprop("it-autoflight/sound/apoffsound") == 1 or getprop("it-autoflight/sound/apoffsound2") == 1) {
setprop("it-autoflight/sound/apoffsound", 0);
setprop("it-autoflight/sound/apoffsound2", 0);
if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1) {
setprop("/it-autoflight/sound/apoffsound", 0);
setprop("/it-autoflight/sound/apoffsound2", 0);
}
if (getprop("it-autoflight/output/ap-warning") != 0) {
setprop("it-autoflight/output/ap-warning", 0);
setprop("ECAM/warnings/master-warning-light", 0);
if (getprop("/it-autoflight/output/ap-warning") != 0) {
setprop("/it-autoflight/output/ap-warning", 0);
ecam.lights[0].setValue(0);
}
}
}
@ -178,11 +178,11 @@ var FCUController = {
if (me.FCUworking) {
if (athr.getBoolValue()) {
athrOff("soft");
setprop("ECAM/warnings/master-caution-light", 1);
ecam.lights[1].setValue(1);
} else {
if (getprop("it-autoflight/output/athr-warning") == 1) {
setprop("it-autoflight/output/athr-warning", 0);
setprop("ECAM/warnings/master-caution-light", 0);
if (getprop("/it-autoflight/output/athr-warning") == 1) {
setprop("/it-autoflight/output/athr-warning", 0);
ecam.lights[1].setValue(0);
}
}
}
@ -349,7 +349,7 @@ var FCUController = {
},
ALTPush: func() {
if (me.FCUworking) {
# setprop("it-autoflight/input/vert", 8); # He don't work yet m8
# setprop("/it-autoflight/input/vert", 8); # He don't work yet m8
}
},
ALTPull: func() {
@ -523,7 +523,7 @@ var athrOff = func(type) {
var hdgInput = func {
if (latMode.getValue() != 0) {
showHDG.setBoolValue(1);
var hdgnow = getprop("it-autoflight/input/hdg");
setprop("modes/fcu/hdg-time", getprop("sim/time/elapsed-sec"));
var hdgnow = getprop("/it-autoflight/input/hdg");
setprop("/modes/fcu/hdg-time", pts.Sim.Time.elapsedSec.getValue());
}
}

View file

@ -162,7 +162,7 @@ var ELEC = {
loop: func() {
# Autopilot Disconnection routines
if (me.Bus.dcEssShed.getValue() < 25) {
if (getprop("it-autoflight/output/ap1") == 1 and !me._timer1On) {
if (fmgc.Output.ap1.getValue() and !me._timer1On) {
me._timer1On = 1;
settimer(func() {
if (me.Bus.dcEssShed.getValue() < 25) {
@ -177,7 +177,7 @@ var ELEC = {
}
if (me.Bus.dc2.getValue() < 25) {
if (getprop("it-autoflight/output/ap2") == 1 and !me._timer2On) {
if (fmgc.Output.ap2.getValue() and !me._timer2On) {
me._timer2On = 1;
settimer(func() {
if (me.Bus.dc2.getValue() < 25) {

View file

@ -3,9 +3,6 @@
# Copyright (c) 2019 Jonathan Redpath
var accum = 0;
var down = 0;
var HYD = {
Brakes: {
accumPressPsi: props.globals.initNode("/systems/hydraulic/brakes/accumulator-pressure-psi", 0, "INT"),
@ -82,10 +79,8 @@ var HYD = {
me.Fail.yellowLeak.setBoolValue(0);
},
loop: func() {
accum = me.Brakes.accumPressPsi.getValue();
if (me.Brakes.mode.getValue() == 2) {
if (me.Psi.yellow.getValue() > 2500 and accum < 700) {
if (me.Psi.yellow.getValue() > 2500 and me.Brakes.accumPressPsi.getValue() < 700) {
me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() + 50);
}
}
@ -93,8 +88,7 @@ var HYD = {
};
setlistener("/controls/gear/gear-down", func {
down = getprop("/controls/gear/gear-down");
if (!down and (getprop("gear/gear[0]/wow") or getprop("gear/gear[1]/wow") or getprop("gear/gear[2]/wow"))) {
setprop("/controls/gear/gear-down", 1);
if (!pts.Controls.Gear.gearDown.getValue() and (pts.Gear.wow[0].getValue() or pts.Gear.wow[1].getValue() or pts.Gear.wow[2].getValue())) {
pts.Controls.Gear.gearDown.setValue(1);
}
});

View file

@ -8,8 +8,7 @@ var tyresmoke_2 = aircraft.tyresmoke.new(2, 0, 0.8, 0);
# =============================== listeners ===============================
setlistener("gear/gear[0]/position-norm", func {
var gear = getprop("gear/gear[0]/position-norm");
if (gear == 1 ){
if (pts.Gear.position[0].getValue()){
run_tyresmoke0 = 1;
}else{
run_tyresmoke0 = 0;
@ -17,8 +16,7 @@ setlistener("gear/gear[0]/position-norm", func {
},1,0);
setlistener("gear/gear[1]/position-norm", func {
var gear = getprop("gear/gear[1]/position-norm");
if (gear == 1 ){
if (pts.Gear.position[1].getValue()){
run_tyresmoke1 = 1;
}else{
run_tyresmoke1 = 0;
@ -26,8 +24,7 @@ setlistener("gear/gear[1]/position-norm", func {
},1,0);
setlistener("gear/gear[2]/position-norm", func {
var gear = getprop("gear/gear[2]/position-norm");
if (gear == 1 ){
if (pts.Gear.position[2].getValue()){
run_tyresmoke2 = 1;
}else{
run_tyresmoke2 = 0;