-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(efb): Add estimated boarding time #7583
Conversation
May conflict with #7604 |
Please add your Discord account name so we can contact you regarding this PR. Thanks |
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
´´´ |
Thanks for the suggestions. |
Found out, there is a "BoardingTime" localization already there that wasn't used. |
Could you please fix the linter issues: |
Should be fixed now. |
Looks good now - now someone will test this - either separately or it will go to Experimental for testing. |
Quality Assurance Tester Report Object of testing: #7583 Testing Process: Negatives: EFB shows longer boarding times with less cargo. 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 25 minutes. 174 pax 1,000 lbs 13 minutes. 174 pax 10,000 lbs 43 minutes. 174 pax 20,000 lbs/max |
Will have a look at it soon. |
Quality Assurance Trainee Report Discord : hellfire#7383 Testing Process: Negatives: Testing Results: Conclusions: |
Quality Assurance Tester Report Object of testing: #7583 Testing Process:
Negative
Result:
|
@ChristianLutzCL I sent you a patch on Discord which fix the issues reported by the testers. |
@ChristianLutzCL are you still working on this? |
2aeba1e
to
9940e4d
Compare
@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 |
c410276
to
71f801a
Compare
Co-authored-by: Frank Kopp <[email protected]>
Co-authored-by: Frank Kopp <[email protected]>
71f801a
to
8b79433
Compare
Quality Assurance Tester Report Object of testing: #7583 Testing Process:
Negative
Result:
|
Fixes #7418
Summary of Changes
Added estimated boarding time to payload view like in fuel view
Screenshots (if necessary)
References
Additional context
Discord username (if different from GitHub):
Testing instructions
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.