From 15c2f680a4399c04542876652beba8169f241191 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 6 Nov 2019 19:09:42 +0000 Subject: [PATCH] ADIRS update, now shows airspeed on PFD --- A320-main.xml | 13 + Models/FlightDeck/a320.flightdeck.xml | 61 +- Models/Instruments/OHpanel/OHpanel.xml | 6 +- Models/Instruments/PFD/PFD.nas | 406 ++++++++----- Models/Instruments/PFD/res/pfd.svg | 537 +++++++++--------- .../Instruments/Pedestal_up/Pedestal_up.xml | 1 + Nasal/ADIRS/ADR.nas | 124 ++-- Nasal/ADIRS/SwitchingPanel.nas | 21 + Nasal/DMC.nas | 70 +++ Nasal/ECAM/ECAM-controller.nas | 8 +- Nasal/ECAM/ECAM-logic.nas | 34 +- Nasal/ECAM/ECAM-messages.nas | 4 +- Nasal/atc.nas | 25 +- Nasal/libraries.nas | 2 + Nasal/property-tree-setup.nas | 5 + Systems/a320-adr.xml | 187 +++--- Systems/instrumentation.xml | 4 +- Systems/pfd.xml | 87 ++- 18 files changed, 1027 insertions(+), 568 deletions(-) create mode 100644 Nasal/DMC.nas diff --git a/A320-main.xml b/A320-main.xml index 033885f4..1f51f39c 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -717,6 +717,10 @@ 0 + + 0 + 0 + @@ -1173,6 +1177,11 @@ + + 0 + 0 + + true @@ -1713,6 +1722,7 @@ Aircraft/A320-family/Nasal/engines-common.nas Aircraft/A320-family/Nasal/ADIRS.nas Aircraft/A320-family/Nasal/ADIRS/ADR.nas + Aircraft/A320-family/Nasal/ADIRS/SwitchingPanel.nas Aircraft/A320-family/Nasal/fire.nas Aircraft/A320-family/Nasal/brakes.nas Aircraft/A320-family/Nasal/ground_services.nas @@ -1790,6 +1800,9 @@ Aircraft/A320-family/Nasal/atc.nas + + Aircraft/A320-family/Nasal/DMC.nas + diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 6aa50709..f55d6d86 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -6070,7 +6070,66 @@ - + + + rotate + ecam_air_data + ecam_air_data.mark + 30 + /controls/navigation/switching/air-data + + -0.428673 + -0.022557 + -0.051784 + -0.430086 + -0.022557 + -0.060321 + + + + + pick + ecam_air_data + + + + true + + nasal + + + + nasal + + + + + + + true + + nasal + + + + nasal + + + + + material diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index 8998733a..bf4e41b9 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -596,7 +596,7 @@ - controls/adirs/ir[0]/align + controls/navigation/adirscp/lights/ir-1-off 1 @@ -692,7 +692,7 @@ - controls/adirs/ir[1]/align + controls/navigation/adirscp/lights/ir-2-off 1 @@ -788,7 +788,7 @@ - controls/adirs/ir[2]/align + controls/navigation/adirscp/lights/ir-3-off 1 diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 35bdd075..e31e31a9 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -13,11 +13,6 @@ var PFD2_display = nil; var updateL = 0; var updateR = 0; var elapsedtime = 0; -var ASI = 0; -var ASItrgt = 0; -var ASItrgtdiff = 0; -var ASImax = 0; -var ASItrend = 0; var altTens = 0; var altPolarity = ""; @@ -133,7 +128,9 @@ var hdg_diff = props.globals.initNode("/instrumentation/pfd/hdg-diff", 0.0, "DOU var hdg_scale = props.globals.initNode("/instrumentation/pfd/heading-scale", 0.0, "DOUBLE"); var track = props.globals.initNode("/instrumentation/pfd/track-deg", 0.0, "DOUBLE"); var track_diff = props.globals.initNode("/instrumentation/pfd/track-hdg-diff", 0.0, "DOUBLE"); -var speed_pred = props.globals.initNode("/instrumentation/pfd/speed-lookahead", 0.0, "DOUBLE"); +var speed_pred_1 = props.globals.initNode("/instrumentation/pfd/speed-lookahead-1", 0.0, "DOUBLE"); +var speed_pred_2 = props.globals.initNode("/instrumentation/pfd/speed-lookahead-2", 0.0, "DOUBLE"); +var speed_pred_3 = props.globals.initNode("/instrumentation/pfd/speed-lookahead-3", 0.0, "DOUBLE"); var du1_test = props.globals.initNode("/instrumentation/du/du1-test", 0, "BOOL"); var du1_test_time = props.globals.initNode("/instrumentation/du/du1-test-time", 0.0, "DOUBLE"); var du1_test_amount = props.globals.initNode("/instrumentation/du/du1-test-amount", 0.0, "DOUBLE"); @@ -197,7 +194,7 @@ var canvas_PFD_base = { "AI_bank_lim","AI_bank_lim_X","AI_pitch_lim","AI_pitch_lim_X","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky","AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","AI_error","AI_group","FD_roll","FD_pitch","ALT_scale","ALT_target", "ALT_target_digit","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_digit_UP","ALT_digit_DN","ALT_error","ALT_group","ALT_group2","ALT_frame","VS_pointer","VS_box","VS_digit","VS_error","VS_group","QNH","QNH_setting", "QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","HDG_error","HDG_group","HDG_frame", - "TRK_pointer"]; + "TRK_pointer","machError"]; }, update: func() { elapsedtime_act = elapsedtime.getValue(); @@ -609,119 +606,6 @@ var canvas_PFD_base = { } }, updateCommonFast: func() { - # Airspeed - ind_spd = ind_spd_kt.getValue(); - # Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations - if (ind_spd <= 30) { - ASI = 0; - } else if (ind_spd >= 420) { - ASI = 390; - } else { - ASI = ind_spd - 30; - } - - FMGC_max = FMGC_max_spd.getValue(); - if (FMGC_max <= 30) { - ASImax = 0 - ASI; - } else if (FMGC_max >= 420) { - ASImax = 390 - ASI; - } else { - ASImax = FMGC_max - 30 - ASI; - } - - me["ASI_scale"].setTranslation(0, ASI * 6.6); - me["ASI_max"].setTranslation(0, ASImax * -6.6); - - ind_mach = ind_spd_mach.getValue(); - if (ind_mach >= 0.5) { - me["ASI_mach_decimal"].show(); - me["ASI_mach"].show(); - } else { - me["ASI_mach_decimal"].hide(); - me["ASI_mach"].hide(); - } - - if (ind_mach >= 0.999) { - me["ASI_mach"].setText("999"); - } else { - me["ASI_mach"].setText(sprintf("%3.0f", ind_mach * 1000)); - } - - if (managed_spd.getValue() == 1) { - me["ASI_target"].setColor(0.6901,0.3333,0.7450); - me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450); - me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450); - me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450); - me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450); - } else { - me["ASI_target"].setColor(0.0901,0.6039,0.7176); - me["ASI_digit_UP"].setColor(0.0901,0.6039,0.7176); - me["ASI_decimal_UP"].setColor(0.0901,0.6039,0.7176); - me["ASI_digit_DN"].setColor(0.0901,0.6039,0.7176); - me["ASI_decimal_DN"].setColor(0.0901,0.6039,0.7176); - } - - tgt_ias = at_tgt_ias.getValue(); - if (tgt_ias <= 30) { - ASItrgt = 0 - ASI; - } else if (tgt_ias >= 420) { - ASItrgt = 390 - ASI; - } else { - ASItrgt = tgt_ias - 30 - ASI; - } - - ASItrgtdiff = tgt_ias - ind_spd; - - if (ASItrgtdiff >= -42 and ASItrgtdiff <= 42) { - me["ASI_target"].setTranslation(0, ASItrgt * -6.6); - me["ASI_digit_UP"].hide(); - me["ASI_decimal_UP"].hide(); - me["ASI_digit_DN"].hide(); - me["ASI_decimal_DN"].hide(); - me["ASI_target"].show(); - } else if (ASItrgtdiff < -42) { - if (at_mach_mode.getValue() == 1) { - me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000)); - me["ASI_decimal_UP"].hide(); - me["ASI_decimal_DN"].show(); - } else { - me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_kts.getValue())); - me["ASI_decimal_UP"].hide(); - me["ASI_decimal_DN"].hide(); - } - me["ASI_digit_DN"].show(); - me["ASI_digit_UP"].hide(); - me["ASI_target"].hide(); - } else if (ASItrgtdiff > 42) { - if (at_mach_mode.getValue() == 1) { - me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000)); - me["ASI_decimal_UP"].show(); - me["ASI_decimal_DN"].hide(); - } else { - me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_kts.getValue())); - me["ASI_decimal_UP"].hide(); - me["ASI_decimal_DN"].hide(); - } - me["ASI_digit_UP"].show(); - me["ASI_digit_DN"].hide(); - me["ASI_target"].hide(); - } - - ASItrend = speed_pred.getValue() - ASI; - me["ASI_trend_up"].setTranslation(0, math.clamp(ASItrend, 0, 50) * -6.6); - me["ASI_trend_down"].setTranslation(0, math.clamp(ASItrend, -50, 0) * -6.6); - - if (ASItrend >= 2) { - me["ASI_trend_up"].show(); - me["ASI_trend_down"].hide(); - } else if (ASItrend <= -2) { - me["ASI_trend_down"].show(); - me["ASI_trend_up"].hide(); - } else { - me["ASI_trend_up"].hide(); - me["ASI_trend_down"].hide(); - } - # Attitude Indicator pitch_cur = pitch.getValue(); roll_cur = roll.getValue(); @@ -947,6 +831,12 @@ var canvas_PFD_base = { }; var canvas_PFD_1 = { + ASI: 0, + ASImax: 0, + ASItrend: 0, + ASItrgt: 0, + ASItrgtdiff: 0, + FMGC_max: 0, new: func(canvas_group, file) { var m = {parents: [canvas_PFD_1, canvas_PFD_base]}; m.init(canvas_group, file); @@ -964,23 +854,17 @@ var canvas_PFD_1 = { # Errors if ((adirs0_active.getValue() == 1) or (air_switch.getValue() == -1 and adirs2_active.getValue() == 1)) { - me["ASI_group"].show(); me["ALT_group"].show(); me["ALT_group2"].show(); me["ALT_scale"].show(); me["VS_group"].show(); - me["ASI_error"].hide(); - me["ASI_frame"].setColor(1,1,1); me["ALT_error"].hide(); me["ALT_frame"].setColor(1,1,1); me["VS_error"].hide(); } else { - me["ASI_error"].show(); - me["ASI_frame"].setColor(1,0,0); me["ALT_error"].show(); me["ALT_frame"].setColor(1,0,0); me["VS_error"].show(); - me["ASI_group"].hide(); me["ALT_group"].hide(); me["ALT_group2"].hide(); me["ALT_scale"].hide(); @@ -1037,11 +921,146 @@ var canvas_PFD_1 = { me.updateCommon(); }, updateFast: func() { + # Airspeed + # ind_spd = ind_spd_kt.getValue(); + # Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations + + if (dmc.DMController.DMCs[0].outputs[0] != nil) { + ind_spd = dmc.DMController.DMCs[0].outputs[0].getValue(); + me["ASI_error"].hide(); + me["ASI_frame"].setColor(1,1,1); + me["ASI_group"].show(); + + if (ind_spd <= 30) { + me.ASI = 0; + } else if (ind_spd >= 420) { + me.ASI = 390; + } else { + me.ASI = ind_spd - 30; + } + + me.FMGC_max = FMGC_max_spd.getValue(); + if (me.FMGC_max <= 30) { + me.ASImax = 0 - me.ASI; + } else if (me.FMGC_max >= 420) { + me.ASImax = 390 - me.ASI; + } else { + me.ASImax = me.FMGC_max - 30 - me.ASI; + } + + me["ASI_scale"].setTranslation(0, me.ASI * 6.6); + me["ASI_max"].setTranslation(0, me.ASImax * -6.6); + + if (managed_spd.getValue() == 1) { + me["ASI_target"].setColor(0.6901,0.3333,0.7450); + me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450); + me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450); + me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450); + me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450); + } else { + me["ASI_target"].setColor(0.0901,0.6039,0.7176); + me["ASI_digit_UP"].setColor(0.0901,0.6039,0.7176); + me["ASI_decimal_UP"].setColor(0.0901,0.6039,0.7176); + me["ASI_digit_DN"].setColor(0.0901,0.6039,0.7176); + me["ASI_decimal_DN"].setColor(0.0901,0.6039,0.7176); + } + + tgt_ias = at_tgt_ias.getValue(); + if (tgt_ias <= 30) { + me.ASItrgt = 0 - me.ASI; + } else if (tgt_ias >= 420) { + me.ASItrgt = 390 - me.ASI; + } else { + me.ASItrgt = tgt_ias - 30 - me.ASI; + } + + me.ASItrgtdiff = tgt_ias - ind_spd; + + if (me.ASItrgtdiff >= -42 and me.ASItrgtdiff <= 42) { + me["ASI_target"].setTranslation(0, me.ASItrgt * -6.6); + me["ASI_digit_UP"].hide(); + me["ASI_decimal_UP"].hide(); + me["ASI_digit_DN"].hide(); + me["ASI_decimal_DN"].hide(); + me["ASI_target"].show(); + } else if (me.ASItrgtdiff < -42) { + if (at_mach_mode.getValue() == 1) { + me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000)); + me["ASI_decimal_UP"].hide(); + me["ASI_decimal_DN"].show(); + } else { + me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_kts.getValue())); + me["ASI_decimal_UP"].hide(); + me["ASI_decimal_DN"].hide(); + } + me["ASI_digit_DN"].show(); + me["ASI_digit_UP"].hide(); + me["ASI_target"].hide(); + } else if (me.ASItrgtdiff > 42) { + if (at_mach_mode.getValue() == 1) { + me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000)); + me["ASI_decimal_UP"].show(); + me["ASI_decimal_DN"].hide(); + } else { + me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_kts.getValue())); + me["ASI_decimal_UP"].hide(); + me["ASI_decimal_DN"].hide(); + } + me["ASI_digit_UP"].show(); + me["ASI_digit_DN"].hide(); + me["ASI_target"].hide(); + } + + me.ASItrend = speed_pred_1.getValue() - me.ASI; + me["ASI_trend_up"].setTranslation(0, math.clamp(me.ASItrend, 0, 50) * -6.6); + me["ASI_trend_down"].setTranslation(0, math.clamp(me.ASItrend, -50, 0) * -6.6); + + if (me.ASItrend >= 2) { + me["ASI_trend_up"].show(); + me["ASI_trend_down"].hide(); + } else if (me.ASItrend <= -2) { + me["ASI_trend_down"].show(); + me["ASI_trend_up"].hide(); + } else { + me["ASI_trend_up"].hide(); + me["ASI_trend_down"].hide(); + } + } else { + me["ASI_group"].hide(); + me["ASI_error"].show(); + me["ASI_frame"].setColor(1,0,0); + } + + if (dmc.DMController.DMCs[0].outputs[2] != nil) { + ind_mach = dmc.DMController.DMCs[0].outputs[2].getValue(); + me["machError"].hide(); + if (ind_mach >= 0.5) { + me["ASI_mach_decimal"].show(); + me["ASI_mach"].show(); + } else { + me["ASI_mach_decimal"].hide(); + me["ASI_mach"].hide(); + } + + if (ind_mach >= 0.999) { + me["ASI_mach"].setText("999"); + } else { + me["ASI_mach"].setText(sprintf("%3.0f", ind_mach * 1000)); + } + } else { + me["machError"].show(); + } me.updateCommonFast(); }, }; var canvas_PFD_2 = { + ASI: 0, + ASImax: 0, + ASItrend: 0, + ASItrgt: 0, + ASItrgtdiff: 0, + FMGC_max: 0, new: func(canvas_group, file) { var m = {parents: [canvas_PFD_2, canvas_PFD_base]}; m.init(canvas_group, file); @@ -1059,19 +1078,14 @@ var canvas_PFD_2 = { # Errors if ((adirs1_active.getValue() == 1) or (air_switch.getValue() == 1 and adirs2_active.getValue() == 1)) { - me["ASI_group"].show(); me["ALT_group"].show(); me["ALT_group2"].show(); me["ALT_scale"].show(); me["VS_group"].show(); - me["ASI_error"].hide(); - me["ASI_frame"].setColor(1,1,1); me["ALT_error"].hide(); me["ALT_frame"].setColor(1,1,1); me["VS_error"].hide(); } else { - me["ASI_error"].show(); - me["ASI_frame"].setColor(1,0,0); me["ALT_error"].show(); me["ALT_frame"].setColor(1,0,0); me["VS_error"].show(); @@ -1132,6 +1146,136 @@ var canvas_PFD_2 = { me.updateCommon(); }, updateFast: func() { + # Airspeed + # ind_spd = ind_spd_kt.getValue(); + # Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations + + if (dmc.DMController.DMCs[1].outputs[0] != nil) { + ind_spd = dmc.DMController.DMCs[1].outputs[0].getValue(); + me["ASI_error"].hide(); + me["ASI_frame"].setColor(1,1,1); + me["ASI_group"].show(); + + if (ind_spd <= 30) { + me.ASI = 0; + } else if (ind_spd >= 420) { + me.ASI = 390; + } else { + me.ASI = ind_spd - 30; + } + + me.FMGC_max = FMGC_max_spd.getValue(); + if (me.FMGC_max <= 30) { + me.ASImax = 0 - me.ASI; + } else if (me.FMGC_max >= 420) { + me.ASImax = 390 - me.ASI; + } else { + me.ASImax = me.FMGC_max - 30 - me.ASI; + } + + me["ASI_scale"].setTranslation(0, me.ASI * 6.6); + me["ASI_max"].setTranslation(0, me.ASImax * -6.6); + + if (managed_spd.getValue() == 1) { + me["ASI_target"].setColor(0.6901,0.3333,0.7450); + me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450); + me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450); + me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450); + me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450); + } else { + me["ASI_target"].setColor(0.0901,0.6039,0.7176); + me["ASI_digit_UP"].setColor(0.0901,0.6039,0.7176); + me["ASI_decimal_UP"].setColor(0.0901,0.6039,0.7176); + me["ASI_digit_DN"].setColor(0.0901,0.6039,0.7176); + me["ASI_decimal_DN"].setColor(0.0901,0.6039,0.7176); + } + + tgt_ias = at_tgt_ias.getValue(); + if (tgt_ias <= 30) { + me.ASItrgt = 0 - me.ASI; + } else if (tgt_ias >= 420) { + me.ASItrgt = 390 - me.ASI; + } else { + me.ASItrgt = tgt_ias - 30 - me.ASI; + } + + me.ASItrgtdiff = tgt_ias - ind_spd; + + if (me.ASItrgtdiff >= -42 and me.ASItrgtdiff <= 42) { + me["ASI_target"].setTranslation(0, me.ASItrgt * -6.6); + me["ASI_digit_UP"].hide(); + me["ASI_decimal_UP"].hide(); + me["ASI_digit_DN"].hide(); + me["ASI_decimal_DN"].hide(); + me["ASI_target"].show(); + } else if (me.ASItrgtdiff < -42) { + if (at_mach_mode.getValue() == 1) { + me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000)); + me["ASI_decimal_UP"].hide(); + me["ASI_decimal_DN"].show(); + } else { + me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_kts.getValue())); + me["ASI_decimal_UP"].hide(); + me["ASI_decimal_DN"].hide(); + } + me["ASI_digit_DN"].show(); + me["ASI_digit_UP"].hide(); + me["ASI_target"].hide(); + } else if (me.ASItrgtdiff > 42) { + if (at_mach_mode.getValue() == 1) { + me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000)); + me["ASI_decimal_UP"].show(); + me["ASI_decimal_DN"].hide(); + } else { + me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_kts.getValue())); + me["ASI_decimal_UP"].hide(); + me["ASI_decimal_DN"].hide(); + } + me["ASI_digit_UP"].show(); + me["ASI_digit_DN"].hide(); + me["ASI_target"].hide(); + } + + me.ASItrend = speed_pred_2.getValue() - me.ASI; + me["ASI_trend_up"].setTranslation(0, math.clamp(me.ASItrend, 0, 50) * -6.6); + me["ASI_trend_down"].setTranslation(0, math.clamp(me.ASItrend, -50, 0) * -6.6); + + if (me.ASItrend >= 2) { + me["ASI_trend_up"].show(); + me["ASI_trend_down"].hide(); + } else if (me.ASItrend <= -2) { + me["ASI_trend_down"].show(); + me["ASI_trend_up"].hide(); + } else { + me["ASI_trend_up"].hide(); + me["ASI_trend_down"].hide(); + } + } else { + me["ASI_error"].show(); + me["ASI_frame"].setColor(1,0,0); + me["ASI_group"].hide(); + } + + if (dmc.DMController.DMCs[1].outputs[2] != nil) { + ind_mach = dmc.DMController.DMCs[1].outputs[2].getValue(); + me["machError"].hide(); + if (ind_mach >= 0.5) { + me["ASI_mach_decimal"].show(); + me["ASI_mach"].show(); + } else { + me["ASI_mach_decimal"].hide(); + me["ASI_mach"].hide(); + } + + if (ind_mach >= 0.999) { + me["ASI_mach"].setText("999"); + } else { + me["ASI_mach"].setText(sprintf("%3.0f", ind_mach * 1000)); + } + } else { + me["machError"].show(); + } + me.updateCommonFast(); }, }; diff --git a/Models/Instruments/PFD/res/pfd.svg b/Models/Instruments/PFD/res/pfd.svg index df26ecef..b334de65 100644 --- a/Models/Instruments/PFD/res/pfd.svg +++ b/Models/Instruments/PFD/res/pfd.svg @@ -12,7 +12,7 @@ viewBox="0 0 1024 1024" version="1.1" id="svg2" - inkscape:version="0.91 r13725" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)" sodipodi:docname="pfd.svg"> @@ -37,14 +37,14 @@ guidetolerance="10" inkscape:pageopacity="1" inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1027" + inkscape:window-width="1366" + inkscape:window-height="705" id="namedview371" showgrid="false" - inkscape:zoom="0.70710678" - inkscape:cx="1179.7256" - inkscape:cy="481.71975" - inkscape:window-x="1592" + inkscape:zoom="2.0149341" + inkscape:cx="51.385843" + inkscape:cy="279.39354" + inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="svg2" @@ -577,7 +577,7 @@ inkscape:label="#g4699"> 10 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">10 20 20 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">20 30 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">30 40 40 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">40 50 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">50 60 60 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">60 70 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">70 80 80 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">80 90 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">90 10 10 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">10 20 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">20 30 30 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">30 40 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">40 50 50 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">50 60 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">60 70 70 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">70 80 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">80 90 90 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">90 @@ -1124,12 +1124,11 @@ transform="translate(0,97.08285)"> X X X X 1 2 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:29.77171135px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#cecdce;fill-opacity:1;stroke-width:0.65757734">2 6 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.75603485px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#cecdce;fill-opacity:1;stroke-width:0.65757734">6 2 1 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.75603485px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#cecdce;fill-opacity:1;stroke-width:0.65757734">1 000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.75">000 000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.75">000 000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.75">000 TOGA + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948883px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.65757734">TOGA ALT + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948883px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke-width:0.65757734">ALT CLB + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948883px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke-width:0.65757734">CLB FL 000 FL 000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#179ab7;fill-opacity:1;stroke-width:0.75">FL 000 1013 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:38.39944839px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke-width:0.75">1013  40200080604020008060 AP 1+2 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948502px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#cecdce;fill-opacity:1;stroke-width:0.65757734">AP 1+2 A/THR + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948502px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#cecdce;fill-opacity:1;stroke-width:0.65757734">A/THR DUAL + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948502px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#cecdce;fill-opacity:1;stroke-width:0.65757734">DUAL FLARE + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948502px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke-width:0.65757734">FLARE DH + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948502px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#cecdce;fill-opacity:1;stroke-width:0.65757734">DH LVR CLB + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.99948502px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.65757734">LVR CLB @@ -3150,7 +3143,7 @@ style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995403;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> 00 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.75">00 00 00 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.75">00 00 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.75">00 00 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.75">00 000 000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1;stroke-width:0.75">000 140 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">140 120 100 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">100 080 060 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">060 040 180 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">180 200 220 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">220 240 260 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">260 280 300 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">300 320 340 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">340 360 380 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">380 400 420 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke-width:0.75">420 000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:48.83483124px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1;stroke-width:0.75">000 . 000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#179ab7;fill-opacity:1;stroke-width:0.75">000 . . + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#179ab7;fill-opacity:1;stroke-width:0.75">. ALT VV/S HDG + MACH diff --git a/Models/Instruments/Pedestal_up/Pedestal_up.xml b/Models/Instruments/Pedestal_up/Pedestal_up.xml index 683c0310..4c2133d5 100644 --- a/Models/Instruments/Pedestal_up/Pedestal_up.xml +++ b/Models/Instruments/Pedestal_up/Pedestal_up.xml @@ -484,4 +484,5 @@ + diff --git a/Nasal/ADIRS/ADR.nas b/Nasal/ADIRS/ADR.nas index 7c4812db..ac694a24 100644 --- a/Nasal/ADIRS/ADR.nas +++ b/Nasal/ADIRS/ADR.nas @@ -7,7 +7,7 @@ var _NUMADIRU = 3; var _selfTestTime = nil; -var ADR = { +var ADIRU = { # local vars _voltageMain: 0, _voltageBackup: 0, @@ -15,6 +15,7 @@ var ADR = { _noPowerTime: 0, _timeVar: 0, + num: 0, outputOn: 0, # 0 = disc, 1 = normal mode: 0, # 0 = off, 1 = nav, 2 = att energised: 0, # 0 = off, 1 = on @@ -23,13 +24,13 @@ var ADR = { output: [], # methods - new: func() { - var adr = { parents:[ADR] }; - return adr; + new: func(n) { + var adiru = { parents:[ADIRU] }; + adiru.num = n; + return adiru; }, updateEnergised: func(mode) { me.energised = mode != 0 ? 1 : 0; - print("ADR energised status " ~ me.energised); }, updatePower: func(elec) { me._voltageMain = elec.getValue() or 0; @@ -44,6 +45,25 @@ var ADR = { ADIRSnew._selfTest = 1; _selfTestTime = pts.Sim.Time.elapsedSec.getValue(); + ADIRSnew.Lights.adrOff[me.num].setValue(1); + ADIRSnew.Lights.adrFault[me.num].setValue(1); + settimer(func() { + ADIRSnew.Lights.adrOff[me.num].setValue(0); + ADIRSnew.Lights.adrFault[me.num].setValue(0); + }, 0.1); + settimer(func() { + ADIRSnew.Lights.adrOff[me.num].setValue(1); + ADIRSnew.Lights.adrFault[me.num].setValue(1); + ADIRSnew.Lights.irFault[me.num].setValue(1); + ADIRSnew.Lights.irOff[me.num].setValue(1); + }, 1.0); + settimer(func() { + ADIRSnew.Lights.adrOff[me.num].setValue(0); + ADIRSnew.Lights.adrFault[me.num].setValue(0); + ADIRSnew.Lights.irFault[me.num].setValue(0); + ADIRSnew.Lights.irOff[me.num].setValue(0); + }, 1.1); + ADIRSnew.selfTest(); }, setOperative: func(newOperative) { @@ -52,14 +72,13 @@ var ADR = { if (newOperative) { me.selfTest(); } - print("Set operative to " ~ me.operative); } }, update: func() { me._timeVar = pts.Sim.Time.elapsedSec.getValue(); if (me.energised and !me._voltageMain and me._voltageLimitedTime and me._noPowerTime == 0) { me._noPowerTime = me._timeVar; - print("ADR lost power at time " ~ me._noPowerTime); + print("ADIRU lost power at time " ~ me._noPowerTime); } if (me.energised and me.mode) { @@ -91,85 +110,32 @@ var ADR = { }, }; -var IR = { - # local vars - _voltageMain: 0, - _voltageBackup: 0, - _voltageLimitedTime: 0, - _noPowerTime: 0, - _timeVar: 0, - - outputOn: 0, # 0 = disc, 1 = normal - mode: 0, # 0 = off, 1 = nav, 2 = att - energised: 0, # 0 = off, 1 = on - operative: 0, # 0 = off, - input: [], - output: [], - - # methods - new: func() { - var ir = { parents:[IR] }; - return ir; - }, - updateEnergised: func(mode) { - me.energised = mode != 0 ? 1 : 0; - }, - updatePower: func(elec) { - me._voltageMain = elec.getValue() or 0; - return me._voltageMain; - }, - updateBackupPower: func(elec, isLimited) { - me._voltageBackup = elec.getValue() or 0; - me._voltageLimitedTime = isLimited; - return me._voltageBackup; - }, - update: func() { - me._timeVar = pts.Sim.Time.elapsedSec.getValue(); - if (me.energised and !me._voltageMain and me._voltageLimitedTime and me._noPowerTime == 0) { - me._noPowerTime = me._timeVar; - } - - if (me._voltageMain or me._timeVar < me._noPowerTime + 300) { - me.operative = (me.outputOn and me.energised and me.mode) ? 1 : 0; - } else { - me.operative = 0; - } - }, -}; - var ADIRSControlPanel = { adrSw: func(n) { if (n < 0 or n > _NUMADIRU) { return; } ADIRSnew._adrSwitchState = ADIRSnew.Switches.adrSw[n].getValue(); - print("Switching adr unit " ~ n ~ " to " ~ !ADIRSnew._adrSwitchState); ADIRSnew.Switches.adrSw[n].setValue(!ADIRSnew._adrSwitchState); - if (ADIRSnew.ADRunits[n] != nil) { - ADIRSnew.ADRunits[n].outputOn = !ADIRSnew._adrSwitchState; + if (ADIRSnew.ADIRunits[n] != nil) { + ADIRSnew.ADIRunits[n].outputOn = !ADIRSnew._adrSwitchState; } ADIRSnew.Lights.adrOff[n].setValue(ADIRSnew._adrSwitchState); }, irSw: func(n) { if (n < 0 or n > _NUMADIRU) { return; } ADIRSnew._irSwitchState = ADIRSnew.Switches.irSw[n].getValue(); - print("Switching ir unit " ~ n ~ " to " ~ !ADIRSnew._irSwitchState); ADIRSnew.Switches.irSw[n].setValue(!ADIRSnew._irSwitchState); if (ADIRSnew.IRunits[n] != nil) { ADIRSnew.IRunits[n].outputOn = !ADIRSnew._irSwitchState; } + ADIRSnew.Lights.irOff[n].setValue(ADIRSnew._adrSwitchState); }, irModeSw: func(n, mode) { if (n < 0 or n > _NUMADIRU) { return; } if (mode < 0 or mode > 2) { return; } me._irModeSwitchState = ADIRSnew.Switches.irModeSw[n].getValue(); - print("Switching adirs " ~ n ~ " to mode " ~ mode); - if (ADIRSnew.ADRunits[n] != nil) { - ADIRSnew.ADRunits[n].mode = mode; - ADIRSnew.ADRunits[n].updateEnergised(mode); - ADIRSnew.Switches.irModeSw[n].setValue(mode); - } - if (ADIRSnew.IRunits[n] != nil) { - ADIRSnew.IRunits[n].mode = mode; - ADIRSnew.IRunits[n].updateEnergised(mode); + if (ADIRSnew.ADIRunits[n] != nil) { + ADIRSnew.ADIRunits[n].mode = mode; + ADIRSnew.ADIRunits[n].updateEnergised(mode); ADIRSnew.Switches.irModeSw[n].setValue(mode); } } @@ -181,15 +147,16 @@ var ADIRSnew = { _irSwitchState: 0, _irModeSwitchState: 0, _hasPower: 0, - _oldOperative: [0, 0, 0], + _cacheOperative: [0, 0, 0], + _cacheOutputOn: [0, 0, 0], _flapPos: nil, _slatPos: nil, _selfTest: 0, _init: 0, # ADIRS Units - ADRunits: [nil, nil, nil], - IRunits: [nil, nil, nil], + ADIRunits: [nil, nil, nil], + #IRunits: [nil, nil, nil], # Electrical mainSupply: [systems.ELEC.Bus.acEss, systems.ELEC.Bus.ac2, systems.ELEC.Bus.ac1], @@ -219,8 +186,8 @@ var ADIRSnew = { init: func() { if (!me._init) { for (i = 0; i < _NUMADIRU; i = i + 1) { - print("Creating new ADR unit " ~ i); - me.ADRunits[i] = ADR.new(); + print("Creating new ADIRU " ~ i); + me.ADIRunits[i] = ADIRU.new(i); me._init = 1; } } @@ -251,18 +218,19 @@ var ADIRSnew = { if (me._init) { for (i = 0; i < _NUMADIRU; i = i + 1) { # update ADR units power - me._hasPower = me.ADRunits[i].updatePower(me.mainSupply[i]); + me._hasPower = me.ADIRunits[i].updatePower(me.mainSupply[i]); if (me._hasPower == 0) { - me.ADRunits[i].updateBackupPower(me.backupSupply[i][0],me.backupSupply[i][1]) + me.ADIRunits[i].updateBackupPower(me.backupSupply[i][0],me.backupSupply[i][1]) } # Update ADR units - me.ADRunits[i].update(); + me.ADIRunits[i].update(); - if (me.ADRunits[i].operative != me._oldOperative[i]) { - me._oldOperative[i] = me.ADRunits[i].operative; - if (me.ADRunits[i].outputOn) { - me.Operating.adr[i].setValue(me.ADRunits[i].operative); + if (me.ADIRunits[i].operative != me._cacheOperative[i] or me.ADIRunits[i].outputOn != me._cacheOutputOn[i]) { + me._cacheOperative[i] = me.ADIRunits[i].operative; + me._cacheOutputOn[i] = me.ADIRunits[i].outputOn; + if (me.ADIRunits[i].outputOn) { + me.Operating.adr[i].setValue(me.ADIRunits[i].operative); } else { me.Operating.adr[i].setValue(0); } diff --git a/Nasal/ADIRS/SwitchingPanel.nas b/Nasal/ADIRS/SwitchingPanel.nas index 64b90e51..96066a20 100644 --- a/Nasal/ADIRS/SwitchingPanel.nas +++ b/Nasal/ADIRS/SwitchingPanel.nas @@ -7,5 +7,26 @@ var SwitchingPanel = { Switches: { attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"), airData: props.globals.getNode("/controls/navigation/switching/air-data"), + eisDmc: props.globals.getNode("/controls/navigation/switching/eis-dmc"), + }, + + doAirData: func(newAirData) { + if (newAirData < -1 or newAirData > 1) { return; } + me.Switches.airData.setValue(newAirData); + atc.transponderPanel.updateAirData(); + if (newAirData == -1) { + dmc.DMController.DMCs[0].changeActiveADIRS(2); + dmc.DMController.DMCs[1].changeActiveADIRS(1); + } elsif (newAirData == 1) { + dmc.DMController.DMCs[0].changeActiveADIRS(0); + dmc.DMController.DMCs[1].changeActiveADIRS(2); + } elsif (newAirData == 0) { + dmc.DMController.DMCs[0].changeActiveADIRS(0); + dmc.DMController.DMCs[1].changeActiveADIRS(1); + } + }, + doEisDMC: func(newDMC) { + if (newDMC < -1 or newDMC > 1) { return; } + me.Switches.eisDMC.setValue(newDMC); }, }; \ No newline at end of file diff --git a/Nasal/DMC.nas b/Nasal/DMC.nas new file mode 100644 index 00000000..0a6c5ee1 --- /dev/null +++ b/Nasal/DMC.nas @@ -0,0 +1,70 @@ +# A3XX Display System +# Jonathan Redpath (legoboyvdlp) + +# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) + +var DMC = { + _set: 0, + _setNil: 0, + + activeADIRS: -9, + + 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)], + 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)], + + outputs: [nil, nil, nil], # airspeed, altitude, mach + + new: func(num) { + var d = { parents:[DMC] }; + d.activeADIRS = num; + d.outputs = [nil, nil, nil]; + return d; + }, + changeActiveADIRS: func(newADIRS) { + me.activeADIRS = newADIRS; + me._set = 0; + }, + setOutputs: func(ADIRS) { + me.outputs[0] = me.airspeeds[ADIRS]; + me.outputs[2] = me.machs[ADIRS]; + }, + setOutputsNil: func() { + me.outputs[0] = nil; + me.outputs[1] = nil; + me.outputs[2] = nil; + }, + update: func() { + if (systems.ADIRSnew.ADIRunits[me.activeADIRS].operative and systems.ADIRSnew.ADIRunits[me.activeADIRS].outputOn) { + if (me._set != 1) { + me._setNil = 0; + me.setOutputs(me.activeADIRS); + me._setADIRS = me.activeADIRS; + me._set = 1; + } + } else { + if (me._setNil != 1) { + me._set = 0; + me.setOutputsNil(); + me._setNil = 1; + } + } + }, +}; + +var DMController = { + _init: 0, + i: nil, # to make sure scope remains local use me.i + DMCs: [nil, nil, nil], + + init: func() { + if (!me._init) { + me.DMCs = [DMC.new(0), DMC.new(1), DMC.new(2)]; + me._init = 1; + } + }, + loop: func() { + for (me.i = 0; me.i < 3; me.i = me.i + 1) { + me.DMCs[me.i].update(); + } + }, +}; \ No newline at end of file diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 5e9a7f90..db1cc45c 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -163,6 +163,7 @@ var status = { var ECAM_controller = { _recallCounter: 0, + _noneActive: 0, init: func() { ECAMloopTimer.start(); me.reset(); @@ -315,6 +316,7 @@ var ECAM_controller = { } }, recall: func() { + me._noneActive = 1; me._recallCounter = 0; foreach (var w; warnings.vector) { if (w.clearFlag == 1) { @@ -322,9 +324,13 @@ var ECAM_controller = { w.clearFlag = 0; me._recallCounter += 1; } + + if (w.active == 1) { + me._noneActive = 0; + } } - if (me._recallCounter == 0) { + if (me._recallCounter == 0 and me._noneActive) { FWC.Btn.recallStsNormal.setValue(1); settimer(func() { if (FWC.Btn.recallStsNormal.getValue() == 1) { # catch unexpected error, trying something new here diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index d7bce3c2..e02cbffd 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -973,7 +973,7 @@ var messages_priority_3 = func { var messages_priority_2 = func { phaseVar = phaseNode.getValue(); # DC EMER CONFIG - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8 and dcEmerconfig.clearFlag == 0) { dcEmerconfig.active = 1; dcEmerconfigManOn.active = 1; } else { @@ -981,7 +981,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcEmerconfigManOn); } - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8 and dcBus12Fault.clearFlag == 0) { dcBus12Fault.active = 1; dcBus12FaultBlower.active = 1; dcBus12FaultExtract.active = 1; @@ -997,7 +997,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBus12FaultBrking); } - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.acEss.getValue() < 110 and phaseVar != 4 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.acEss.getValue() < 110 and phaseVar != 4 and phaseVar != 8 and AcBusEssFault.clearFlag == 0) { AcBusEssFault.active = 1; if (!systems.ELEC.Switch.acEssFeed.getBoolValue()) { AcBusEssFaultFeed.active = 1; @@ -1011,7 +1011,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(AcBusEssFaultAtc); } - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac1.getValue() < 110 and phaseVar != 4 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac1.getValue() < 110 and phaseVar != 4 and phaseVar != 8 and AcBus1Fault.clearFlag == 0) { AcBus1Fault.active = 1; AcBus1FaultBlower.active = 1; } else { @@ -1019,7 +1019,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(AcBus1FaultBlower); } - if (!dcEmerconfig.active and systems.ELEC.Bus.dcEss.getValue() < 25 and phaseVar != 4 and phaseVar != 8) { + if (!dcEmerconfig.active and systems.ELEC.Bus.dcEss.getValue() < 25 and phaseVar != 4 and phaseVar != 8 and DcEssBusFault.clearFlag == 0) { DcEssBusFault.active = 1; DcEssBusFaultRadio.active = 1; DcEssBusFaultRadio2.active = 1; @@ -1033,7 +1033,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(DcEssBusFaultGPWS); } - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac2.getValue() < 110 and phaseVar != 4 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac2.getValue() < 110 and phaseVar != 4 and phaseVar != 8 and AcBus2Fault.clearFlag == 0) { AcBus2Fault.active = 1; AcBus2FaultExtract.active = 1; } else { @@ -1041,7 +1041,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(AcBus2FaultExtract); } - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() >= 25 and phaseVar != 4 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() >= 25 and phaseVar != 4 and phaseVar != 8 and dcBus1Fault.clearFlag == 0) { dcBus1Fault.active = 1; dcBus1FaultBlower.active = 1; dcBus1FaultExtract.active = 1; @@ -1051,7 +1051,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBus1FaultExtract); } - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() >= 25 and systems.ELEC.Bus.dc2.getValue() <= 25 and phaseVar != 4 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() >= 25 and systems.ELEC.Bus.dc2.getValue() <= 25 and phaseVar != 4 and phaseVar != 8 and dcBus2Fault.clearFlag == 0) { dcBus2Fault.active = 1; dcBus2FaultAirData.active = 1; dcBus2FaultBaro.active = 1; @@ -1061,13 +1061,13 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBus2FaultBaro); } - if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dcBat.getValue() < 25 and phaseVar != 4 and phaseVar != 5 and phaseVar != 7 and phaseVar != 8) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dcBat.getValue() < 25 and phaseVar != 4 and phaseVar != 5 and phaseVar != 7 and phaseVar != 8 and dcBusBatFault.clearFlag == 0) { dcBusBatFault.active = 1; } else { ECAM_controller.warningReset(dcBusBatFault); } - if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.dcEssShed.getValue() < 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and phaseVar != 4 and phaseVar != 8) { + if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.dcEssShed.getValue() < 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and phaseVar != 4 and phaseVar != 8 and dcBusEssShed.clearFlag == 0) { dcBusEssShed.active = 1; dcBusEssShedExtract.active = 1; dcBusEssShedIcing.active = 1; @@ -1077,7 +1077,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBusEssShedIcing); } - if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.acEssShed.getValue() < 110 and systems.ELEC.Bus.acEss.getValue() >= 110 and phaseVar != 4 and phaseVar != 8) { + if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.acEssShed.getValue() < 110 and systems.ELEC.Bus.acEss.getValue() >= 110 and phaseVar != 4 and phaseVar != 8 and acBusEssShed.clearFlag == 0) { acBusEssShed.active = 1; if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config")) { acBusEssShedAtc.active = 1; @@ -1089,7 +1089,13 @@ var messages_priority_2 = func { ECAM_controller.warningReset(acBusEssShedAtc); } - if (fcu.FCUController.FCU1.failed and fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25 and systems.ELEC.Bus.dcEss.getValue() >= 25) { + if (phaseVar != 3 and phaseVar != 4 and phaseVar != 7 and systems.ELEC.Bus.ac1.getValue() and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) { + tcasFault.active = 1; + } else { + ECAM_controller.warningReset(tcasFault); + } + + if (fcu.FCUController.FCU1.failed and fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and fcuFault.clearFlag == 0) { fcuFault.active = 1; fcuFaultBaro.active = 1; } else { @@ -1097,7 +1103,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(fcuFaultBaro); } - if (fcu.FCUController.FCU1.failed and !fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25) { + if (fcu.FCUController.FCU1.failed and !fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25 and fcuFault1.clearFlag == 0) { fcuFault1.active = 1; fcuFault1Baro.active = 1; } else { @@ -1105,7 +1111,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(fcuFault1Baro); } - if (fcu.FCUController.FCU2.failed and !fcu.FCUController.FCU1.failed and systems.ELEC.Bus.dc2.getValue() >= 25) { + if (fcu.FCUController.FCU2.failed and !fcu.FCUController.FCU1.failed and systems.ELEC.Bus.dc2.getValue() >= 25 and fcuFault2.clearFlag == 0) { fcuFault2.active = 1; fcuFault2Baro.active = 1; } else { diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 126ba6e6..18829e5b 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -221,6 +221,9 @@ var warnings = std.Vector.new([ var acBusEssShed = warning.new(msg: "ELEC DC ESS BUS SHED", colour: "a", aural: 1, light: 1), var acBusEssShedAtc = warning.new(msg: " -ATC..............SYS 2", colour: "c"), + # TCAS FAULT + var tcasFault = warning.new(msg: "NAV TCAS FAULT", colour: "a", aural: 1, light: 1), + # FCU fault var fcuFault = warning.new(msg: "AUTO FLT FCU 1+2 FAULT", colour: "a", aural: 1, light: 1, hasSubmsg: 1), var fcuFaultBaro = warning.new(msg: " -PFD BARO REF: STD ONLY", colour: "c"), @@ -245,7 +248,6 @@ var warnings = std.Vector.new([ var apuLoopBFault = warning.new(msg: "APU FIRE LOOP B FAULT", colour: "a"), var crgFwdFireDetFault = warning.new(msg: "FWD CRG DET FAULT", colour: "a"), var crgAftFireDetFault = warning.new(msg: "AFT CRG DET FAULT", colour: "a"), - # Recall var recallNormal = warning.new(msg: " ", colour: "g", hasSubmsg: 1), var recallNormal1 = warning.new(msg: " ", colour: "g", hasSubmsg: 1), diff --git a/Nasal/atc.nas b/Nasal/atc.nas index d6c205e4..167e568f 100644 --- a/Nasal/atc.nas +++ b/Nasal/atc.nas @@ -9,6 +9,9 @@ var guiModes = ['OFF', 'STANDBY', 'TEST', 'GROUND', 'ON', 'ALTITUDE']; var guiNode = props.globals.getNode("/sim/gui/dialogs/radios/transponder-mode", 1); var forLoopFlag = 0; +var altimeter = props.globals.initNode("/instrumentation/transponder/altimeter-input-src", 0, "INT"); +var airspeed = props.globals.initNode("/instrumentation/transponder/airspeed-input-src", 0, "INT"); + var Transponder = { mode: 0, code: "2000", @@ -97,6 +100,8 @@ var Transponder = { return; } me.activeADIRS = newADIRS; + altimeter.setValue(newADIRS); + airspeed.setValue(newADIRS); }, modeSwitch: func(newMode) { me.mode = newMode; @@ -196,6 +201,8 @@ var transponderPanel = { # update newly selected transponder Transponders.vector[me.atcSel - 1].modeSwitch(me.modeSel); me.atcFailLight(Transponders.vector[me.atcSel - 1].failed); + + me.updateAirData(); }, modeSwitch: func(newMode) { if (newMode < 0 or newMode > 5) { @@ -223,11 +230,27 @@ var transponderPanel = { me.codeDisp = me.code; me.codeProp.setValue(sprintf("%s", me.codeDisp)); Transponders.vector[me.atcSel - 1].setCode(me.code); - } + }, + updateAirData: func() { + if (me.atcSel == 1) { + if (systems.SwitchingPanel.Switches.airData.getValue() == -1) { + Transponders.vector[0].switchADIRS(3); + } else { + Transponders.vector[0].switchADIRS(1); + } + } else { + if (systems.SwitchingPanel.Switches.airData.getValue() == 1) { + Transponders.vector[1].switchADIRS(3); + } else { + Transponders.vector[1].switchADIRS(2); + } + } + }, }; var init = func() { transponderPanel.atcSwitch(1); + transponderPanel.updateAirData(); transponderTimer.start(); } diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 86ca196f..36aa3921 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -220,6 +220,7 @@ var systemsInit = func { ecam.ECAM_controller.init(); atc.init(); fcu.FCUController.init(); + dmc.DMController.init(); } setlistener("/sim/signals/fdm-initialized", func { @@ -238,6 +239,7 @@ var systemsLoop = maketimer(0.1, func { fadec.FADEC.loop(); rmp.rmpUpdate(); fcu.FCUController.loop(); + dmc.DMController.loop(); if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/electrical/ground-cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or (getprop("/controls/gear/brake-parking") == 0 and getprop("/services/chocks/nose") == 0 and getprop("/services/chocks/left") == 0 and getprop("/services/chocks/right") == 0))) { setprop("/controls/electrical/ground-cart", 0); diff --git a/Nasal/property-tree-setup.nas b/Nasal/property-tree-setup.nas index 4ee7b847..05a81b06 100644 --- a/Nasal/property-tree-setup.nas +++ b/Nasal/property-tree-setup.nas @@ -45,6 +45,11 @@ var Instrumentation = { AirspeedIndicator: { indicatedSpdKt: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt"), }, + TCAS: { + Inputs: { + mode: props.globals.getNode("/instrumentation/tcas/inputs/mode"), + }, + }, }; var JSBSIM = { diff --git a/Systems/a320-adr.xml b/Systems/a320-adr.xml index dfd07dd1..730ca398 100644 --- a/Systems/a320-adr.xml +++ b/Systems/a320-adr.xml @@ -409,91 +409,121 @@ + + + + 5 + + + + + + /systems/navigation/probes/pitot-1 + /systems/navigation/probes/static-1 + + /systems/navigation/probes/static-1 + + 1 + + + 2 + 7 + + + 1 + + + + + 0 + 999999999999 + + + - - 5 - - - - - - /systems/navigation/probes/pitot-1 - /systems/navigation/probes/static-1 - - /systems/navigation/probes/static-1 - - 1 - - - 2 - 7 - - - 1 - - + /systems/navigation/adr/computation/mach-1-product 0.5 + + + + 5 + + + + + + /systems/navigation/probes/pitot-2 + /systems/navigation/probes/static-2 + + /systems/navigation/probes/static-2 + + 1 + + + 2 + 7 + + + 1 + + + + + 0 + 999999999999 + + + - - 5 - - - - - - /systems/navigation/probes/pitot-2 - /systems/navigation/probes/static-2 - - /systems/navigation/probes/static-2 - - 1 - - - 2 - 7 - - - 1 - - + /systems/navigation/adr/computation/mach-2-product 0.5 + + + + 5 + + + + + + /systems/navigation/probes/pitot-3 + /systems/navigation/probes/static-3 + + /systems/navigation/probes/static-3 + + 1 + + + 2 + 7 + + + 1 + + + + + 0 + 999999999999 + + + - - 5 - - - - - - /systems/navigation/probes/pitot-3 - /systems/navigation/probes/static-3 - - /systems/navigation/probes/static-3 - - 1 - - - 2 - 7 - - - 1 - - + /systems/navigation/adr/computation/mach-3-product 0.5 @@ -914,6 +944,31 @@ 5000 + + + + /instrumentation/transponder/altimeter-input-src eq 1 + + + /instrumentation/transponder/altimeter-input-src eq 2 + + + /instrumentation/transponder/altimeter-input-src eq 3 + + + + + + /instrumentation/transponder/airspeed-input-src eq 1 + + + /instrumentation/transponder/airspeed-input-src eq 2 + + + /instrumentation/transponder/airspeed-input-src eq 3 + + + diff --git a/Systems/instrumentation.xml b/Systems/instrumentation.xml index 031b46eb..3439f4cb 100644 --- a/Systems/instrumentation.xml +++ b/Systems/instrumentation.xml @@ -224,6 +224,8 @@ transponder 0 2 + /instrumentation/transponder/altimeter-input + /instrumentation/transponder/airspeed-input /instrumentation/encoder/mode-c-alt-ft /instrumentation/encoder/mode-s-alt-ft @@ -252,8 +254,6 @@ 1 380 1700 uncomment for 2019.3 --> - /systems/electrical/bus/ac-1 - 109.9 diff --git a/Systems/pfd.xml b/Systems/pfd.xml index 46ac7798..05ccae2c 100644 --- a/Systems/pfd.xml +++ b/Systems/pfd.xml @@ -174,12 +174,46 @@ - /instrumentation/airspeed-indicator/indicated-speed-kt + /systems/navigation/adr/output/cas-1 30 - /instrumentation/pfd/speed-minus-30 + /instrumentation/pfd/speed-minus-30-1 + 0 + 390 + + + + Speed Predictor Input + gain + 1.0 + + + + /systems/navigation/adr/output/cas-2 + 30 + + + + /instrumentation/pfd/speed-minus-30-2 + 0 + 390 + + + + Speed Predictor Input + gain + 1.0 + + + + /systems/navigation/adr/output/cas-3 + 30 + + + + /instrumentation/pfd/speed-minus-30-3 0 390 @@ -193,12 +227,57 @@ 0.01 + + Speed Predictor (Smoothed) + false + /instrumentation/pfd/speed-minus-30-1 + /instrumentation/pfd/speed-lookahead-cmd-1 + 10.0 + 0.01 + + + + Speed Predictor (Smoothed) + false + /instrumentation/pfd/speed-minus-30-2 + /instrumentation/pfd/speed-lookahead-cmd-2 + 10.0 + 0.01 + + + + Speed Predictor (Smoothed) + false + /instrumentation/pfd/speed-minus-30-3 + /instrumentation/pfd/speed-lookahead-cmd-3 + 10.0 + 0.01 + + Speed Predictor Exponential false exponential - /instrumentation/pfd/speed-lookahead-cmd - /instrumentation/pfd/speed-lookahead + /instrumentation/pfd/speed-lookahead-cmd-1 + /instrumentation/pfd/speed-lookahead-1 + 0.32 + + + + Speed Predictor Exponential + false + exponential + /instrumentation/pfd/speed-lookahead-cmd-2 + /instrumentation/pfd/speed-lookahead-2 + 0.32 + + + + Speed Predictor Exponential + false + exponential + /instrumentation/pfd/speed-lookahead-cmd-3 + /instrumentation/pfd/speed-lookahead-3 0.32