Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(w&b): rust refactor of payload management #7715

Merged
merged 50 commits into from Apr 1, 2023

Conversation

2hwk
Copy link
Member

@2hwk 2hwk commented Jan 15, 2023

Fixes #[issue_no]

Summary of Changes

Applied ontop of GSX Integration to ensure compatibility with new backend refactoring.
See: #7442 for more information and #7695

This refactor:

  • Optimisation and bug fixes for the EFB Payload page.
    • Better support for mixed seating classes and staggered rows
  • Moves the bitwise flags that control passenger seating from localStorage (Which is slow and can only be accessed via coherentJS) into LocalVars instead, as well as to deprecate the old TOTAL_ROWS_{}_{} Local:Vars which are redundant with this bitpacked pax representation.
  • Moves the boarding logic from javascript into rust (WASM), allowing for more complex bit manipulation, which is a good optimization and slightly noticeable performance bump (when boarding and navigating the EFB page). We can also utilise trait to pipe this data into other modules.

This has several benefits:

  • Performance is much faster than using LocalStorage, where before frametimes could spike by 20ms or more with just 4 pax stations when trying to store several pax flag vars, now the impact is barely noticable to the end user (~1-2ms, which can be further improved).

  • Enables state saving/loading of seating by MSFS's default save file system

  • Allows manipulation of passenger seating in WASM (rust/C++), and allows other systems to be able to read current passenger location on a per passenger level of granularity (vs per section/payload station as before)

  • External programs can now set a seating layout:

    • Either by first setting the relevant PAX_FLAG_{}_DESIRED Local:Var with a bitpacked 64-bit long number, i.e. 7, or 1111111 would set the first 7 seats in a passenger section (station) as seated, then start the boarding by setting the BOARDING_STARTED_BY_USR Local:Var as true. This will start the boarding process as though it was triggered by the EFB.
    • Or setting three variables PAX_FLAG_DESIRED_{} andPAX_FLAG_{} directly alongside writing the relevant aircraft variable PAYLOAD STATION WEIGHT:{}
    • Note that in this first iteration this is still fairly limited, and boarding time when using the boarding system is limited by the user's boarding time setting. As such this is not the beginning of official support for this feature, this is a stepping stone only

Changes

Screenshots (if necessary)

No visual changes

References

Additional context

Discord username (if different from GitHub):2Cas#1022

Testing instructions

Payload page should work as before

New Payload Backend

1. Go to Ground > Services page and check that all elements are correctly rendered
2. Go to Payload page,
3. Adjust seating by clicking on the seating layout. This should add new seats and increase the table value for planned passengers.
4. Add baggage by clicking on the 4 sliders, this should affect the desired cargo value in the table.
5. Change per passenger and per bag weight from 84 and 20 to higher/lower values (or leave at default)
6. Input desired passenger and desired cargo in the table
7. Check that ZFW calculation is accurate (Empty Weight is 42500KG, add passenger, passenger bags and cargo weight to this value and this should match desired ZFW)
8. Board passengers with desired time setting (Real/Fast/Instant). Should be able to change speed while passengers are boarding and have it transition between boarding times seamlessly.
9. Deboard passengers (either by inputting in the table, or clicking on the seating layout, or using the deboard button).
10. Go to the main EFB dashboard by clicking the FBW Logo in the top left, import a simbrief OFP
11. Go back to the payload page and click the cloud icon next to the table to load the OFP. Check that all relevant table values are correctly imported.
12. Load passengers/cargo again
13. Fill out INIT-A and INIT-B in MCDU (Init fuel pred). Check that MLDW indicator now shows on the performance envelope chart.
14. Proceed with normal flight operations. Check that when in air, MTOW envelope is replaced by the FLIGHT envelope.
15. Check that visuals in all themes (dark/light/blue) are correct and readable, with both bright daytime and at night (in sim time)
16. Press COND page and check that air conditioning is still functioning as expected when the air conditioning knobs are adjusted.
17. Create a new save file with the new seating loadout, then load it. The seating layout should show when you go into the EFB's payload page. <- Delayed/Not Officially supported for now (watch this space)
18. Check that all the above steps work for LBS as well as KG

Check GSX Integration still works

There's a few things to be aware of when using GSX Sync. PLEASE READ each of these carefully, documentation is planned for release.

