forked from flybywiresim/aircraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(GSX): Fixed GSX pin not actually disabling NWS (flybywiresim#8403)
* Fixed FSX pin not actually disabling NWS * implemented change for 380 as well * refactored previous solution to be more isolated * added changes to a380 as well * Moved the handling of GSX var into aspect layer * fix lint * style fix
- Loading branch information
1 parent
22559ed
commit 04f2e43
Showing
9 changed files
with
124 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
fbw-common/src/wasm/systems/systems/src/hydraulic/bypass_pin.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use super::nose_steering::Pushback; | ||
use crate::simulation::{ | ||
InitContext, Read, SimulationElement, SimulatorReader, SimulatorWriter, VariableIdentifier, | ||
Write, | ||
}; | ||
|
||
pub struct BypassPin { | ||
nw_strg_disc_memo_id: VariableIdentifier, | ||
gsx_pin_state_id: VariableIdentifier, | ||
|
||
gsx_pin_inserted: bool, | ||
bypass_pin_inserted: bool, | ||
} | ||
|
||
impl BypassPin { | ||
pub fn new(context: &mut InitContext) -> Self { | ||
Self { | ||
gsx_pin_state_id: context.get_identifier("EXTERNAL_BYPASS_PIN_INSERTED".to_owned()), | ||
gsx_pin_inserted: false, | ||
bypass_pin_inserted: false, | ||
nw_strg_disc_memo_id: context.get_identifier("HYD_NW_STRG_DISC_ECAM_MEMO".to_owned()), | ||
} | ||
} | ||
pub fn update(&mut self, fbw_tug: &impl Pushback) { | ||
self.bypass_pin_inserted = | ||
fbw_tug.is_nose_wheel_steering_pin_inserted() || self.gsx_pin_inserted; | ||
} | ||
|
||
pub fn is_nose_wheel_steering_pin_inserted(&self) -> bool { | ||
self.bypass_pin_inserted | ||
} | ||
} | ||
|
||
impl SimulationElement for BypassPin { | ||
fn read(&mut self, reader: &mut SimulatorReader) { | ||
self.gsx_pin_inserted = reader.read(&self.gsx_pin_state_id); | ||
} | ||
|
||
fn write(&self, writer: &mut SimulatorWriter) { | ||
writer.write(&self.nw_strg_disc_memo_id, self.bypass_pin_inserted); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.