Skip to content

Commit

Permalink
feat(efb): added settings for tod pause
Browse files Browse the repository at this point in the history
  • Loading branch information
2hwk committed May 10, 2022
1 parent 77eaab1 commit f67e264
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/instruments/src/EFB/Localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@
"HomeCockpitMode": "Home Cockpit Mode",
"McduFocusTimeout": "MCDU Focus Timeout (seconds)",
"McduKeyboardInput": "MCDU Keyboard Input",
"PauseAtTod": "T/D Pause",
"PauseAtTodDistance": "T/D Pause Distance (nm)",
"SeparateTillerFromRudderInputs": "Separate Tiller from Rudder Inputs",
"Title": "Realism"
},
Expand Down Expand Up @@ -545,4 +547,4 @@
"Tue": "Tue",
"Wed": "Wed"
}
}
}
24 changes: 24 additions & 0 deletions src/instruments/src/EFB/Settings/Pages/RealismPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const RealismPage = () => {
const [dmcSelfTestTime, setDmcSelfTestTime] = usePersistentProperty('CONFIG_SELF_TEST_TIME', '12');
const [mcduInput, setMcduInput] = usePersistentProperty('MCDU_KB_INPUT', 'DISABLED');
const [mcduTimeout, setMcduTimeout] = usePersistentProperty('CONFIG_MCDU_KB_TIMEOUT', '60');
const [pauseAtTod, setPauseAtTod] = usePersistentProperty('PAUSE_AT_TOD', 'DISABLED');
const [todOffset, setTodOffset] = usePersistentNumberProperty('PAUSE_AT_TOD_DISTANCE', 10);
const [boardingRate, setBoardingRate] = usePersistentProperty('CONFIG_BOARDING_RATE', 'REAL');
const [realisticTiller, setRealisticTiller] = usePersistentNumberProperty('REALISTIC_TILLER_ENABLED', 0);
const [homeCockpit, setHomeCockpit] = usePersistentProperty('HOME_COCKPIT_ENABLED', '0');
Expand Down Expand Up @@ -121,6 +123,28 @@ export const RealismPage = () => {
)}
</SettingGroup>

<SettingGroup>
<SettingItem name={t('Settings.Realism.PauseAtTod')} unrealistic groupType="parent">
<Toggle value={pauseAtTod === 'ENABLED'} onToggle={(value) => setPauseAtTod(value ? 'ENABLED' : 'DISABLED')} />
</SettingItem>
{pauseAtTod === 'ENABLED' && (
<SettingItem name={t('Settings.Realism.PauseAtTodDistance')} groupType="sub">
<SimpleInput
className="text-center w-30"
value={todOffset}
min={0}
max={50.0}
disabled={(pauseAtTod !== 'ENABLED')}
onChange={(event) => {
if (!Number.isNaN(event) && parseInt(event) >= 0 && parseInt(event) <= 50.0) {
setTodOffset(parseFloat(event.trim()));
}
}}
/>
</SettingItem>
)}
</SettingGroup>

</SettingsPage>
);
};

0 comments on commit f67e264

Please sign in to comment.