Skip to main content

Class: Timer

This is a timer that can count up or down based on the mode.

Constructors

constructor

new Timer(bus, onModeChanged, onValueChanged): Timer

Builds an instance of a Timer

Parameters

NameTypeDescription
busEventBusis the EventBus
onModeChanged(newMode: TimerMode) => voidis the onModeChanged callback when the timer mode changes
onValueChanged(time: number) => voidis the onValuaChanged callback when the timer value changes

Returns

Timer

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:94

Accessors

canReset

get canReset(): boolean

Set method for setting whether the timer can be reset.

Returns

boolean

this._canReset value

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:83

set canReset(state): void

Set method for setting whether the timer can be reset.

Parameters

NameTypeDescription
stateboolean(true = stopped, can be reset, false = has been reset).

Returns

void

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:75


mode

get mode(): TimerMode

Get method for timer mode.

Returns

TimerMode

this._mode value

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:35

set mode(mode): void

Get method for timer mode.

Parameters

NameTypeDescription
modeTimerModenew mode value

Returns

void

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:43


timerRunning

get timerRunning(): boolean

Get method for timer state (running or not true/false).

Returns

boolean

this._timerValue value

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:51

set timerRunning(state): void

Set method for timer state (running or not true/false).

Parameters

NameTypeDescription
statebooleanthe state to set the timer (true = running, false = stopped).

Returns

void

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:59


timerValue

get timerValue(): number

Get the timer value in seconds.

Returns

number

this._timerValue value

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:67

Methods

resetTimer

resetTimer(): void

Method to reset all timer values

Returns

void

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:140


setTimerValue

setTimerValue(time): void

Method to set timer value

Parameters

NameTypeDescription
timenumberis the time to set the timer in seconds

Returns

void

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:133


SecondsToHMMSS

SecondsToHMMSS(totalSeconds): any

Utility method to get H:M:S values from seconds.

Parameters

NameTypeDescription
totalSecondsnumberis the value in seconds

Returns

any

an object of hours minutes and seconds as numbers

Defined in

workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:151