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(efb): store pax seating in LVars (vs local storage) #7442

Closed
wants to merge 16 commits into from

Conversation

2hwk
Copy link
Member

@2hwk 2hwk commented Aug 27, 2022

Fixes #[issue_no]

Summary of Changes

This is part 1 of a multi-part refactor, the next will be to move the boarding/cargo loading and synchronization of payload weights (the backend) into WASM (rust).

The first stage of this refactor is to move 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.

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 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.

Changes

  • Fix bug where fuel page was not being properly overriden by the EFB payload page
  • Adds seat type for widebody aircraft.
  • Improves compatibility with non-A320 aircraft
  • Allows external apps and WASM to manipulate passenger seating
  • Allows passenger seating to be saved/loaded from .FLT files

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).
  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.

Check GSX Integration still works

There's a few things to be aware of when using GSX Sync.

  • 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.
  • 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

  • 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: refer to loadsheet json for pax and cargo stations refactor(efb): refer to loadsheet json for pax and cargo stations Aug 27, 2022
@2hwk 2hwk marked this pull request as ready for review August 30, 2022 06:28
@2hwk 2hwk added this to the v0.9.0 milestone Sep 2, 2022
beheh
beheh previously requested changes Sep 19, 2022
src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx Outdated Show resolved Hide resolved
src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx Outdated Show resolved Hide resolved
src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx Outdated Show resolved Hide resolved
src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx Outdated Show resolved Hide resolved
src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx Outdated Show resolved Hide resolved
@2hwk

This comment was marked as outdated.

@2hwk 2hwk marked this pull request as draft October 2, 2022 09:55
@2hwk 2hwk force-pushed the flypad-weight-balance branch from b2bb2a0 to c61f2e9 Compare October 16, 2022 04:36
@2hwk

This comment was marked as outdated.

@2hwk 2hwk marked this pull request as ready for review October 16, 2022 04:42
@2hwk 2hwk force-pushed the flypad-weight-balance branch from c61f2e9 to 68e6377 Compare October 16, 2022 06:02
@2hwk 2hwk marked this pull request as draft October 21, 2022 11:58
@2hwk 2hwk force-pushed the flypad-weight-balance branch from cd40270 to 7685f8c Compare October 24, 2022 13:06
@2hwk 2hwk removed this from the v0.10.0 milestone Oct 30, 2022
@2hwk 2hwk force-pushed the flypad-weight-balance branch from 7685f8c to 7f87227 Compare December 21, 2022 12:13
@2hwk 2hwk changed the title refactor(efb): refer to loadsheet json for pax and cargo stations refactor(efb): store pax seating in LVars (vs local storage) Dec 21, 2022
@2hwk 2hwk marked this pull request as ready for review December 31, 2022 07:02
@2hwk 2hwk force-pushed the flypad-weight-balance branch from 9677bdf to 842e447 Compare December 31, 2022 07:03
@2hwk 2hwk removed the Waiting for PR merge Waiting for PR to be merged to fix the issue. label Jan 14, 2023
@2hwk 2hwk force-pushed the flypad-weight-balance branch from 9781499 to 8b19239 Compare January 14, 2023 03:13
@2hwk 2hwk mentioned this pull request Jan 14, 2023
22 tasks
2hwk added a commit that referenced this pull request Jan 15, 2023
@2hwk 2hwk added the Waiting for PR merge Waiting for PR to be merged to fix the issue. label Jan 17, 2023
2hwk added a commit that referenced this pull request Jan 18, 2023
@2hwk
Copy link
Member Author

2hwk commented Jan 22, 2023

Closing for now as this will be delayed until after #7695 has been merged

@2hwk 2hwk closed this Jan 22, 2023
@2hwk 2hwk deleted the flypad-weight-balance branch April 29, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for PR merge Waiting for PR to be merged to fix the issue. Waiting on Core Decision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants