PFD: fix bug where it would desync RHS PFD
This commit is contained in:
parent
bc5e48d80a
commit
366c8e4d4c
4 changed files with 103 additions and 10 deletions
|
@ -134,7 +134,6 @@ var adr_3_fault = props.globals.getNode("/controls/navigation/adirscp/lights/adr
|
||||||
var air_data_switch = props.globals.getNode("/controls/navigation/switching/air-data", 1);
|
var air_data_switch = props.globals.getNode("/controls/navigation/switching/air-data", 1);
|
||||||
|
|
||||||
# Create Nodes:
|
# Create Nodes:
|
||||||
var alt_diff = props.globals.initNode("/instrumentation/pfd/alt-diff", 0.0, "DOUBLE");
|
|
||||||
var heading = props.globals.initNode("/instrumentation/pfd/heading-deg", 0.0, "DOUBLE");
|
var heading = props.globals.initNode("/instrumentation/pfd/heading-deg", 0.0, "DOUBLE");
|
||||||
var horizon_pitch = props.globals.initNode("/instrumentation/pfd/horizon-pitch", 0.0, "DOUBLE");
|
var horizon_pitch = props.globals.initNode("/instrumentation/pfd/horizon-pitch", 0.0, "DOUBLE");
|
||||||
var horizon_ground = props.globals.initNode("/instrumentation/pfd/horizon-ground", 0.0, "DOUBLE");
|
var horizon_ground = props.globals.initNode("/instrumentation/pfd/horizon-ground", 0.0, "DOUBLE");
|
||||||
|
@ -1690,7 +1689,7 @@ var canvas_PFD_1 = {
|
||||||
me["ALT_tens"].setTranslation(0, altTens * 1.392);
|
me["ALT_tens"].setTranslation(0, altTens * 1.392);
|
||||||
|
|
||||||
ap_alt_cur = ap_alt.getValue();
|
ap_alt_cur = ap_alt.getValue();
|
||||||
alt_diff_cur = alt_diff.getValue();
|
alt_diff_cur = dmc.DMController.DMCs[0].outputs[7].getValue();
|
||||||
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
|
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
|
||||||
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
|
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
|
||||||
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
|
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
|
||||||
|
@ -2461,7 +2460,7 @@ var canvas_PFD_2 = {
|
||||||
me["ALT_tens"].setTranslation(0, altTens * 1.392);
|
me["ALT_tens"].setTranslation(0, altTens * 1.392);
|
||||||
|
|
||||||
ap_alt_cur = ap_alt.getValue();
|
ap_alt_cur = ap_alt.getValue();
|
||||||
alt_diff_cur = alt_diff.getValue();
|
alt_diff_cur = dmc.DMController.DMCs[1].outputs[7].getValue();
|
||||||
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
|
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
|
||||||
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
|
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
|
||||||
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
|
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
|
||||||
|
|
|
@ -13,11 +13,12 @@ var DMC = {
|
||||||
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.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.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.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.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.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.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.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
|
d.altitudeDiffs = [props.globals.getNode("//instrumentation/pfd/alt-diff[0]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[1]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[2]", 1)];
|
||||||
|
d.outputs = [nil, nil, nil, nil, nil, nil, nil, nil]; # airspeed, altitude, mach, pfd altitude, sat, tat, speed trend, altitudeDiffs
|
||||||
return d;
|
return d;
|
||||||
},
|
},
|
||||||
changeActiveADIRS: func(newADIRS) {
|
changeActiveADIRS: func(newADIRS) {
|
||||||
|
@ -32,6 +33,7 @@ var DMC = {
|
||||||
me.outputs[4] = me.sats[ADIRS];
|
me.outputs[4] = me.sats[ADIRS];
|
||||||
me.outputs[5] = me.tats[ADIRS];
|
me.outputs[5] = me.tats[ADIRS];
|
||||||
me.outputs[6] = me.trends[ADIRS];
|
me.outputs[6] = me.trends[ADIRS];
|
||||||
|
me.outputs[7] = me.altitudeDiffs[ADIRS];
|
||||||
},
|
},
|
||||||
setOutputsNil: func() {
|
setOutputsNil: func() {
|
||||||
me.outputs[0] = nil;
|
me.outputs[0] = nil;
|
||||||
|
@ -41,6 +43,7 @@ var DMC = {
|
||||||
me.outputs[4] = nil;
|
me.outputs[4] = nil;
|
||||||
me.outputs[5] = nil;
|
me.outputs[5] = nil;
|
||||||
me.outputs[6] = nil;
|
me.outputs[6] = nil;
|
||||||
|
me.outputs[7] = nil;
|
||||||
},
|
},
|
||||||
update: func() {
|
update: func() {
|
||||||
if (systems.ADIRS.ADIRunits[me.activeADIRS].operative and systems.ADIRS.ADIRunits[me.activeADIRS].outputOn) {
|
if (systems.ADIRS.ADIRunits[me.activeADIRS].operative and systems.ADIRS.ADIRunits[me.activeADIRS].outputOn) {
|
||||||
|
@ -71,8 +74,8 @@ var DMController = {
|
||||||
|
|
||||||
# update DMC2 to correct properties for first officer PFD
|
# 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.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.DMCs[1].altitudeDiffs = [props.globals.getNode("//instrumentation/pfd/alt-diff[3]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[4]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[5]", 1)];
|
||||||
me._init = 1;
|
me._init = 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -378,4 +378,25 @@ foreach (var name; keys(input)) {
|
||||||
emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Libraries", name, input[name]));
|
emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Libraries", name, input[name]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# TODO split EFIS altimeters
|
||||||
|
var newinhg = nil;
|
||||||
|
setlistener("/instrumentation/altimeter/setting-inhg", func() {
|
||||||
|
newinhg = getprop("/instrumentation/altimeter/setting-inhg");
|
||||||
|
setprop("/instrumentation/altimeter[1]/setting-inhg", newinhg);
|
||||||
|
setprop("/instrumentation/altimeter[2]/setting-inhg", newinhg);
|
||||||
|
setprop("/instrumentation/altimeter[3]/setting-inhg", newinhg);
|
||||||
|
setprop("/instrumentation/altimeter[4]/setting-inhg", newinhg);
|
||||||
|
setprop("/instrumentation/altimeter[5]/setting-inhg", newinhg);
|
||||||
|
}, 0, 0);
|
||||||
|
|
||||||
|
var newhpa = nil;
|
||||||
|
setlistener("/instrumentation/altimeter/setting-hpa", func() {
|
||||||
|
newhpa = getprop("/instrumentation/altimeter/setting-hpa");
|
||||||
|
setprop("/instrumentation/altimeter[1]/setting-hpa", newhpa);
|
||||||
|
setprop("/instrumentation/altimeter[2]/setting-hpa", newhpa);
|
||||||
|
setprop("/instrumentation/altimeter[3]/setting-hpa", newhpa);
|
||||||
|
setprop("/instrumentation/altimeter[4]/setting-hpa", newhpa);
|
||||||
|
setprop("/instrumentation/altimeter[5]/setting-hpa", newhpa);
|
||||||
|
}, 0, 0);
|
||||||
|
|
||||||
setprop("/systems/acconfig/libraries-loaded", 1);
|
setprop("/systems/acconfig/libraries-loaded", 1);
|
||||||
|
|
|
@ -136,9 +136,79 @@
|
||||||
<property>/it-autoflight/internal/alt</property>
|
<property>/it-autoflight/internal/alt</property>
|
||||||
</input>
|
</input>
|
||||||
<reference>
|
<reference>
|
||||||
<property>/instrumentation/altimeter/indicated-altitude-ft</property>
|
<property>/instrumentation/altimeter[0]/indicated-altitude-ft</property>
|
||||||
</reference>
|
</reference>
|
||||||
<output>/instrumentation/pfd/alt-diff</output>
|
<output>/instrumentation/pfd/alt-diff[0]</output>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Altitude bug diff</name>
|
||||||
|
<type>gain</type>
|
||||||
|
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||||
|
<gain>1.0</gain>
|
||||||
|
<input>
|
||||||
|
<property>/it-autoflight/internal/alt</property>
|
||||||
|
</input>
|
||||||
|
<reference>
|
||||||
|
<property>/instrumentation/altimeter[1]/indicated-altitude-ft</property>
|
||||||
|
</reference>
|
||||||
|
<output>/instrumentation/pfd/alt-diff[1]</output>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Altitude bug diff</name>
|
||||||
|
<type>gain</type>
|
||||||
|
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||||
|
<gain>1.0</gain>
|
||||||
|
<input>
|
||||||
|
<property>/it-autoflight/internal/alt</property>
|
||||||
|
</input>
|
||||||
|
<reference>
|
||||||
|
<property>/instrumentation/altimeter[2]/indicated-altitude-ft</property>
|
||||||
|
</reference>
|
||||||
|
<output>/instrumentation/pfd/alt-diff[2]</output>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Altitude bug diff</name>
|
||||||
|
<type>gain</type>
|
||||||
|
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||||
|
<gain>1.0</gain>
|
||||||
|
<input>
|
||||||
|
<property>/it-autoflight/internal/alt</property>
|
||||||
|
</input>
|
||||||
|
<reference>
|
||||||
|
<property>/instrumentation/altimeter[3]/indicated-altitude-ft</property>
|
||||||
|
</reference>
|
||||||
|
<output>/instrumentation/pfd/alt-diff[3]</output>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Altitude bug diff</name>
|
||||||
|
<type>gain</type>
|
||||||
|
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||||
|
<gain>1.0</gain>
|
||||||
|
<input>
|
||||||
|
<property>/it-autoflight/internal/alt</property>
|
||||||
|
</input>
|
||||||
|
<reference>
|
||||||
|
<property>/instrumentation/altimeter[4]/indicated-altitude-ft</property>
|
||||||
|
</reference>
|
||||||
|
<output>/instrumentation/pfd/alt-diff[4]</output>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Altitude bug diff</name>
|
||||||
|
<type>gain</type>
|
||||||
|
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||||
|
<gain>1.0</gain>
|
||||||
|
<input>
|
||||||
|
<property>/it-autoflight/internal/alt</property>
|
||||||
|
</input>
|
||||||
|
<reference>
|
||||||
|
<property>/instrumentation/altimeter[5]/indicated-altitude-ft</property>
|
||||||
|
</reference>
|
||||||
|
<output>/instrumentation/pfd/alt-diff[5]</output>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
|
|
Loading…
Reference in a new issue