A3XX: FMGC: Much less buggy mode boxing
This commit is contained in:
parent
9f45cf29f2
commit
bdbb9a1718
3 changed files with 68 additions and 41 deletions
BIN
Models/Tablet/res/screen.png
Normal file
BIN
Models/Tablet/res/screen.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 629 B |
|
@ -25,6 +25,15 @@ setprop("/modes/pfd/fma/roll-mode-armed-box", 0);
|
||||||
setprop("/modes/pfd/fma/ap-mode-box", 0);
|
setprop("/modes/pfd/fma/ap-mode-box", 0);
|
||||||
setprop("/modes/pfd/fma/fd-mode-box", 0);
|
setprop("/modes/pfd/fma/fd-mode-box", 0);
|
||||||
setprop("/modes/pfd/fma/athr-mode-box", 0);
|
setprop("/modes/pfd/fma/athr-mode-box", 0);
|
||||||
|
setprop("/modes/pfd/fma/throttle-mode-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode-armed-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode2-armed-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/roll-mode-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/roll-mode-armed-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/ap-mode-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/fd-mode-time", 0);
|
||||||
|
setprop("/modes/pfd/fma/athr-mode-time", 0);
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
setlistener("sim/signals/fdm-initialized", func {
|
||||||
loopFMA.start();
|
loopFMA.start();
|
||||||
|
@ -115,6 +124,54 @@ var loopFMA = maketimer(0.05, func {
|
||||||
setprop("/modes/pfd/fma/roll-mode", "TRACK");
|
setprop("/modes/pfd/fma/roll-mode", "TRACK");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Boxes
|
||||||
|
var boxtime = getprop("/sim/time/elapsed-sec");
|
||||||
|
if (getprop("/modes/pfd/fma/ap-mode-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/ap-mode-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/ap-mode-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/fd-mode-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/fd-mode-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/fd-mode-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/athr-mode-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/athr-mode-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/athr-mode-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/throttle-mode-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/throttle-mode-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/throttle-mode-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/roll-mode-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/roll-mode-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/roll-mode-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/pitch-mode-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/roll-mode-armed-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/roll-mode-armed-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/roll-mode-armed-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/pitch-mode-armed-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode-armed-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode-armed-box", 0);
|
||||||
|
}
|
||||||
|
if (getprop("/modes/pfd/fma/pitch-mode2-armed-time") + 10 >= boxtime) {
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode2-armed-box", 1);
|
||||||
|
} else {
|
||||||
|
setprop("/modes/pfd/fma/pitch-mode2-armed-box", 0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var loopFMA_b = func {
|
var loopFMA_b = func {
|
||||||
|
@ -527,32 +584,20 @@ setlistener("/it-autoflight/output/athr", func {
|
||||||
# Boxes
|
# Boxes
|
||||||
setlistener("/modes/pfd/fma/ap-mode", func {
|
setlistener("/modes/pfd/fma/ap-mode", func {
|
||||||
if (getprop("/modes/pfd/fma/ap-mode") != " ") {
|
if (getprop("/modes/pfd/fma/ap-mode") != " ") {
|
||||||
setprop("/modes/pfd/fma/ap-mode-box", 1);
|
setprop("/modes/pfd/fma/ap-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/ap-mode-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setlistener("/modes/pfd/fma/fd-mode", func {
|
setlistener("/modes/pfd/fma/fd-mode", func {
|
||||||
if (getprop("/modes/pfd/fma/fd-mode") != " ") {
|
if (getprop("/modes/pfd/fma/fd-mode") != " ") {
|
||||||
setprop("/modes/pfd/fma/fd-mode-box", 1);
|
setprop("/modes/pfd/fma/fd-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/fd-mode-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setlistener("/modes/pfd/fma/at-mode", func {
|
setlistener("/modes/pfd/fma/at-mode", func {
|
||||||
if (getprop("/modes/pfd/fma/at-mode") != " ") {
|
if (getprop("/modes/pfd/fma/at-mode") != " ") {
|
||||||
setprop("/modes/pfd/fma/throttle-mode-box", 1);
|
setprop("/modes/pfd/fma/throttle-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
setprop("/modes/pfd/fma/athr-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||||
setprop("/modes/pfd/fma/throttle-mode-box", 0);
|
|
||||||
}, 5);
|
|
||||||
setprop("/modes/pfd/fma/athr-mode-box", 1);
|
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/athr-mode-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -560,59 +605,41 @@ setlistener("/modes/pfd/fma/throttle-mode", func {
|
||||||
var state1 = getprop("/systems/thrust/state1");
|
var state1 = getprop("/systems/thrust/state1");
|
||||||
var state2 = getprop("/systems/thrust/state2");
|
var state2 = getprop("/systems/thrust/state2");
|
||||||
if (getprop("/it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE") {
|
if (getprop("/it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE") {
|
||||||
setprop("/modes/pfd/fma/throttle-mode-box", 1);
|
setprop("/modes/pfd/fma/throttle-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/throttle-mode-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setlistener("/modes/pfd/fma/roll-mode", func {
|
setlistener("/modes/pfd/fma/roll-mode", func {
|
||||||
var newlat = getprop("/modes/pfd/fma/roll-mode");
|
var newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||||
if (newlat != " ") {
|
if (newlat != " ") {
|
||||||
setprop("/modes/pfd/fma/roll-mode-box", 1);
|
setprop("/modes/pfd/fma/roll-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/roll-mode-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setlistener("/modes/pfd/fma/pitch-mode", func {
|
setlistener("/modes/pfd/fma/pitch-mode", func {
|
||||||
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||||
if (newvert != " ") {
|
if (newvert != " ") {
|
||||||
setprop("/modes/pfd/fma/pitch-mode-box", 1);
|
setprop("/modes/pfd/fma/pitch-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/pitch-mode-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setlistener("/modes/pfd/fma/roll-mode-armed", func {
|
setlistener("/modes/pfd/fma/roll-mode-armed", func {
|
||||||
var newarm = getprop("/modes/pfd/fma/roll-mode-armed");
|
var newarm = getprop("/modes/pfd/fma/roll-mode-armed");
|
||||||
if (newarm != " ") {
|
if (newarm != " ") {
|
||||||
setprop("/modes/pfd/fma/roll-mode-armed-box", 1);
|
setprop("/modes/pfd/fma/roll-mode-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/roll-mode-armed-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setlistener("/modes/pfd/fma/pitch-mode-armed", func {
|
setlistener("/modes/pfd/fma/pitch-mode-armed", func {
|
||||||
var newarm = getprop("/modes/pfd/fma/pitch-mode-armed");
|
var newarm = getprop("/modes/pfd/fma/pitch-mode-armed");
|
||||||
if (newarm != " ") {
|
if (newarm != " ") {
|
||||||
setprop("/modes/pfd/fma/pitch-mode-armed-box", 1);
|
setprop("/modes/pfd/fma/pitch-mode-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/pitch-mode-armed-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setlistener("/modes/pfd/fma/pitch-mode2-armed", func {
|
setlistener("/modes/pfd/fma/pitch-mode2-armed", func {
|
||||||
var newarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
var newarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||||
if (newarm != " ") {
|
if (newarm != " ") {
|
||||||
setprop("/modes/pfd/fma/pitch-mode2-armed-box", 1);
|
setprop("/modes/pfd/fma/pitch-mode2-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||||
settimer(func {
|
|
||||||
setprop("/modes/pfd/fma/pitch-mode2-armed-box", 0);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
3008
|
3009
|
Reference in a new issue