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

feat(efb): Add estimated boarding time #7583

Conversation

ChristianLutzCL
Copy link
Contributor

Fixes #7418

Summary of Changes

Added estimated boarding time to payload view like in fuel view

Screenshots (if necessary)

image

References


Additional context

Discord username (if different from GitHub):

Testing instructions

  1. Load aircraft with engines off
  2. Open 'Payload' on EFB
  3. Set PAX and/or CARGO -> watch 'Estimated duration'
  4. Change loading time Instant/Fast/Real -> watch 'Estimated duration'
  5. Start Boarding -> watch 'Estimated duration'

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 added the Waiting for PR merge Waiting for PR to be merged to fix the issue. label Nov 19, 2022
@2hwk
Copy link
Member

2hwk commented Nov 19, 2022

May conflict with #7604

@frankkopp
Copy link
Member

Please add your Discord account name so we can contact you regarding this PR. Thanks
Cdr_Maverick#6475

@frankkopp
Copy link
Member

Suggestion:
image

This is compatible with #7604.

Also fixes a label which has been forgotten to include in localisation: "Loading Time"

Index: src/instruments/src/EFB/Localization/en.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/instruments/src/EFB/Localization/en.json b/src/instruments/src/EFB/Localization/en.json
--- a/src/instruments/src/EFB/Localization/en.json	(revision f61ee2b3546cc4fda3a419e21a0a4b4fece1615a)
+++ b/src/instruments/src/EFB/Localization/en.json	(date 1668876427250)
@@ -157,6 +157,8 @@
       "DeboardConfirmationBody":"Please confirm deboarding all passengers",
       "DeboardConfirmationConfirm": "Deboard",
       "DeboardConfirmationCancel":"Cancel",
+      "EstimatedDurationUnit": "minutes",
+      "LoadingTime": "Loading Time",
       "TT": {
         "AircraftMustBeColdAndDarkToChangeBoardingTimes": "Aircraft Must Be On the Ground and Have Engines Shutdown to Change Boarding Duration",
         "FillPayloadFromSimbrief": "Fill Payload Information from Simbrief",
Index: src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx b/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx
--- a/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx	(revision f61ee2b3546cc4fda3a419e21a0a4b4fece1615a)
+++ b/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx	(date 1668876836968)
@@ -356,6 +356,34 @@
         setBoardingStarted(false);
     };
 
