Skip to main content

Class: Timer

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:16

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

Constructors​

Constructor​

new Timer(bus, onModeChanged, onValueChanged): Timer

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:94

Builds an instance of a Timer

Parameters​

ParameterTypeDescription
busEventBusis the EventBus
onModeChanged(newMode) => voidis the onModeChanged callback when the timer mode changes
onValueChanged(time) => voidis the onValuaChanged callback when the timer value changes

Returns​

Timer

Accessors​

canReset​

Get Signature​

get canReset(): boolean

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:83

Set method for setting whether the timer can be reset.

Returns​

boolean

this._canReset value

Set Signature​

set canReset(state): void

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:75

Set method for setting whether the timer can be reset.

Parameters​
ParameterTypeDescription
stateboolean(true = stopped, can be reset, false = has been reset).
Returns​

void


mode​

Get Signature​

get mode(): TimerMode

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:35

Get method for timer mode.

Returns​

TimerMode

this._mode value

Set Signature​

set mode(mode): void

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:43

Get method for timer mode.

Parameters​
ParameterTypeDescription
modeTimerModenew mode value
Returns​

void


timerRunning​

Get Signature​

get timerRunning(): boolean

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:51

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

Returns​

boolean

this._timerValue value

Set Signature​

set timerRunning(state): void

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:59

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

Parameters​
ParameterTypeDescription
statebooleanthe state to set the timer (true = running, false = stopped).
Returns​

void


timerValue​

Get Signature​

get timerValue(): number

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:67

Get the timer value in seconds.

Returns​

number

this._timerValue value

Methods​

resetTimer()​

resetTimer(): void

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:140

Method to reset all timer values

Returns​

void


setTimerValue()​

setTimerValue(time): void

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:133

Method to set timer value

Parameters​

ParameterTypeDescription
timenumberis the time to set the timer in seconds

Returns​

void


SecondsToHMMSS()​

static SecondsToHMMSS(totalSeconds): any

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/TimerRef/Timer.ts:151

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

Parameters​

ParameterTypeDescription
totalSecondsnumberis the value in seconds

Returns​

any

an object of hours minutes and seconds as numbers