1
0
Fork 0

PFD: fix the agl indication rounding; remove rateApply old code

This commit is contained in:
legoboyvdlp R 2021-09-14 12:55:33 +01:00
parent 2bf25e5399
commit ac324d064a
3 changed files with 10 additions and 14 deletions
AircraftConfig
Models/Instruments/PFD

View file

@ -60,11 +60,7 @@ setprop("/systems/acconfig/options/welcome-skip", 0);
setprop("/systems/acconfig/options/no-rendering-warn", 0); setprop("/systems/acconfig/options/no-rendering-warn", 0);
setprop("/systems/acconfig/options/save-state", 0); setprop("/systems/acconfig/options/save-state", 0);
setprop("/systems/acconfig/options/seperate-tiller-axis", 0); setprop("/systems/acconfig/options/seperate-tiller-axis", 0);
setprop("/systems/acconfig/options/pfd-rate", 1);
setprop("/systems/acconfig/options/nd-rate", 1); setprop("/systems/acconfig/options/nd-rate", 1);
setprop("/systems/acconfig/options/uecam-rate", 1);
setprop("/systems/acconfig/options/lecam-rate", 1);
setprop("/systems/acconfig/options/iesi-rate", 1);
setprop("/systems/acconfig/options/autopush/show-route", 1); setprop("/systems/acconfig/options/autopush/show-route", 1);
setprop("/systems/acconfig/options/autopush/show-wingtip", 1); setprop("/systems/acconfig/options/autopush/show-wingtip", 1);
var main_dlg = gui.Dialog.new("/sim/gui/dialogs/acconfig/main/dialog", "Aircraft/A320-family/AircraftConfig/main.xml"); var main_dlg = gui.Dialog.new("/sim/gui/dialogs/acconfig/main/dialog", "Aircraft/A320-family/AircraftConfig/main.xml");

View file

@ -25,9 +25,7 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
acconfig.writeSettings(); acconfig.writeSettings();
canvas_pfd.rateApply();
canvas_nd.rateApply(); canvas_nd.rateApply();
canvas_ecam.l_rateApply();
</script> </script>
</binding> </binding>
<binding> <binding>
@ -221,9 +219,7 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
acconfig.writeSettings(); acconfig.writeSettings();
canvas_pfd.rateApply();
canvas_nd.rateApply(); canvas_nd.rateApply();
canvas_ecam.l_rateApply();
</script> </script>
</binding> </binding>
</button> </button>
@ -235,9 +231,7 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
acconfig.writeSettings(); acconfig.writeSettings();
canvas_pfd.rateApply();
canvas_nd.rateApply(); canvas_nd.rateApply();
canvas_ecam.l_rateApply();
</script> </script>
</binding> </binding>
<binding> <binding>

View file

@ -230,8 +230,14 @@ var canvas_pfd = {
obj["FD_pitch"].setTranslation(0, val * -3.8); obj["FD_pitch"].setTranslation(0, val * -3.8);
}), }),
props.UpdateManager.FromHashValue("agl", nil, func(val) { props.UpdateManager.FromHashValue("agl", nil, func(val) {
obj["AI_agl"].setText(sprintf("%s", math.round(math.clamp(val, 0, 2500)))); if (val >= 50) {
obj["AI_agl"].setText(sprintf("%s", math.round(math.clamp(val, 0, 2500),10)));
} else if (val >= 5) {
obj["AI_agl"].setText(sprintf("%s", math.round(math.clamp(val, 0, 2500),5)));
} else {
obj["AI_agl"].setText(sprintf("%s", math.round(math.clamp(val, 0, 2500))));
}
if (-val >= -565 and -val <= 565) { if (-val >= -565 and -val <= 565) {
obj["ground_ref"].setTranslation(0, (-val / 100) * -48.66856); obj["ground_ref"].setTranslation(0, (-val / 100) * -48.66856);
obj["ground_ref"].show(); obj["ground_ref"].show();
@ -242,7 +248,7 @@ var canvas_pfd = {
props.UpdateManager.FromHashList(["agl","gear1Wow", "gear2Wow","fmgcPhase"], nil, func(val) { props.UpdateManager.FromHashList(["agl","gear1Wow", "gear2Wow","fmgcPhase"], nil, func(val) {
if (-val.agl >= -565 and -val.agl <= 565) { if (-val.agl >= -565 and -val.agl <= 565) {
if ((val.fmgcPhase == 5 or val.fmgcPhase == 6) and !val.gear1Wow and !val.gear2Wow) { # TODO: add std too if ((val.fmgcPhase == 5 or val.fmgcPhase == 6) and !val.gear1Wow and !val.gear2Wow) { # TODO: add std too
obj["ground"].setTranslation(0, (-val / 100) * -48.66856); obj["ground"].setTranslation(0, (-val.agl / 100) * -48.66856);
obj["ground"].show(); obj["ground"].show();
} else { } else {
obj["ground"].hide(); obj["ground"].hide();
@ -911,7 +917,7 @@ var canvas_pfd = {
if (me.aoa == nil or (systems.ADIRS.ADIRunits[(me.number == 0 ? 0 : 1)].operating != 1) or (systems.ADIRS.ADIRunits[2].operating != 1 and notification.attSwitch == (me.number == 0 ? -1 : 1))){ if (me.aoa == nil or (systems.ADIRS.ADIRunits[(me.number == 0 ? 0 : 1)].operating != 1) or (systems.ADIRS.ADIRunits[2].operating != 1 and notification.attSwitch == (me.number == 0 ? -1 : 1))){
me["FPV"].hide(); me["FPV"].hide();
} else { } else {
me.AI_fpv_trans.setTranslation(me.getTrackDiffPixels(me.track_diff), math.clamp(me.aoa, -20, 20) * 12.5); me.AI_fpv_trans.setTranslation(math.clamp(me.getTrackDiffPixels(me.track_diff), -21, 21), math.clamp(me.aoa, -20, 20) * 12.5);
me.AI_fpv_rot.setRotation(-notification.roll * D2R, me["AI_center"].getCenter()); me.AI_fpv_rot.setRotation(-notification.roll * D2R, me["AI_center"].getCenter());
me["FPV"].setRotation(notification.roll * D2R); # It shouldn't be rotated, only the axis should be me["FPV"].setRotation(notification.roll * D2R); # It shouldn't be rotated, only the axis should be
me["FPV"].show(); me["FPV"].show();