+    // TODO: Rework A32NX_Boarding to make boardingRateMultiplier obsolete. (msDelay)
+    const calculateBoardingTime = () => {
+        let estimatedTimeSeconds = 0;
+        let estimatedPaxBoardingSeconds = 0;
+        let estimatedCargoLoadingSeconds = 0;
+        const boardingRateMultiplier = 5;
+        const differentialPax = Math.abs(totalPaxDesired - totalPax);
+        const differentialCargo = Math.abs(totalCargoDesired - totalCargo);
+
+        if (boardingRate === 'REAL') {
+            estimatedPaxBoardingSeconds += differentialPax * boardingRateMultiplier;
+            estimatedCargoLoadingSeconds += (differentialCargo / 60) * boardingRateMultiplier;
+        } else if (boardingRate === 'FAST') {
+            estimatedPaxBoardingSeconds += differentialPax;
+            estimatedCargoLoadingSeconds += (differentialCargo / 60);
+        }
+
+        if (estimatedPaxBoardingSeconds > estimatedCargoLoadingSeconds) {
+            const differentialLoadingTime = Math.abs(estimatedPaxBoardingSeconds - estimatedCargoLoadingSeconds);
+            estimatedTimeSeconds = estimatedPaxBoardingSeconds + differentialLoadingTime;
+        } else {
+            const differentialLoadingTime = Math.abs(estimatedCargoLoadingSeconds - estimatedPaxBoardingSeconds);
+            estimatedTimeSeconds = estimatedCargoLoadingSeconds + differentialLoadingTime;
+        }
+
+        return Math.round(estimatedTimeSeconds / 60);
+    };
+
     const boardingStatusClass = useMemo(() => {
         if (!boardingStarted) {
             return 'text-theme-highlight';
@@ -803,7 +831,14 @@
                         <div className="flex flex-row mt-4">
                             <Card className="w-full h-full" childrenContainerClassName="flex flex-col w-full h-full">
                                 <div className="flex flex-row justify-between items-center">
-                                    <div className="flex font-medium">Loading Time </div>
+                                    <div className="flex font-medium">
+                                        {t('Ground.Payload.LoadingTime')}
+                                        <span className="flex relative flex-row items-center ml-2 text-sm font-light">
+                                            (
+                                            {`${calculateBoardingTime()} ${t('Ground.Payload.EstimatedDurationUnit')}`}
+                                            )
+                                        </span>
+                                    </div>
 
                                     <SelectGroup>
                                         <SelectItem
´´´

@ChristianLutzCL
Copy link
Contributor Author

Thanks for the suggestions.
I had placed the loading time there so that it is consistent with the fuel loading time. But in this case it might fit better here.

@ChristianLutzCL
Copy link
Contributor Author

Suggestion: image

This is compatible with #7604.

Also fixes a label which has been forgotten to include in localisation: "Loading Time"

Index: src/instruments/src/EFB/Localization/en.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/instruments/src/EFB/Localization/en.json b/src/instruments/src/EFB/Localization/en.json
--- a/src/instruments/src/EFB/Localization/en.json	(revision f61ee2b3546cc4fda3a419e21a0a4b4fece1615a)
+++ b/src/instruments/src/EFB/Localization/en.json	(date 1668876427250)
@@ -157,6 +157,8 @@
       "DeboardConfirmationBody":"Please confirm deboarding all passengers",
       "DeboardConfirmationConfirm": "Deboard",
       "DeboardConfirmationCancel":"Cancel",
+      "EstimatedDurationUnit": "minutes",
+      "LoadingTime": "Loading Time",
       "TT": {
         "AircraftMustBeColdAndDarkToChangeBoardingTimes": "Aircraft Must Be On the Ground and Have Engines Shutdown to Change Boarding Duration",
         "FillPayloadFromSimbrief": "Fill Payload Information from Simbrief",
Index: src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================

Found out, there is a "BoardingTime" localization already there that wasn't used.
The question is whether "boarding" is the right term for it.

Unbenannt

@frankkopp
Copy link
Member

Found out, there is a "BoardingTime" localization already there that wasn't used. The question is whether "boarding" is the right term for it.

Unbenannt

Was probably planned to be used for the term LoadingTime. I'd say ignore it - I can remove it from the localisation later - it is not used anywhere.

@frankkopp frankkopp self-requested a review November 21, 2022 23:40
@frankkopp
Copy link
Member

@ChristianLutzCL
Copy link
Contributor Author

Could you please fix the linter issues: https://github.com/flybywiresim/a32nx/actions/runs/3517102399/jobs/5903358028 image

Should be fixed now.

@frankkopp frankkopp added QA Tier 1 and removed Waiting for PR merge Waiting for PR to be merged to fix the issue. labels Nov 22, 2022
@frankkopp
Copy link
Member

Looks good now - now someone will test this - either separately or it will go to Experimental for testing.
After that it can be merged to maser (Development version).

@frankkopp frankkopp added Please Resolve Conflicts The author of thie PR must resolve remaining conflicts and removed Please Resolve Conflicts The author of thie PR must resolve remaining conflicts labels Nov 25, 2022
@ShadowFrost3
Copy link

ShadowFrost3 commented Nov 26, 2022

Quality Assurance Tester Report

Object of testing: #7583
Tier of Testing:1
Date: 25/11/2022

Testing Process:
Smash EFB against head
Check that EFB still works
Check that loading time accounts for passengers already aboard --- Appears to do so.
Check that cargo adds time properly --- Cargo appears to not add time properly
EFB shows longer boarding times with less cargo.

Negatives: EFB shows longer boarding times with less cargo.
Testing Results: Not passed unless there is good reason for the cargo loading time discrepancies.

Not PR related, but please add your discord name to the post as I cannot find a "ChristianLutzCL" or similar. Thanks

20 minutes. 174 pax 5,000 lbs

image

25 minutes. 174 pax 1,000 lbs

image

13 minutes. 174 pax 10,000 lbs

image

43 minutes. 174 pax 20,000 lbs/max

image

@ChristianLutzCL
Copy link
Contributor Author

Quality Assurance Tester Report

Object of testing: #7583 Tier of Testing:1 Date: 25/11/2022

Testing Process: Smash EFB against head Check that EFB still works Check that loading time accounts for passengers already aboard --- Appears to do so. Check that cargo adds time properly --- Cargo appears to not add time properly EFB shows longer boarding times with less cargo.

Negatives: EFB shows longer boarding times with less cargo. Testing Results: Not passed unless there is good reason for the cargo loading time discrepancies.

Not PR related, but please add your discord name to the post as I cannot find a "ChristianLutzCL" or similar. Thanks

20 minutes. 174 pax 5,000 lbs

image

25 minutes. 174 pax 1,000 lbs

image

13 minutes. 174 pax 10,000 lbs

image

43 minutes. 174 pax 20,000 lbs/max

image

Will have a look at it soon.
Didn't have a Discord account yet, but created one now.
image

@Hellfire-2345
Copy link

Hellfire-2345 commented Nov 26, 2022

Quality Assurance Trainee Report

Discord : hellfire#7383
Object of testing: #7583
Tier of Testing : 1
Date : 27/11/2022

Testing Process:
150 passengers and 4950 LBS of cargo was loaded with an estimated time of 18 which seemed correct. although
when cargo amount was changed the time was not added properly. (more cargo less time)

Negatives:
the cargo time issue

Testing Results:
Not passed

Conclusions:
the seats changing colour when filled was a cool effect as well as loading from the rear.

@2hwk 2hwk added this to the v0.10.0 milestone Dec 2, 2022
@2hwk
Copy link
Member

2hwk commented Dec 4, 2022

Quality Assurance Tester Report

Object of testing: #7583
Tier of Testing: 1
Date: 04/12/2022

Testing Process:

  • Load aircraft with engines off
  • Open 'Payload' on EFB
  • Set PAX and/or CARGO -> watch 'Estimated duration' [x]
  • Change loading time Instant/Fast/Real -> watch 'Estimated duration'
  • Start Boarding -> watch 'Estimated duration'

Negative

  • Existing Issue with cargo loading that is already noted was observed

Result:

  • Pending, not passed

@frankkopp
Copy link
Member

@ChristianLutzCL I sent you a patch on Discord which fix the issues reported by the testers.

@frankkopp
Copy link
Member

@ChristianLutzCL are you still working on this?

@frankkopp frankkopp force-pushed the efb-payload-estimated-boarding-time branch from 2aeba1e to 9940e4d Compare December 25, 2022 09:58
@frankkopp
Copy link
Member

@ChristianLutzCL as you have not commented or updated anything on this PR in a month I have taken the liberty to fix the issue and rebase your branch. Ping me on Discord (Cdr_Maverick#6475) if you have questions.

@2hwk @Hellfire-2345 could you please retest this? Thanks

@frankkopp frankkopp force-pushed the efb-payload-estimated-boarding-time branch 3 times, most recently from c410276 to 71f801a Compare December 31, 2022 16:10
frankkopp added a commit that referenced this pull request Dec 31, 2022
@frankkopp frankkopp added the Exp Available on experimental branch (for testing) label Dec 31, 2022
@frankkopp frankkopp force-pushed the efb-payload-estimated-boarding-time branch from 71f801a to 8b79433 Compare January 1, 2023 13:11
@2hwk
Copy link
Member

2hwk commented Jan 2, 2023

Quality Assurance Tester Report

Object of testing: #7583
Tier of Testing: 1
Date: 02/01/2023

Testing Process:

  • Load aircraft with engines off

  • Open 'Payload' on EFB

  • Set PAX and/or CARGO -> watch 'Estimated duration' [x]

  • Change loading time Instant/Fast/Real -> watch 'Estimated duration'

  • Start Boarding -> watch 'Estimated duration'

  • Cargo loading now fixed

Negative

  • N/A

Result:

  • Passed

@frankkopp frankkopp merged commit 2b2721a into flybywiresim:master Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Exp Available on experimental branch (for testing) QA Tier 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addition to Flypad Payload load screen
5 participants