diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index a126d294..9d76c1f1 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -71,6 +71,7 @@ RamAirBtn2O SEC1Btn1F SEC1Btn2O + VentBlowBtn1F @@ -167,8 +168,6 @@ SEC2Btn2O SEC3Btn1F SEC3Btn2O - VentBlowBtn1F - VentBlowBtn2O VentExtractBtn1F VentExtractBtn2O WingAntiIceBtn1F @@ -210,7 +209,6 @@ Gen1LineBtn1S Gen1LineBtn2O RcdrGndCtlBtn2O - VentBlowBtn1F VentBlowBtn2O VentExtractBtn1F VentExtractBtn2O @@ -238,6 +236,24 @@ + + + select + VentBlowBtn1F + + + + /controls/ventilation/blowFail + 1 + + + controls/switches/annun-test + 1 + + + + + select @@ -1132,7 +1148,7 @@ - systems/failures/fac1 + systems/failures/fac1-fault 1 @@ -1400,7 +1416,7 @@ - systems/failures/fac2 + systems/failures/fac2-fault 1 @@ -2720,7 +2736,7 @@ nasal - + @@ -2785,7 +2801,7 @@ nasal - + diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index 7824001e..be8063ba 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -43,6 +43,7 @@ setlistener("/sim/signals/fdm-initialized", func { var ac1 = getprop("/systems/electrical/bus/ac1"); var ac2 = getprop("/systems/electrical/bus/ac2"); var ac_ess = getprop("/systems/electrical/bus/ac-ess"); + var dc_ess_shed = getprop("/systems/electrical/bus/dc-ess-shed"); var ac_ess_shed = getprop("/systems/electrical/bus/ac-ess-shed"); var dc1 = getprop("/systems/electrical/bus/dc1"); var dc2 = getprop("/systems/electrical/bus/dc2"); @@ -163,6 +164,7 @@ var ELEC = { setprop("/systems/electrical/bus/gen1-hz", 0); setprop("/systems/electrical/bus/gen2-hz", 0); setprop("/systems/electrical/bus/ac-ess", 0); + setprop("/systems/electrical/bus/dc-ess-shed", 0); setprop("/systems/electrical/bus/ac-ess-shed", 0); setprop("/systems/electrical/extra/ext-volts", 0); setprop("/systems/electrical/extra/apu-volts", 0); @@ -269,6 +271,7 @@ var ELEC = { ac1 = getprop("/systems/electrical/bus/ac1"); ac2 = getprop("/systems/electrical/bus/ac2"); ac_ess = getprop("/systems/electrical/bus/ac-ess"); + dc_ess_shed = getprop("/systems/electrical/bus/dc-ess-shed"); ac_ess_shed = getprop("/systems/electrical/bus/ac-ess-shed"); dc1 = getprop("/systems/electrical/bus/dc1"); dc2 = getprop("/systems/electrical/bus/dc2"); @@ -531,6 +534,12 @@ var ELEC = { setprop("/controls/electrical/switches/emer-gen", 0); } + if (emergen == 0 and ac1 == 0 and ac2 == 0) { # as far as I know dc ess is only shed when batteries only + setprop("/systems/electrical/bus/dc-ess-shed", 0); + } else { + setprop("/systems/electrical/bus/dc-ess-shed", ac_volt_std); + } + dc1 = getprop("/systems/electrical/bus/dc1"); dc2 = getprop("/systems/electrical/bus/dc2"); @@ -688,6 +697,14 @@ var ELEC = { setprop("/systems/electrical/gen2-fault", 0); } + # these two are here because they are on whenever the battery switch is on with no ac source connected (youtube) + + if ((battery1_sw or battery2_sw) and dc1 < 25 and ac1 < 110) { + setprop("/controls/ventilation/blowFail", 1); + } else { + setprop("/controls/ventilation/blowFail", 0); + } + foreach(var screena; screens) { power_consumption = screena.power_consumption(); if (getprop(screena.elec_prop) != 0) { @@ -725,19 +742,17 @@ var decharge2 = maketimer(69, func { setprop("/systems/electrical/battery2-volts", bat2_volts - 0.1); }); -var batflash = func { +var fctlpoweruptest = func { if (getprop("/systems/electrical/battery-available") == 0) { setprop("/systems/failures/elac1", 1); setprop("/systems/failures/sec1", 1); - setprop("/systems/failures/fac1", 1); setprop("/systems/electrical/battery-available", 1); settimer(func(){ setprop("/systems/failures/elac1", 0); - },1.5); + },8); settimer(func(){ setprop("/systems/failures/sec1", 0); - setprop("/systems/failures/fac1", 0); - },2); + },8.5); } } diff --git a/Nasal/it-fbw.nas b/Nasal/it-fbw.nas index c0fab015..2007a1f8 100644 --- a/Nasal/it-fbw.nas +++ b/Nasal/it-fbw.nas @@ -39,20 +39,28 @@ var fctlInit = func { var update_loop = func { var elac1_sw = getprop("/controls/fctl/elac1"); var elac2_sw = getprop("/controls/fctl/elac2"); - var sec1_sw = getprop("/controls/fctl/sec1"); - var sec2_sw = getprop("/controls/fctl/sec2"); - var sec3_sw = getprop("/controls/fctl/sec3"); - var fac1_sw = getprop("/controls/fctl/fac1"); - var fac2_sw = getprop("/controls/fctl/fac2"); + var sec1_sw = getprop("/controls/fctl/sec1"); + var sec2_sw = getprop("/controls/fctl/sec2"); + var sec3_sw = getprop("/controls/fctl/sec3"); + var fac1_sw = getprop("/controls/fctl/fac1"); + var fac2_sw = getprop("/controls/fctl/fac2"); - var elac1_fail = getprop("/systems/failures/elac1"); - var elac2_fail = getprop("/systems/failures/elac2"); - var sec1_fail = getprop("/systems/failures/sec1"); - var sec2_fail = getprop("/systems/failures/sec2"); - var sec3_fail = getprop("/systems/failures/sec3"); - var fac1_fail = getprop("/systems/failures/fac1"); - var fac2_fail = getprop("/systems/failures/fac2"); - var ac_ess = getprop("/systems/electrical/bus/ac-ess"); + var elac1_fail = getprop("/systems/failures/elac1"); + var elac2_fail = getprop("/systems/failures/elac2"); + var sec1_fail = getprop("/systems/failures/sec1"); + var sec2_fail = getprop("/systems/failures/sec2"); + var sec3_fail = getprop("/systems/failures/sec3"); + var fac1_fail = getprop("/systems/failures/fac1"); + var fac2_fail = getprop("/systems/failures/fac2"); + + var ac_ess = getprop("/systems/electrical/bus/ac-ess"); + var dc_ess_shed = getprop("/systems/electrical/bus/dc-ess-shed"); + var ac1 = getprop("/systems/electrical/bus/ac1"); + var ac2 = getprop("/systems/electrical/bus/ac2"); + var dc1 = getprop("/systems/electrical/bus/dc1"); + var dc2 = getprop("/systems/electrical/bus/dc2"); + var battery1_sw = getprop("/controls/electrical/switches/battery1"); + var battery2_sw = getprop("/controls/electrical/switches/battery2"); if (elac1_sw and !elac1_fail and ac_ess >= 110) { setprop("/systems/fctl/elac1", 1); @@ -104,20 +112,36 @@ var update_loop = func { setprop("/systems/failures/spoiler-r2", 1); } - if (fac1_sw and !fac1_fail and ac_ess >= 110) { + if (fac1_sw and !fac1_fail and (ac_ess >= 110 or dc_ess_shed >= 25)) { setprop("/systems/fctl/fac1", 1); setprop("/systems/failures/rudder", 0); + setprop("/systems/failures/fac1-fault", 0); + } else if (fac1_sw and (battery1_sw or battery2_sw) and (fac1_fail or ac_ess < 110 or dc_ess_shed < 25)) { + setprop("/systems/failures/fac1-fault", 1); + setprop("/systems/fctl/fac1", 0); + if (!fac2_sw or fac2_fail) { + setprop("/systems/failures/rudder", 1); + } } else { + setprop("/systems/failures/fac1-fault", 0); setprop("/systems/fctl/fac1", 0); if (!fac2_sw or fac2_fail) { setprop("/systems/failures/rudder", 1); } } - if (fac2_sw and !fac2_fail and ac_ess >= 110) { + if (fac2_sw and !fac2_fail and (ac2 >= 110 or dc2 >= 25)) { setprop("/systems/fctl/fac2", 1); + setprop("/systems/failures/fac2-fault", 0); + } else if (fac2_sw and (fac2_fail or ac2 < 110 or dc2 < 25)) { + setprop("/systems/failures/fac2-fault", 1); + setprop("/systems/fctl/fac2", 0); + if (!fac1_sw or fac1_fail) { + setprop("/systems/failures/rudder", 1); + } } else { setprop("/systems/fctl/fac2", 0); + setprop("/systems/failures/fac2-fault", 0); if (!fac1_sw or fac1_fail) { setprop("/systems/failures/rudder", 1); }