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

fix(a380x/sd): Correct SD - EL/DC APU TR text color #9797

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ksleungac
Copy link

@ksleungac ksleungac commented Jan 22, 2025

Fixes #[9760]

Summary of Changes

For APU TR, the title color is white when trVoltageNormal == True. For other TRs, they are white when trVoltageNormal && trCurrentNormal.

For APU TR amps text, it is in green when trCurrentNormal == True, in white when trCurrentNormal == False.
Other TRs amps text color are in amber when trCurrentNormal == False.

Screenshots (if necessary)

Updated as of commit 792368e

Only BAT1, BAT2, ESS BAT is AUTO, no idea why TR2 is powered and has a 28V potential (didn't modify any potential reading).
state1

AC1, 2 powered
AC1_2

Normal configuration, where APU TR and amps text are in white.
normal_1)

APU Start on APU TR
APU_START_on_TR

References

Refer to Issue

Additional context

Now, there's no negativity checking on APU TR amps, I think it's not possible for a TR to have negative current going out anyway.
I might've missed some correct behaviours, it would be great if someone could add more references.

Discord username (if different from GitHub): pzb-85

Testing instructions

  1. Load-in Aircraft
  2. Switch on all other BATs except in EL/DC page, APU TR text is in amber, amps text is in white. All other TRs are failed (amber) (to confirm they are not affected by this fix)
  3. Connect EXT 1/2, Check TR1, ESS TR amps show green (to confirm they are not affected by this fix)
  4. Connect EXT4 to power AC BUS 4, APU TR text and amps text are in white, (Normal electrical configuration)
  5. Switch off APU BAT, start APU on APU TR, APU TR amps text is in green when current >2A, white when <=2A.

How to download the PR for QA

Every new commit to this PR will cause new A32NX and A380X artifacts 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, find and click on the PR Build tab
  4. Click on either flybywire-aircraft-a320-neo, flybywire-aircraft-a380-842 (4K) or flybywire-aircraft-a380-842 (8K) download link at the bottom of the page

@Gurgel100
Copy link
Contributor

Thank for making me aware that there is a bug in the electrical configuration code. Battery 2 should not be connected whithout having AC power available. Will be fixed with #9803.

@@ -67,7 +67,7 @@ export const TransformerRectifier: FC<TransformerRectifierProps> = ({ x, y, bus
<text
x={57}
y={22}
className={`F25 MiddleAlign ${trVoltageNormal && trCurrentNormal ? 'White' : 'Amber'} LS1 WS-8`}
className={`F25 MiddleAlign ${trVoltageNormal && (trCurrentNormal || title === 'APU TR') ? 'White' : 'Amber'} LS1 WS-8`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of comparing the title maybe it would be better to check the bus? Or set a variable at line 26 which indicates to ignore the current abnormality?

Copy link
Author

@ksleungac ksleungac Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I will check the bus.

<text
x={65}
y={97}
className={`F28 EndAlign ${trCurrentNormal ? 'Green' : title === 'APU TR' ? 'White' : 'Amber'} LS1`}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly doubt that this should actually be white. The image provided in the reference issue is not really conclusive when looking at, and using a color picker tool, there is clear green in the area surrounding the letter

Copy link
Member

@lukecologne lukecologne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I just confirmed with another reference that I cannot show here, that the indication is indeed green, not white, as I suspected.

@ksleungac
Copy link
Author

ksleungac commented Jan 26, 2025

Ok, I just confirmed with another reference that I cannot show here, that the indication is indeed green, not white, as I suspected.

Thank you. So in normal configuration, APU TR current in green for all ranges. Moreover, do you know what the color will be when APU TR fails (in the first screenshot)?

@lukecologne
Copy link
Member

lukecologne commented Jan 26, 2025

Not entirely sure, but what I can tell you is that on ground, with all batteries on, but no AC power, the title will be white, not amber.

@ksleungac ksleungac requested a review from lukecologne January 26, 2025 15:43
@@ -67,7 +67,7 @@ export const TransformerRectifier: FC<TransformerRectifierProps> = ({ x, y, bus
<text
x={57}
y={22}
className={`F25 MiddleAlign ${trVoltageNormal && trCurrentNormal ? 'White' : 'Amber'} LS1 WS-8`}
className={`F25 MiddleAlign ${(trVoltageNormal && trCurrentNormal) || bus == DcElecBus.DcApu ? 'White' : 'Amber'} LS1 WS-8`}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code would be clearer if the condition was added to the trVoltageNormal/trCurrentNormal variables directly instead of here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely!

@ksleungac
Copy link
Author

I updated the logic to be outside of css classes ternary operator. Should I request re-review everytime?

const trVoltageNormal = potential > TR_VOLTAGE_NORMAL_RANGE_LOWER && potential < TR_VOLTAGE_NORMAL_RANGE_UPPER;
const trNormal = bus == DcElecBus.DcApu || (trCurrentNormal && trVoltageNormal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be redundant with skipCurrentCeck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔴 Code Review: In progress
Development

Successfully merging this pull request may close these issues.

3 participants