1
0
Fork 0

Fix confusion between IESI and PFD nodes

This commit is contained in:
Jonathan Redpath 2022-04-30 13:17:25 +01:00
parent cf9a657195
commit c845cda5af
2 changed files with 25 additions and 21 deletions

View file

@ -70,12 +70,22 @@ var canvas_IESI = {
obj["ATTflag"].hide(); obj["ATTflag"].hide();
obj.update_items = [ obj.update_items = [
props.UpdateManager.FromHashValue("airspeed", 0.1, func(val) { props.UpdateManager.FromHashValue("airspeedIESI", 0.1, func(val) {
obj["ASI_scale"].setTranslation(0, math.clamp(val - 30, 0, 490) * 8.295); obj["ASI_scale"].setTranslation(0, math.clamp(val - 30, 0, 490) * 8.295);
}), }),
props.UpdateManager.FromHashValue("altitude", 0.5, func(val) { props.UpdateManager.FromHashValue("altitudeIESI", 0.5, func(val) {
val = math.clamp(val, -2000, 50000); val = math.clamp(val, -2000, 50000);
obj["ALT_meters"].setText(sprintf("%5.0f", math.round(val * 0.3048, 10)));
obj.middleAltText = roundaboutAlt(val / 100);
obj["ALT_five"].setText(sprintf("%03d", abs(obj.middleAltText + 10)));
obj["ALT_four"].setText(sprintf("%03d", abs(obj.middleAltText + 5)));
obj["ALT_three"].setText(sprintf("%03d", abs(obj.middleAltText)));
obj["ALT_two"].setText(sprintf("%03d", abs(obj.middleAltText - 5)));
obj["ALT_one"].setText(sprintf("%03d", abs(obj.middleAltText - 10)));
if (val < 0) { if (val < 0) {
obj["negText"].show(); obj["negText"].show();
obj._isNegativeAlt = 1; obj._isNegativeAlt = 1;
@ -83,9 +93,11 @@ var canvas_IESI = {
obj["negText"].hide(); obj["negText"].hide();
obj._isNegativeAlt = 0; obj._isNegativeAlt = 0;
} }
}),
props.UpdateManager.FromHashValue("altitudeIESI", 0.1, func(val) {
val = math.clamp(val, -2000, 50000);
obj.altOffset = (val / 500) - int(val / 500); obj.altOffset = (val / 500) - int(val / 500);
obj.middleAltText = roundaboutAlt(val / 100);
if (obj.altOffset > 0.5) { if (obj.altOffset > 0.5) {
obj._middleAltOffset = -(obj.altOffset - 1) * 258.5528; obj._middleAltOffset = -(obj.altOffset - 1) * 258.5528;
@ -96,17 +108,9 @@ var canvas_IESI = {
obj["ALT_scale"].setTranslation(0, -obj._middleAltOffset); obj["ALT_scale"].setTranslation(0, -obj._middleAltOffset);
obj["ALT_scale"].update(); obj["ALT_scale"].update();
obj["ALT_five"].setText(sprintf("%03d", abs(obj.middleAltText + 10)));
obj["ALT_four"].setText(sprintf("%03d", abs(obj.middleAltText + 5)));
obj["ALT_three"].setText(sprintf("%03d", abs(obj.middleAltText)));
obj["ALT_two"].setText(sprintf("%03d", abs(obj.middleAltText - 5)));
obj["ALT_one"].setText(sprintf("%03d", abs(obj.middleAltText - 10)));
obj["ALT_meters"].setText(sprintf("%5.0f", math.round(val * 0.3048, 10)));
obj["ALT_tens"].setTranslation(0, num(right(sprintf("%02d", val), 2)) * 3.16); obj["ALT_tens"].setTranslation(0, num(right(sprintf("%02d", val), 2)) * 3.16);
}), }),
props.UpdateManager.FromHashValue("altitude_ind", 0.5, func(val) { props.UpdateManager.FromHashValue("altitude_indIESI", 0.5, func(val) {
obj["ALT_digits"].setText(sprintf("%s", math.clamp(val, -20, 500))); obj["ALT_digits"].setText(sprintf("%s", math.clamp(val, -20, 500)));
}), }),
props.UpdateManager.FromHashValue("showMach", 1, func(val) { props.UpdateManager.FromHashValue("showMach", 1, func(val) {
@ -359,9 +363,9 @@ emesary.GlobalTransmitter.Register(A320IESI);
# Emesary Frame Notifiaction Properties # Emesary Frame Notifiaction Properties
var input = { var input = {
"acconfig": "/systems/acconfig/autoconfig-running", "acconfig": "/systems/acconfig/autoconfig-running",
"airspeed": "/instrumentation/airspeed-indicator[0]/indicated-speed-kt", "airspeedIESI": "/instrumentation/airspeed-indicator[0]/indicated-speed-kt",
"altitude": "/instrumentation/altimeter[6]/indicated-altitude-ft", "altitudeIESI": "/instrumentation/altimeter[6]/indicated-altitude-ft",
"altitude_ind": "/instrumentation/altimeter[6]/indicated-altitude-ft-pfd", "altitude_indIESI": "/instrumentation/altimeter[6]/indicated-altitude-ft-pfd",
"altimeter_mode_iesi": "/instrumentation/altimeter[6]/std", "altimeter_mode_iesi": "/instrumentation/altimeter[6]/std",
"attReset": "/instrumentation/iesi/att-reset", "attReset": "/instrumentation/iesi/att-reset",
"iesiBrt": "/controls/lighting/DU/iesi", "iesiBrt": "/controls/lighting/DU/iesi",

View file

@ -1221,7 +1221,7 @@ var canvas_pfd = {
obj["Metric_cur_alt"].hide(); obj["Metric_cur_alt"].hide();
} }
}), }),
props.UpdateManager.FromHashValue("altitude", 0.5, func(val) { props.UpdateManager.FromHashValue("altitudePFD", 0.5, func(val) {
obj["Metric_cur_alt"].setText(sprintf("%5.0f", val * 0.3048)); obj["Metric_cur_alt"].setText(sprintf("%5.0f", val * 0.3048));
obj.middleAltText = roundaboutAlt(val / 100); obj.middleAltText = roundaboutAlt(val / 100);
@ -1238,7 +1238,7 @@ var canvas_pfd = {
obj["ALT_neg"].hide(); obj["ALT_neg"].hide();
} }
}), }),
props.UpdateManager.FromHashValue("altitude", 0.1, func(val) { props.UpdateManager.FromHashValue("altitudePFD", 0.1, func(val) {
obj.altOffset = val / 500 - int(val / 500); obj.altOffset = val / 500 - int(val / 500);
obj.middleAltOffset = nil; obj.middleAltOffset = nil;
@ -1685,7 +1685,7 @@ var canvas_pfd = {
if (dmc.DMController.DMCs[me.number].outputs[1] != nil) { if (dmc.DMController.DMCs[me.number].outputs[1] != nil) {
notification.altError = 0; notification.altError = 0;
notification.altitude = dmc.DMController.DMCs[me.number].outputs[1].getValue(); notification.altitudePFD = dmc.DMController.DMCs[me.number].outputs[1].getValue();
notification.altitudeDigits = dmc.DMController.DMCs[me.number].outputs[3].getValue(); notification.altitudeDigits = dmc.DMController.DMCs[me.number].outputs[3].getValue();
notification.altitudeDifference = dmc.DMController.DMCs[me.number].outputs[7].getValue(); notification.altitudeDifference = dmc.DMController.DMCs[me.number].outputs[7].getValue();
@ -1769,7 +1769,7 @@ var canvas_pfd = {
} }
} else { } else {
notification.altError = 1; notification.altError = 1;
notification.altitude = -9999; notification.altitudePFD = -9999;
notification.altitudeDigits = -9999; notification.altitudeDigits = -9999;
notification.altitudeDifference = -9999; notification.altitudeDifference = -9999;
} }
@ -1814,7 +1814,7 @@ var canvas_pfd = {
} }
if (notification.altimeterStd == 1) { if (notification.altimeterStd == 1) {
if (notification.altitude < fmgc.FMGCInternal.transAlt and fmgc.FMGCInternal.phase == 4) { if (notification.altitudePFD < fmgc.FMGCInternal.transAlt and fmgc.FMGCInternal.phase == 4) {
if (me.number == 0) { if (me.number == 0) {
if (qnh_going1 == 0) { if (qnh_going1 == 0) {
qnhTimer1.start(); qnhTimer1.start();
@ -1848,7 +1848,7 @@ var canvas_pfd = {
me["QNH_box"].show(); me["QNH_box"].show();
} }
} else { } else {
if (notification.altitude >= fmgc.FMGCInternal.transAlt and fmgc.FMGCInternal.phase == 2) { if (notification.altitudePFD >= fmgc.FMGCInternal.transAlt and fmgc.FMGCInternal.phase == 2) {
if (me.number == 0) { if (me.number == 0) {
if (qnh_going1 == 0) { if (qnh_going1 == 0) {
qnhTimer1.start(); qnhTimer1.start();