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(hyd): tiller setting in efb #2

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions src/instruments/src/EFB/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ButtonType = {
setting: string,
}

type AdirsButton = {
type SimVarButton = {
simVarValue: number,
}

Expand Down Expand Up @@ -247,7 +247,10 @@ const SimOptionsPage = () => {

const [dynamicRegistration, setDynamicRegistration] = usePersistentProperty('DYNAMIC_REGISTRATION_DECAL', '0');

const adirsAlignTimeButtons: (ButtonType & AdirsButton)[] = [
const [realisticTiller, setRealisticTiller] = usePersistentProperty('REALISTIC_TILLER_ENABLED', '0');
const [, setRealisticTillerSimVar] = useSimVar('L:A32NX_REALISTIC_TILLER_ENABLED', 'Number', 0);

const adirsAlignTimeButtons: (ButtonType & SimVarButton)[] = [
{ name: 'Instant', setting: 'INSTANT', simVarValue: 1 },
{ name: 'Fast', setting: 'FAST', simVarValue: 2 },
{ name: 'Real', setting: 'REAL', simVarValue: 0 },
Expand All @@ -270,6 +273,11 @@ const SimOptionsPage = () => {
{ name: 'Enabled', setting: '1' },
];

const steeringSeparationButtons: (ButtonType & SimVarButton)[] = [
{ name: 'Disabled', setting: '0', simVarValue: 0 },
{ name: 'Enabled', setting: '1', simVarValue: 1 },
];

useEffect(() => {
setShowNavbar(!showThrottleSettings);
}, [showThrottleSettings]);
Expand Down Expand Up @@ -368,6 +376,23 @@ const SimOptionsPage = () => {
))}
</SelectGroup>
</div>
<div className="py-4 flex flex-row justify-between items-center">
<span className="text-lg text-gray-300 mr-1">Separate Tiller from Rudder Inputs</span>
<SelectGroup>
{steeringSeparationButtons.map((button) => (
<SelectItem
enabled
onSelect={() => {
setRealisticTiller(button.setting);
setRealisticTillerSimVar(button.simVarValue);
}}
selected={realisticTiller === button.setting}
>
{button.name}
</SelectItem>
))}
</SelectGroup>
</div>
</div>
<ControlSettings setShowSettings={setShowThrottleSettings} />
</>
Expand Down