diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg index 0cf07510902..be3f520f2f5 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg @@ -19,7 +19,7 @@ ; 13 Sept 2024 fixed some invalid entries in the trigger section -; 13 Oct 2024 Fixed numerous issues with the fuel system +; 22 Oct 2024 Fixed numerous issues with the fuel system. Code added to address MSFS fuel system issues and restrict transfers until airplane is in flight. [VERSION] major = 1 @@ -329,7 +329,7 @@ Junction.8 = Name:FeedTanks2_3Junction1#InputOnlyLines:FwdGalleryJuncToFeedTanks Junction.9 = Name:FeedTanks2_3Junction2#InputOnlyLines:FwdGalleryJuncToFeedTanks2_3Junc2#OutputOnlyLines:FeedTanks2_3Junc2ToFeedTank2FwdXferValve2_1,FeedTanks2_3Junc2ToFeedTank3FwdXferValve2_1,FeedTanks2_3Junc2ToFeedTank2FwdXferValve2_2,FeedTanks2_3Junc2ToFeedTank3FwdXferValve2_2#Option:FeedTanks2_3Junc2ToFeedTank2FwdXferValve2_1,FeedTanks2_3Junc2ToFeedTank3FwdXferValve2_1#Option:FeedTanks2_3Junc2ToFeedTank2FwdXferValve2_2,FeedTanks2_3Junc2ToFeedTank3FwdXferValve2_2#Option:FwdGalleryJuncToFeedTanks2_3Junc2 -Junction.10 = Name:AftGalleryJunction1#InputOnlyLines:LeftMidTankPumpAftToAftGalleryJunction1,LeftInnerTankPumpAftToAftGalleryJunction1,RightMidTankPumpAftToAftGalleryJunction1,RightInnerTankPumpAftToAftGalleryJunction1,TrimLineIsoValveAft_1ToAftGalleryJunction1,TrimLineIsoValveAft_2ToAftGalleryJunction1#OutputOnlyLines:AftGalleryJunction1ToAftGalleryJunction2,AftGalleryJunction1ToLeftInnerAftXferValve1,AftGalleryJunction1ToLeftMidAftXferValve1,AftGalleryJunction1ToLeftOuterAftXferValve1,AftGalleryJunction1ToRightInnerAftXferValve1,AftGalleryJunction1ToRightMidAftXferValve1,AftGalleryJunction1ToRightOuterAftXferValve1,AftGalleryJunction1ToJetissonNozzleValveLeft,AftGalleryJunction1ToJetissonNozzleValveRight#Option:AftGalleryJunction1ToLeftInnerAftXferValve1,AftGalleryJunction1ToRightInnerAftXferValve1#Option:AftGalleryJunction1ToLeftMidAftXferValve1,AftGalleryJunctionToRightMidAftXferValve1#Option:AftGalleryJunction1ToAftGalleryJunction2 +Junction.10 = Name:AftGalleryJunction1#InputOnlyLines:LeftMidTankPumpAftToAftGalleryJunction1,LeftInnerTankPumpAftToAftGalleryJunction1,RightMidTankPumpAftToAftGalleryJunction1,RightInnerTankPumpAftToAftGalleryJunction1,TrimLineIsoValveAft_1ToAftGalleryJunction1,TrimLineIsoValveAft_2ToAftGalleryJunction1#OutputOnlyLines:AftGalleryJunction1ToAftGalleryJunction2,AftGalleryJunction1ToLeftInnerAftXferValve1,AftGalleryJunction1ToLeftMidAftXferValve1,AftGalleryJunction1ToLeftOuterAftXferValve1,AftGalleryJunction1ToRightInnerAftXferValve1,AftGalleryJunction1ToRightMidAftXferValve1,AftGalleryJunction1ToRightOuterAftXferValve1,AftGalleryJunction1ToJetissonNozzleValveLeft,AftGalleryJunction1ToJetissonNozzleValveRight#Option:AftGalleryJunction1ToLeftInnerAftXferValve1,AftGalleryJunction1ToRightInnerAftXferValve1#Option:AftGalleryJunction1ToLeftMidAftXferValve1,AftGalleryJunction1ToRightMidAftXferValve1#Option:AftGalleryJunction1ToAftGalleryJunction2 Junction.11 = Name:AftGalleryJunction2#InputOnlyLines:AftGalleryJunction1ToAftGalleryJunction2#OutputOnlyLines:AftGalleryJunction2ToFeedTank1AftXferValve1,AftGalleryJunction2ToFeedTank2AftXferValve1,AftGalleryJunction2ToFeedTank3AftXferValve1,AftGalleryJunction2ToFeedTank4AftXferValve1 Junction.12 = Name:CrossFeedJunc1 Junction.13 = Name:CrossFeedJunc2 @@ -435,11 +435,11 @@ Trigger.14 = Name:MidBelow8000ThresholdFeed2Start#Condition:Manual#EffectTrue:Op Trigger.15 = Name:MidBelow8000ThresholdFeed3Start#Condition:Manual#EffectTrue:OpenValve.FeedTank3FwdTransferValve1_2,OpenValve.FeedTank3FwdTransferValve2_2 Trigger.16 = Name:MidBelow8000ThresholdFeed2End#Condition:Manual#EffectTrue:CloseValve.FeedTank2FwdTransferValve1_2,CloseValve.FeedTank2FwdTransferValve2_2 Trigger.17 = Name:MidBelow8000ThresholdFeed3End#Condition:Manual#EffectTrue:CloseValve.FeedTank3FwdTransferValve1_2,CloseValve.FeedTank3FwdTransferValve2_2 -Trigger.18 = Name:Equalize1and3forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank1FwdTransferValve1,OpenValve.FeedTank1FwdTransferValve2,OpenValve.FeedTank3FwdTransferValve2_2 -Trigger.19 = Name:Equalize1and2forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank1FwdTransferValve1,OpenValve.FeedTank1FwdTransferValve2,OpenValve.OpenValve.FeedTank2FwdTransferValve2_2 -Trigger.20 = Name:Equalize2and4forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank2FwdTransferValve2_2,OpenValve.FeedTank4FwdTransferValve1,OpenValve.FeedTank4FwdTransferValve2 -Trigger.21 = Name:Equalize3and4forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank3FwdTransferValve2_2,OpenValve.FeedTank4FwdTransferValve1,OpenValve.FeedTank4FwdTransferValve2 -Trigger.22 = Name:MidTankLeftEmpty#Condition:Manual#EffectTrue:StopPump.LeftMidTankPumpFwd,SetJunction.FwdGalleryJunction.1,SetJunction.FeedTanks2_3Junction1.1,SetJunction.FeedTanks2_3Junction2.1,CloseValve.LeftMidAftTransferValve2,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2#EffectFalse:CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2,OpenValve.LeftMidAftTransferValve2,StartPump.LeftMidTankPumpFwd +Trigger.18 = Name:Equalize1and3forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank1FwdTransferValve2,OpenValve.FeedTank3FwdTransferValve2_2 +Trigger.19 = Name:Equalize1and2forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank1FwdTransferValve2,OpenValve.OpenValve.FeedTank2FwdTransferValve2_2 +Trigger.20 = Name:Equalize2and4forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank2FwdTransferValve2_2,OpenValve.FeedTank4FwdTransferValve2 +Trigger.21 = Name:Equalize3and4forMidBelow8000#Condition:Manual#EffectTrue:OpenValve.FeedTank3FwdTransferValve2_2,OpenValve.FeedTank4FwdTransferValve2 +Trigger.22 = Name:MidTankLeftEmpty#Condition:Manual#EffectTrue:StopPump.LeftMidTankPumpFwd,CloseValve.LeftMidAftTransferValve2,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2#EffectFalse:CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2,OpenValve.LeftMidAftTransferValve2,StartPump.LeftMidTankPumpFwd Trigger.23 = Name:MidTankRightEmpty#Condition:Manual#EffectTrue:StopPump.RightMidTankPumpFwd,CloseValve.RightMidAftTransferValve2,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2#EffectFalse:CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2,OpenValve.RightMidAftTransferValve2,StartPump.RightMidTankPumpFwd Trigger.24 = Name:TrimTankTransferToFeedTank1#Condition:Manual#EffectTrue:OpenValve.TrimLineIsolationValveAft_1,OpenValve.FeedTank1AftTransferValve1,StartPump.TrimTankPumpLeft,StartPump.TrimTankPumpRight,CloseValve.FeedTank1FwdTransferValve1,CloseValve.FeedTank1FwdTransferValve2,CloseValve.FeedTank2FwdTransferValve1_1,CloseValve.FeedTank2FwdTransferValve2_1,CloseValve.FeedTank2FwdTransferValve1_2,CloseValve.FeedTank2FwdTransferValve2_2,CloseValve.FeedTank3FwdTransferValve1_1,CloseValve.FeedTank3FwdTransferValve2_1,CloseValve.FeedTank3FwdTransferValve1_2,CloseValve.FeedTank3FwdTransferValve2_2,CloseValve.FeedTank4FwdTransferValve1,CloseValve.FeedTank4FwdTransferValve2,SetJunction.FwdGalleryJunction.3 Trigger.25 = Name:TrimTankTransferToFeedTank2#Condition:Manual#EffectTrue:OpenValve.TrimLineIsolationValveAft_1,OpenValve.FeedTank2AftTransferValve1,StartPump.TrimTankPumpLeft,StartPump.TrimTankPumpRight,CloseValve.FeedTank1FwdTransferValve1,CloseValve.FeedTank1FwdTransferValve2,CloseValve.FeedTank2FwdTransferValve1_1,CloseValve.FeedTank2FwdTransferValve2_1,CloseValve.FeedTank2FwdTransferValve1_2,CloseValve.FeedTank2FwdTransferValve2_2,CloseValve.FeedTank3FwdTransferValve1_1,CloseValve.FeedTank3FwdTransferValve2_1,CloseValve.FeedTank3FwdTransferValve1_2,CloseValve.FeedTank3FwdTransferValve2_2,CloseValve.FeedTank4FwdTransferValve1,CloseValve.FeedTank4FwdTransferValve2,SetJunction.FeedTanks2_3Junction1.3,SetJunction.FeedTanks2_3Junction2.3 @@ -449,7 +449,7 @@ Trigger.28 = Name:Equalize1and3#Condition:Manual#EffectTrue:OpenValve.FeedTank1A Trigger.29 = Name:Equalize1and2#Condition:Manual#EffectTrue:OpenValve.FeedTank1AftTransferValve1,OpenValve.FeedTank2AftTransferValve1 Trigger.30 = Name:Equalize2and4#Condition:Manual#EffectTrue:OpenValve.FeedTank2AftTransferValve1,OpenValve.FeedTank4AftTransferValve1 Trigger.31 = Name:Equalize3and4#Condition:Manual#EffectTrue:OpenValve.FeedTank3AftTransferValve1,OpenValve.FeedTank4AftTransferValve1 -Trigger.32 = Name:TrimTankEmpty#Condition:Manual#EffectTrue:StopPump.TrimTankPumpLeft,StopPump.TrimTankPumpRight,CloseValve.TrimLineIsolationValveAft,SetJunction.FwdGalleryJunction.1,SetJunction.FeedTanks2_3Junction1.1,SetJunction.FeedTanks2_3Junction2.1#EffectFalse:StopPump.RightOuterTankPump,StopPump.LeftOuterTankPump,OpenValve.TrimLineIsolationValveAft +Trigger.32 = Name:TrimTankEmpty#Condition:Manual#EffectTrue:StopPump.TrimTankPumpLeft,StopPump.TrimTankPumpRight,CloseValve.TrimLineIsolationValveAft#EffectFalse:StopPump.RightOuterTankPump,StopPump.LeftOuterTankPump,OpenValve.TrimLineIsolationValveAft Trigger.33 = Name:OuterTanksTransferToFeedTank1&4Start1#Condition:Manual#EffectTrue:StartPump.LeftOuterTankPump,StartPump.RightOuterTankPump,OpenValve.FeedTank1FwdTransferValve1,OpenValve.FeedTank4FwdTransferValve1,SetJunction.FwdGalleryJunction.1 Trigger.34 = Name:OuterTanksTransferToFeedTank2&3Start2#Condition:Manual#EffectTrue:StartPump.LeftOuterTankPump,StartPump.RightOuterTankPump,OpenValve.FeedTank2FwdTransferValve1_1,OpenValve.FeedTank3FwdTransferValve1_1,SetJunction.FeedTanks2_3Junction1.1,SetJunction.FeedTanks2_3Junction2.1 Trigger.35 = Name:OuterTanksTransferToFeedTank1&4Start4#Condition:Manual#EffectTrue:StartPump.LeftOuterTankPump,StartPump.RightOuterTankPump,OpenValve.FeedTank1FwdTransferValve1,OpenValve.FeedTank4FwdTransferValve1,SetJunction.FwdGalleryJunction.1 @@ -482,8 +482,8 @@ Trigger.42 = Name:CGControlTransferEnd#Condition:Manual#EffectTrue:CloseValve.Tr ;Trigger.19 = Name:Equalize1and2forMidBelow8000#Target:Feed1,Feed2#Threshold:2#Condition:TankAbsImbalanceBelow#EffectTrue:OpenValve.FeedTank1FwdTransferValve1,OpenValve.FeedTank1FwdTransferValve2,OpenValve.OpenValve.FeedTank2FwdTransferValve2_2 ;Trigger.20 = Name:Equalize2and4forMidBelow8000#Target:Feed2,Feed4#Threshold:2#Condition:TankAbsImbalanceBelow#EffectTrue:OpenValve.FeedTank2FwdTransferValve2_2,OpenValve.FeedTank4FwdTransferValve1,OpenValve.FeedTank4FwdTransferValve2 ;Trigger.21 = Name:Equalize3and4forMidBelow8000#Target:Feed3,Feed4#Threshold:2#Condition:TankAbsImbalanceBelow#EffectTrue:OpenValve.FeedTank3FwdTransferValve2_2,OpenValve.FeedTank4FwdTransferValve1,OpenValve.FeedTank4FwdTransferValve2 -;Trigger.22 = Name:MidTankLeftEmpty#Target:LeftMid#Threshold:0.1#Condition:TankQuantityBelow#EffectTrue:StopPump.LeftMidTankPumpFwd,SetJunction.FwdGalleryJunction.1,SetJunction.FeedTanks2_3Junction1.1,SetJunction.FeedTanks2_3Junction2.1,CloseValve.LeftMidAftTransferValve2,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2,SetJunction.AftGalleryJunction1.3#EffectFalse:CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2,OpenValve.LeftMidAftTransferValve2,StartPump.LeftMidTankPumpFwd -;Trigger.23 = Name:MidTankRightEmpty#Target:RightMid#Threshold:0.1#Condition:TankQuantityBelow#EffectTrue:StopPump.RightMidTankPumpFwd,CloseValve.RightMidAftTransferValve2,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2#EffectFalse:CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2,OpenValve.RightMidAftTransferValve2,StartPump.RightMidTankPumpFwd +;Trigger.22 = Name:MidTankLeftEmpty#Target:LeftMid#Threshold:0.1#Condition:TankQuantityBelow#EffectTrue:StopPump.LeftMidTankPumpFwd,CloseValve.LeftMidAftTransferValve2,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2,SetJunction.AftGalleryJunction1.3#EffectFalse:CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2,OpenValve.LeftMidAftTransferValve2,StartPump.LeftMidTankPumpFwd +;Trigger.23 = Name:MidTankRightEmpty#Target:RightMid#Threshold:0.1#Condition:TankQuantityBelow#EffectTrue:StopPump.RightMidTankPumpFwd,CloseValve.RightMidAftTransferValve2,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2,CloseValve.FeedTank1AftTransferValve1,CloseValve.FeedTank2AftTransferValve1,CloseValve.FeedTank3AftTransferValve1,CloseValve.FeedTank4AftTransferValve1#EffectFalse:CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2,OpenValve.RightMidAftTransferValve2,StartPump.RightMidTankPumpFwd ;Trigger.24 = Name:TrimTankTransferToFeedTank1#Target:Feed1#Threshold:1974#Condition:TankQuantityBelow#EffectTrue:OpenValve.TrimLineIsolationValveAft_1,OpenValve.FeedTank1AftTransferValve1,StartPump.TrimTankPumpLeft,StartPump.TrimTankPumpRight,CloseValve.FeedTank1FwdTransferValve1,CloseValve.FeedTank1FwdTransferValve2,CloseValve.FeedTank2FwdTransferValve1_1,CloseValve.FeedTank2FwdTransferValve2_1,CloseValve.FeedTank2FwdTransferValve1_2,CloseValve.FeedTank2FwdTransferValve2_2,CloseValve.FeedTank3FwdTransferValve1_1,CloseValve.FeedTank3FwdTransferValve2_1,CloseValve.FeedTank3FwdTransferValve1_2,CloseValve.FeedTank3FwdTransferValve2_2,CloseValve.FeedTank4FwdTransferValve1,CloseValve.FeedTank4FwdTransferValve2,SetJunction.FwdGalleryJunction.3 ;Trigger.25 = Name:TrimTankTransferToFeedTank2#Target:Feed2#Threshold:1974#Condition:TankQuantityBelow#EffectTrue:OpenValve.TrimLineIsolationValveAft_1,OpenValve.FeedTank2AftTransferValve1,StartPump.TrimTankPumpLeft,StartPump.TrimTankPumpRight,CloseValve.FeedTank1FwdTransferValve1,CloseValve.FeedTank1FwdTransferValve2,CloseValve.FeedTank2FwdTransferValve1_1,CloseValve.FeedTank2FwdTransferValve2_1,CloseValve.FeedTank2FwdTransferValve1_2,CloseValve.FeedTank2FwdTransferValve2_2,CloseValve.FeedTank3FwdTransferValve1_1,CloseValve.FeedTank3FwdTransferValve2_1,CloseValve.FeedTank3FwdTransferValve1_2,CloseValve.FeedTank3FwdTransferValve2_2,CloseValve.FeedTank4FwdTransferValve1,CloseValve.FeedTank4FwdTransferValve2,SetJunction.FeedTanks2_3Junction1.3,SetJunction.FeedTanks2_3Junction2.3 ;Trigger.26 = Name:TrimTankTransferToFeedTank3#Target:Feed3#Threshold:1974#Condition:TankQuantityBelow#EffectTrue:OpenValve.TrimLineIsolationValveAft_1,OpenValve.FeedTank3AftTransferValve1,StartPump.TrimTankPumpLeft,StartPump.TrimTankPumpRight,CloseValve.FeedTank1FwdTransferValve1,CloseValve.FeedTank1FwdTransferValve2,CloseValve.FeedTank2FwdTransferValve1_1,CloseValve.FeedTank2FwdTransferValve2_1,CloseValve.FeedTank2FwdTransferValve1_2,CloseValve.FeedTank2FwdTransferValve2_2,CloseValve.FeedTank3FwdTransferValve1_1,CloseValve.FeedTank3FwdTransferValve2_1,CloseValve.FeedTank3FwdTransferValve1_2,CloseValve.FeedTank3FwdTransferValve2_2,CloseValve.FeedTank4FwdTransferValve1,CloseValve.FeedTank4FwdTransferValve2,SetJunction.FeedTanks2_3Junction1.3,SetJunction.FeedTanks2_3Junction2.3 @@ -502,7 +502,7 @@ Trigger.42 = Name:CGControlTransferEnd#Condition:Manual#EffectTrue:CloseValve.Tr ;Trigger.39 = Name:OuterTanksTransferToFeedTank3End#Target:Feed3#Threshold:1481#Condition:TankQuantityAbove#EffectTrue:CloseValve.FeedTank3FwdTransferValve1_1 ;Trigger.40 = Name:OuterTanksTransferToFeedTank4End#Target:Feed4#Threshold:1481#Condition:TankQuantityAbove#EffectTrue:CloseValve.FeedTank4FwdTransferValve1 ;Trigger.41 = Name:CGControlTransferStart#Threshold:0.415#Condition:CGAboveLimit#EffectTrue:OpenValve.TrimLineIsolationValveAft_2,OpenValve.LeftInnerAftTransferValve1,OpenValve.RightInnerAftTransferValve1,OpenValve.LeftMidAftTransferValve1,OpenValve.RightMidAftTransferValve1,OpenValve.FeedTank1AftTransferValve2,OpenValve.FeedTank2AftTransferValve2,OpenValve.FeedTank3AftTransferValve2,OpenValve.FeedTank4AftTransferValve2,StartPump.TrimTankPumpLeft,StartPump.TrimTankPumpRight -;Trigger.42 = Name:CGControlTransferEnd#Threshold:0.405#Condition:CGBelowLimit#EffectTrue:CloseValve.TrimLineIsolationValveAft_2,CloseValve.LeftInnerAftTransferValve1,CloseValve.RightInnerAftTransferValve1,CloseValve.LeftMidAftTransferValve1,CloseValve.RightMidAftTransferValve1,CloseValve.FeedTank1AftTransferValve2,CloseValve.FeedTank2AftTransferValve2,CloseValve.FeedTank3AftTransferValve2,CloseValve.FeedTank4AftTransferValve2 +;Trigger.42 = Name:CGControlTransferEnd#Threshold:0.405#Condition:CGBelowLimit#EffectTrue:CloseValve.TrimLineIsolationValveAft_2,CloseValve.LeftInnerAftTransferValve1,CloseValve.RightInnerAftTransferValve1,CloseValve.LeftMidAftTransferValve1,CloseValve.RightMidAftTransferValve1 [AIRPLANE_GEOMETRY] diff --git a/fbw-a380x/src/systems/shared/src/UpdateThrottler.ts b/fbw-a380x/src/systems/shared/src/UpdateThrottler.ts deleted file mode 100644 index 3b0d7b15acd..00000000000 --- a/fbw-a380x/src/systems/shared/src/UpdateThrottler.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Utility class to throttle instrument updates - */ -export class UpdateThrottler { - private intervalMs: number; - - private currentTime: number; - - private lastUpdateTime: number; - - private refreshOffset: number; - - private refreshNumber: number; - - /** - * @param {number} intervalMs Interval between updates, in milliseconds - */ - constructor(intervalMs) { - this.intervalMs = intervalMs; - this.currentTime = 0; - this.lastUpdateTime = 0; - - // Take a random offset to space out updates from different instruments among different - // frames as much as possible. - this.refreshOffset = Math.floor(Math.random() * intervalMs); - this.refreshNumber = 0; - } - - /** - * Checks whether the instrument should be updated in the current frame according to the - * configured update interval. - * - * @param {number} deltaTime - * @param {boolean} [forceUpdate = false] - True if you want to force an update during this frame. - * @returns -1 if the instrument should not update, or the time elapsed since the last - * update in milliseconds - */ - canUpdate(deltaTime, forceUpdate = false) { - this.currentTime += deltaTime; - const number = Math.floor((this.currentTime + this.refreshOffset) / this.intervalMs); - const update = number > this.refreshNumber; - this.refreshNumber = number; - if (update || forceUpdate) { - const accumulatedDelta = this.currentTime - this.lastUpdateTime; - this.lastUpdateTime = this.currentTime; - return accumulatedDelta; - } - return -1; - } -} diff --git a/fbw-a380x/src/systems/systems-host/index.ts b/fbw-a380x/src/systems/systems-host/index.ts index fb2b4d0b53a..807dee04163 100644 --- a/fbw-a380x/src/systems/systems-host/index.ts +++ b/fbw-a380x/src/systems/systems-host/index.ts @@ -94,7 +94,8 @@ class SystemsHost extends BaseInstrument { private readonly fwsCore = new FwsCore(1, this.bus); - private readonly legacyFuel = new LegacyFuel(this.bus); + //FIXME add some deltatime functionality to backplane instruments so we dont have to pass SystemHost + private readonly legacyFuel = new LegacyFuel(this.bus, this); /** * "mainmenu" = 0 diff --git a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts index 81dfe76980b..513f05eb0a9 100644 --- a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts +++ b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts @@ -846,8 +846,6 @@ export class FwsCore { public readonly feedTank2LowConfirm = new NXLogicConfirmNode(30, true); - public readonly leftOuterInnerValve = ConsumerSubject.create(this.sub.on('fuel_valve_open_4'), 0); - public readonly feedTank3Low = Subject.create(false); public readonly feedTank3LowConfirm = new NXLogicConfirmNode(30, true); @@ -858,8 +856,6 @@ export class FwsCore { public readonly leftFuelPump2Auto = ConsumerSubject.create(this.sub.on('fuel_pump_switch_5'), false); - public readonly rightOuterInnerValve = ConsumerSubject.create(this.sub.on('fuel_valve_open_5'), 0); - public readonly rightFuelLow = Subject.create(false); public readonly rightFuelLowConfirm = new NXLogicConfirmNode(30, true); @@ -1633,10 +1629,8 @@ export class FwsCore { !this.engine4ValueSwitch.get() && !this.centerFuelPump1Auto.get() && !this.centerFuelPump2Auto.get() && - !this.leftOuterInnerValve.get() && !this.leftFuelPump1Auto.get() && !this.leftFuelPump2Auto.get() && - !this.rightOuterInnerValve.get() && !this.rightFuelPump1Auto.get() && !this.rightFuelPump2Auto.get() && this.allEngineSwitchOff.get(), diff --git a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsMemos.ts b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsMemos.ts index e0d1eda9d5a..b3dedc1f279 100644 --- a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsMemos.ts +++ b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsMemos.ts @@ -48,22 +48,6 @@ export class FwsMemos { sysPage: -1, side: 'RIGHT', }, - - '0000105': { - // OUTR TK FUEL XFRD - flightPhaseInhib: [], // Plus check that outer tanks not empty - simVarIsActive: MappedSubject.create( - ([leftOuterInnerValve, rightOuterInnerValve]) => !!leftOuterInnerValve || !!rightOuterInnerValve, - this.fws.leftOuterInnerValve, - this.fws.rightOuterInnerValve, - ), - whichCodeToReturn: () => [0], - codesToReturn: ['000010501'], // config memo - memoInhibit: () => this.fws.toMemo.get() === 1 || this.fws.ldgMemo.get() === 1, - failure: 0, - sysPage: -1, - side: 'RIGHT', - }, '0000060': { // SPEED BRK flightPhaseInhib: [], diff --git a/fbw-a380x/src/systems/systems-host/systems/LegacyFuel.ts b/fbw-a380x/src/systems/systems-host/systems/LegacyFuel.ts index 478152cb36b..5cce48ba993 100644 --- a/fbw-a380x/src/systems/systems-host/systems/LegacyFuel.ts +++ b/fbw-a380x/src/systems/systems-host/systems/LegacyFuel.ts @@ -1,4 +1,4 @@ -import { MathUtils } from '@flybywiresim/fbw-sdk'; +import { MathUtils, UpdateThrottler } from '@flybywiresim/fbw-sdk'; import { ConsumerSubject, EventBus, @@ -24,7 +24,6 @@ export class LegacyFuel implements Instrument { private keyEventManager?: KeyEventManager; - private readonly leftOuterTankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_1'), 0); private readonly feed1TankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_2'), 0); private readonly leftMidTankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_3'), 0); private readonly leftInnerTankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_4'), 0); @@ -33,7 +32,6 @@ export class LegacyFuel implements Instrument { private readonly rightInnerTankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_7'), 0); private readonly rightMidTankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_8'), 0); private readonly feed4TankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_9'), 0); - private readonly rightOuterTankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_10'), 0); private readonly trimTankQty = ConsumerSubject.create(this.sub.on('fuel_tank_quantity_11'), 0); private readonly refuelStarted = ConsumerSubject.create(this.sub.on('fuel_refuel_started_by_user'), false); @@ -44,9 +42,16 @@ export class LegacyFuel implements Instrument { private readonly junctionSettings = new Map>(); + private readonly throttler = new UpdateThrottler(250); + private refuelInProgress = false; - constructor(private readonly bus: EventBus) { + private hasInit = false; + + constructor( + private readonly bus: EventBus, + private readonly sysHost: BaseInstrument, + ) { KeyEventManager.getManager(bus).then((manager) => { this.keyEventManager = manager; }); @@ -67,6 +72,7 @@ export class LegacyFuel implements Instrument { SimVar.SetSimVarValue('L:A32NX_FUEL_DESIRED', 'kilograms', fuelWeight); Wait.awaitSubscribable(GameStateProvider.get(), (state) => state === GameState.ingame, true).then(() => { this.checkEmptyTriggers(); + this.hasInit = true; }); } @@ -127,6 +133,13 @@ export class LegacyFuel implements Instrument { } public onUpdate(): void { + const dt = this.sysHost.deltaTime; + const totalDtSinceLastUpdate = this.throttler.canUpdate(dt); + + if (!this.hasInit || totalDtSinceLastUpdate <= 0) { + return; + } + const onGround = SimVar.GetSimVarValue('SIM ON GROUND', 'bool'); if (this.refuelStarted.get()) { this.refuelInProgress = true; @@ -141,260 +154,249 @@ export class LegacyFuel implements Instrument { } else if (!onGround) { this.checkEmptyTriggers(); + const cgTargetStart = this.calculateCGTarget(this.aircraftWeightInLBS.get() / 1000); + const cgTargetStop = cgTargetStart - 1; + if ( (this.feed1TankQty.get() < 6436 && !this.triggerStates.get(1).get()) || (this.feed1TankQty.get() >= 6437 && this.triggerStates.get(1).get()) ) { this.toggleTrigger(1); } - if ( (this.feed2TankQty.get() < 6857 && !this.triggerStates.get(2).get()) || (this.feed2TankQty.get() >= 6858 && this.triggerStates.get(2).get()) ) { this.toggleTrigger(2); } - if ( (this.feed3TankQty.get() < 6857 && !this.triggerStates.get(3).get()) || (this.feed3TankQty.get() >= 6858 && this.triggerStates.get(3).get()) ) { this.toggleTrigger(3); } - if ( (this.feed4TankQty.get() < 6436 && !this.triggerStates.get(4).get()) || (this.feed4TankQty.get() >= 6437 && this.triggerStates.get(4).get()) ) { this.toggleTrigger(4); } - if ( (Math.abs(this.feed1TankQty.get() - this.feed4TankQty.get()) < 2 && !this.triggerStates.get(5).get()) || (Math.abs(this.feed1TankQty.get() - this.feed4TankQty.get()) >= 3 && this.triggerStates.get(5).get()) ) { this.toggleTrigger(5); } - if ( (Math.abs(this.feed2TankQty.get() - this.feed3TankQty.get()) < 2 && !this.triggerStates.get(6).get()) || (Math.abs(this.feed2TankQty.get() - this.feed3TankQty.get()) >= 3 && this.triggerStates.get(6).get()) ) { this.toggleTrigger(6); } - if ( (this.feed1TankQty.get() > 6765 && !this.triggerStates.get(7).get()) || (this.feed1TankQty.get() <= 6764 && this.triggerStates.get(7).get()) ) { this.toggleTrigger(7); } - if ( (this.feed2TankQty.get() > 7186 && !this.triggerStates.get(8).get()) || (this.feed2TankQty.get() <= 7186 && this.triggerStates.get(8).get()) ) { this.toggleTrigger(8); } - if ( (this.feed3TankQty.get() > 7186 && !this.triggerStates.get(9).get()) || (this.feed3TankQty.get() <= 7186 && this.triggerStates.get(9).get()) ) { this.toggleTrigger(9); } - if ( (this.feed4TankQty.get() > 6765 && !this.triggerStates.get(10).get()) || (this.feed4TankQty.get() <= 6764 && this.triggerStates.get(10).get()) ) { this.toggleTrigger(10); } - if ( (this.leftMidTankQty.get() < 1316 && !this.triggerStates.get(13).get()) || (this.leftMidTankQty.get() >= 1317 && this.triggerStates.get(13).get()) ) { this.toggleTrigger(13); } - if ( (this.feed2TankQty.get() < 6436 && !this.triggerStates.get(14).get()) || (this.feed2TankQty.get() >= 6437 && this.triggerStates.get(14).get()) ) { this.toggleTrigger(14); } - if ( (this.feed3TankQty.get() < 6436 && !this.triggerStates.get(15).get()) || (this.feed3TankQty.get() >= 6437 && this.triggerStates.get(15).get()) ) { this.toggleTrigger(15); } - if ( (this.feed2TankQty.get() > 6765 && !this.triggerStates.get(16).get()) || (this.feed2TankQty.get() <= 6764 && this.triggerStates.get(16).get()) ) { this.toggleTrigger(16); } - if ( (this.feed3TankQty.get() > 6765 && !this.triggerStates.get(17).get()) || (this.feed3TankQty.get() <= 6764 && this.triggerStates.get(17).get()) ) { this.toggleTrigger(17); } - if ( - (Math.abs(this.feed1TankQty.get() - this.feed3TankQty.get()) < 2 && !this.triggerStates.get(18).get()) || - (Math.abs(this.feed1TankQty.get() - this.feed3TankQty.get()) >= 3 && this.triggerStates.get(18).get()) + (this.feed1TankQty.get() < 6765 && + this.feed3TankQty.get() < 6765 && + Math.abs(this.feed1TankQty.get() - this.feed3TankQty.get()) < 2 && + !this.triggerStates.get(18).get()) || + ((this.feed1TankQty.get() >= 6766 || + this.feed3TankQty.get() >= 6766 || + Math.abs(this.feed1TankQty.get() - this.feed3TankQty.get()) >= 3) && + this.triggerStates.get(18).get()) ) { this.toggleTrigger(18); } - if ( - (Math.abs(this.feed1TankQty.get() - this.feed2TankQty.get()) < 2 && !this.triggerStates.get(19).get()) || - (Math.abs(this.feed1TankQty.get() - this.feed2TankQty.get()) >= 3 && this.triggerStates.get(19).get()) + (this.feed1TankQty.get() < 6765 && + this.feed2TankQty.get() < 6765 && + Math.abs(this.feed1TankQty.get() - this.feed2TankQty.get()) < 2 && + !this.triggerStates.get(19).get()) || + ((this.feed1TankQty.get() >= 6766 || + this.feed2TankQty.get() >= 6766 || + Math.abs(this.feed1TankQty.get() - this.feed2TankQty.get()) >= 3) && + this.triggerStates.get(19).get()) ) { this.toggleTrigger(19); } - if ( - (Math.abs(this.feed2TankQty.get() - this.feed4TankQty.get()) < 2 && !this.triggerStates.get(20).get()) || - (Math.abs(this.feed2TankQty.get() - this.feed4TankQty.get()) >= 3 && this.triggerStates.get(20).get()) + (this.feed2TankQty.get() < 6765 && + this.feed4TankQty.get() < 6765 && + Math.abs(this.feed2TankQty.get() - this.feed4TankQty.get()) < 2 && + !this.triggerStates.get(20).get()) || + ((this.feed2TankQty.get() >= 6766 || + this.feed4TankQty.get() >= 6766 || + Math.abs(this.feed2TankQty.get() - this.feed4TankQty.get()) >= 3) && + this.triggerStates.get(20).get()) ) { this.toggleTrigger(20); } - if ( - (Math.abs(this.feed3TankQty.get() - this.feed4TankQty.get()) < 2 && !this.triggerStates.get(21).get()) || - (Math.abs(this.feed3TankQty.get() - this.feed4TankQty.get()) >= 3 && this.triggerStates.get(21).get()) + (this.feed3TankQty.get() < 6765 && + this.feed4TankQty.get() < 6765 && + Math.abs(this.feed3TankQty.get() - this.feed4TankQty.get()) < 2 && + !this.triggerStates.get(21).get()) || + ((this.feed3TankQty.get() >= 6766 || + this.feed4TankQty.get() >= 6766 || + Math.abs(this.feed3TankQty.get() - this.feed4TankQty.get()) >= 3) && + this.triggerStates.get(21).get()) ) { this.toggleTrigger(21); } - if ( (this.feed1TankQty.get() < 1974 && !this.triggerStates.get(24).get()) || (this.feed1TankQty.get() >= 1975 && this.triggerStates.get(24).get()) ) { this.toggleTrigger(24); } - if ( (this.feed2TankQty.get() < 1974 && !this.triggerStates.get(25).get()) || (this.feed2TankQty.get() >= 1975 && this.triggerStates.get(25).get()) ) { this.toggleTrigger(25); } - if ( (this.feed3TankQty.get() < 1974 && !this.triggerStates.get(26).get()) || (this.feed3TankQty.get() >= 1975 && this.triggerStates.get(26).get()) ) { this.toggleTrigger(26); } - if ( (this.feed4TankQty.get() < 1974 && !this.triggerStates.get(27).get()) || (this.feed4TankQty.get() >= 1975 && this.triggerStates.get(27).get()) ) { this.toggleTrigger(27); } - if ( (Math.abs(this.feed1TankQty.get() - this.feed3TankQty.get()) < 2 && !this.triggerStates.get(28).get()) || (Math.abs(this.feed1TankQty.get() - this.feed3TankQty.get()) >= 3 && this.triggerStates.get(28).get()) ) { this.toggleTrigger(28); } - if ( (Math.abs(this.feed1TankQty.get() - this.feed2TankQty.get()) < 2 && !this.triggerStates.get(29).get()) || (Math.abs(this.feed1TankQty.get() - this.feed2TankQty.get()) >= 3 && this.triggerStates.get(29).get()) ) { this.toggleTrigger(29); } - if ( (Math.abs(this.feed2TankQty.get() - this.feed4TankQty.get()) < 2 && !this.triggerStates.get(30).get()) || (Math.abs(this.feed2TankQty.get() - this.feed4TankQty.get()) >= 3 && this.triggerStates.get(30).get()) ) { this.toggleTrigger(30); } - if ( (Math.abs(this.feed3TankQty.get() - this.feed4TankQty.get()) < 2 && !this.triggerStates.get(31).get()) || (Math.abs(this.feed3TankQty.get() - this.feed4TankQty.get()) >= 3 && this.triggerStates.get(31).get()) ) { this.toggleTrigger(31); } - if ( (this.feed1TankQty.get() < 1316 && !this.triggerStates.get(33).get()) || (this.feed1TankQty.get() >= 1317 && this.triggerStates.get(33).get()) ) { this.toggleTrigger(33); } - if ( (this.feed2TankQty.get() < 1316 && !this.triggerStates.get(34).get()) || (this.feed2TankQty.get() >= 1317 && this.triggerStates.get(34).get()) ) { this.toggleTrigger(34); } - if ( (this.feed4TankQty.get() < 1316 && !this.triggerStates.get(35).get()) || (this.feed4TankQty.get() >= 1317 && this.triggerStates.get(35).get()) ) { this.toggleTrigger(35); } - if ( (this.feed3TankQty.get() < 1316 && !this.triggerStates.get(36).get()) || (this.feed3TankQty.get() >= 1317 && this.triggerStates.get(36).get()) ) { this.toggleTrigger(36); } - if ( (this.feed1TankQty.get() > 1481 && !this.triggerStates.get(37).get()) || (this.feed1TankQty.get() <= 1480 && this.triggerStates.get(37).get()) ) { this.toggleTrigger(37); } - if ( (this.feed2TankQty.get() > 1481 && !this.triggerStates.get(38).get()) || (this.feed2TankQty.get() <= 1480 && this.triggerStates.get(38).get()) ) { this.toggleTrigger(38); } - if ( (this.feed3TankQty.get() > 1481 && !this.triggerStates.get(39).get()) || (this.feed3TankQty.get() <= 1480 && this.triggerStates.get(39).get()) ) { this.toggleTrigger(39); } - if ( (this.feed4TankQty.get() > 1481 && !this.triggerStates.get(40).get()) || (this.feed4TankQty.get() <= 1480 && this.triggerStates.get(40).get()) ) { this.toggleTrigger(40); } - const cgTargetStart = this.calculateCGTarget(this.aircraftWeightInLBS.get() / 1000); - const cgTargetStop = cgTargetStart - 1; - if ( (this.cgPercent.get() > cgTargetStart && !this.triggerStates.get(41).get()) || (this.cgPercent.get() <= cgTargetStart - 0.1 && this.triggerStates.get(41).get()) ) { this.toggleTrigger(41); } - if ( (this.cgPercent.get() < cgTargetStop && !this.triggerStates.get(42).get()) || (this.cgPercent.get() >= cgTargetStop + 0.1 && this.triggerStates.get(42).get())