NOTE: There are some bugs with GSX core (not related to this PR) that occur when using jet bridges occasionally, so for the purposes of testing, if this is encountered please take note.

  • There's a new page in the EFB settings labelled 3rd Party Options. Inside there are two options to give you the freedom on what to sync with GSX. This activates the synchronisation. Without it GSX won't sync as expected. It's important to note various items and fields get disabled in the payload and fuel page with these options enabled.
  • De-fueling Is NOT supported, GSX only checks if the fuel has changed to a number higher than the current value. If you call the refueling truck and attempt to defuel, the aircraft will defuel but GSX will nag you to change fuel and not actually do anything, constantly nagging you.
  • Fueling is managed by A32NX, GSX simply acts as a visual indicator here which allows the user to still use Instant/Fast/Real options in the EFB. However, Fuel cannot be started until the fueling truck has connected the hose as shown by a grey start button. The fueling truck will remain and count for the duration of the fueling period set by A32NX, you will of course get a bill as usual.
  • You must set your amount of passengers before GSX boarding, whether through simbrief sync in the EFB or manually in the payload page. Same goes for cargo. Once GSX boarding has been requested, these fields CANNOT be edited until deboarding (meaning an entire flight)
  • Boarding is managed by GSX (in a sense), this means you cannot adjust the boarding times in the EFB, you can only adjust boarding time, through GSX's own settings. If one physical passengers boards the aircraft through GSX, then A32NX's Boarding backend is made aware and acts accordingly. Passenger seats are still loaded in the same way they would without GSX Sync.
  • The same is regarded with Cargo/Baggage, however due to limitations with the simvars available from GSX, all stations are loaded at the same time. So if GSX says baggage is 33% loaded, all stations will be loaded to 33% of their given weight target. This removed a bit of the randomness to loading but the limitations is out of my hands.

An aircraft profile is provided, you don't need to do anything GSX picks up on this

  • With this profile, the aft passenger door is disabled and the the aft cargo door as-well. This is because these doors can't be opened from the EFB. The aft service door is not disabled, but must be manually opened through the EFB. I'll try and notify the GSX team on the simvars to open this door. So you won't have to in the future.
  • Ensure simbrief loading still performs as before in EFB
  • Fueling
    • Test GSX properly plays the re-fueling animation when you begin refueling with the EFB
    • Test the refueling animation correctly stops when the EFB stops refueling the aircraft
    • Test the refueling animation is instant when you're using Instant refueling time
    • Ensure you can still refuel in-flight with GSX Fuel Sync enabled
  • Payload
    • Set in the EFB how much passengers you want as-well as cargo, to notify GSX of these details.
    • Ensure passenger current in EFB, matches GSX tooltip
    • Confirm as GSX baggage tooltip percentage increase, current cargo weight increase in EFB
    • Ensure baggage weight decreases when deboarding
    • Ensure passenger amount decreases when deboarding
    • Ensure passenger/cargo amount in EFB cannot be modified after boarding is requested and only appears again after deboarding is completed

How to download the PR for QA

Every new commit to this PR will cause a new A32NX artifact to be created, built, and uploaded.

  1. Make sure you are signed in to GitHub
  2. Click on the Checks tab on the PR
  3. On the left side, click on the bottom PR tab
  4. Click on the A32NX download link at the bottom of the page

@2hwk 2hwk changed the title refactor: #7442 flypad boarding refactor >> #7695 GSX integration refactor(efb): #7442 flypad boarding refactor >> #7695 GSX integration Jan 17, 2023
@2hwk 2hwk added this to the v0.10.0 milestone Jan 21, 2023
@2hwk 2hwk added Waiting for PR merge Waiting for PR to be merged to fix the issue. Waiting on Core Decision labels Jan 21, 2023
@2hwk
Copy link
Member Author

2hwk commented Jan 22, 2023

This will now probably be delayed until after boarding.rs rust implementation is completed

