Class: Timer
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/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/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:94
Builds an instance of a Timer
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | is the EventBus |
onModeChanged | (newMode ) => void | is the onModeChanged callback when the timer mode changes |
onValueChanged | (time ) => void | is the onValuaChanged callback when the timer value changes |
Returns
Timer
Accessors
canReset
Get Signature
get canReset():
boolean
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/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/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:75
Set method for setting whether the timer can be reset.
Parameters
Parameter | Type | Description |
---|---|---|
state | boolean | (true = stopped, can be reset, false = has been reset). |
Returns
void
mode
Get Signature
get mode():
TimerMode
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:35
Get method for timer mode.
Returns
this._mode value
Set Signature
set mode(
mode
):void
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:43
Get method for timer mode.
Parameters
Parameter | Type | Description |
---|---|---|
mode | TimerMode | new mode value |
Returns
void
timerRunning
Get Signature
get timerRunning():
boolean
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/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/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:59
Set method for timer state (running or not true/false).
Parameters
Parameter | Type | Description |
---|---|---|
state | boolean | the state to set the timer (true = running, false = stopped). |
Returns
void
timerValue
Get Signature
get timerValue():
number
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/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/Pages/VCockpit/Instruments/NavSystems/WTG1000/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/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:133
Method to set timer value
Parameters
Parameter | Type | Description |
---|---|---|
time | number | is the time to set the timer in seconds |
Returns
void
SecondsToHMMSS()
static
SecondsToHMMSS(totalSeconds
):any
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/Components/UI/TimerRef/Timer.ts:151
Utility method to get H:M:S values from seconds.
Parameters
Parameter | Type | Description |
---|---|---|
totalSeconds | number | is the value in seconds |
Returns
any
an object of hours minutes and seconds as numbers