@2hwk 2hwk changed the title refactor(efb): #7442 flypad boarding refactor >> #7695 GSX integration refactor(efb): Rust refactor of pax boarding >> #7442 + #7695 GSX integration Jan 28, 2023
@2hwk 2hwk changed the title refactor(efb): Rust refactor of pax boarding >> #7442 + #7695 GSX integration refactor(w&b): Rust refactor of pax boarding >> #7442 + #7695 GSX integration Jan 28, 2023
@2hwk 2hwk marked this pull request as ready for review January 29, 2023 04:20
@github-actions github-actions bot added this to 🟡 Code Review: Ready for Review in Quality Assurance Jan 29, 2023
@2hwk 2hwk force-pushed the flypad-weight-balance-gsx branch 3 times, most recently from b668224 to b99f60e Compare January 29, 2023 04:34
@2hwk 2hwk added the QA Tier 2 label Jan 29, 2023
@2hwk 2hwk marked this pull request as draft January 29, 2023 04:50
@2hwk 2hwk marked this pull request as ready for review January 29, 2023 07:09
@2hwk 2hwk marked this pull request as draft January 29, 2023 17:09
@2hwk 2hwk force-pushed the flypad-weight-balance-gsx branch 3 times, most recently from 60ac5d0 to e1c7ac1 Compare February 4, 2023 12:26
@2hwk 2hwk removed the Waiting for PR merge Waiting for PR to be merged to fix the issue. label Feb 11, 2023
@2hwk 2hwk changed the base branch from feature/gsx-integration to master February 11, 2023 01:23
@2hwk 2hwk force-pushed the flypad-weight-balance-gsx branch 2 times, most recently from b96135c to 807f35b Compare February 11, 2023 01:36
@2hwk 2hwk changed the title refactor(w&b): Rust refactor of pax boarding >> #7442 + #7695 GSX integration refactor(w&b): Rust refactor of pax boarding Feb 11, 2023
@2hwk 2hwk marked this pull request as ready for review February 11, 2023 01:43
@2hwk 2hwk marked this pull request as draft February 11, 2023 01:43
@2hwk
Copy link
Member Author

2hwk commented Mar 23, 2023

Note: Need to resolve an issue with unit conversion already noted by testers

@2hwk 2hwk removed Critical Bug Must be fixed ASAP Do Not Merge labels Mar 26, 2023
@2hwk 2hwk changed the title refactor(w&b): Rust refactor of pax boarding refactor(w&b): Rust refactor of payload management Mar 27, 2023
@2hwk 2hwk changed the title refactor(w&b): Rust refactor of payload management refactor(w&b): rust refactor of payload management Mar 27, 2023
@2hwk 2hwk moved this from 🟣 QA Team Review: Ready to Test to ⌛ Awaiting Actions in Quality Assurance Mar 30, 2023
igor8518 pushed a commit to igor8518/a32nx that referenced this pull request Apr 1, 2023
@2hwk 2hwk removed the QA Tier 2 label Apr 1, 2023
@2hwk
Copy link
Member Author

2hwk commented Apr 1, 2023

QA Report

  • Go to Payload page,
  • Adjust seating by clicking on the seating layout. This should add new seats and increase the table value for planned passengers.
  • Add baggage by clicking on the 4 sliders, this should affect the desired cargo value in the table.
  • Change per passenger and per bag weight from 84 and 20 to higher/lower values (or leave at default)
  • Input desired passenger and desired cargo in the table
  • Check that ZFW calculation is accurate (Empty Weight is 42500KG, add passenger, passenger bags and cargo weight to this value and this should match desired ZFW)
  • Board passengers with desired time setting (Real/Fast/Instant). Should be able to change speed while passengers are boarding and have it transition between boarding times seamlessly.
  • Deboard passengers (either by inputting in the table, or clicking on the seating layout, or using the deboard button).
  • Go to the main EFB dashboard by clicking the FBW Logo in the top left, import a simbrief OFP
  • Go back to the payload page and click the cloud icon next to the table to load the OFP. Check that all relevant table values are correctly imported.
  • Load passengers/cargo again
  • Proceed with normal flight operations. Check that when in air, MTOW envelope is replaced by the FLIGHT envelope.
  • Check that visuals in all themes (dark/light/blue) are correct and readable, with both bright daytime and at night (in sim time)
  • Press COND page and check that air conditioning is still functioning as expected when the air conditioning knobs are adjusted.
  • Create a new save file with the new seating loadout, then load it. The seating layout should show when you go into the EFB's payload page.
  • Check that all the above steps work for LBS as well as KG. For simbrief import, KG exports should import correctly into the flypad in both KG/LBs, LBS export should import correctly to the flypad in both KG/LBS

Negatives:

  • Bug with repeatedly mashing clicks on seating map is still not fixed, but this is a somewhat difficult case to crack and not addressed by this PR.

Result:

  • Pass

@2hwk 2hwk merged commit 9a1e358 into master Apr 1, 2023
6 checks passed
Quality Assurance automation moved this from ⌛ Awaiting Actions to ✔️ Done Apr 1, 2023
@2hwk 2hwk removed the Exp Available on experimental branch (for testing) label Apr 2, 2023
@2hwk 2hwk deleted the flypad-weight-balance-gsx branch April 29, 2023 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants