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
Name | Type | Description |
---|---|---|
bus | EventBus | is the EventBus |
onModeChanged | (newMode : TimerMode ) => void | is the onModeChanged callback when the timer mode changes |
onValueChanged | (time : number ) => void | is the onValuaChanged callback when the timer value changes |
Returns
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
Name | Type | Description |
---|---|---|
state | boolean | (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
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
Name | Type | Description |
---|---|---|
mode | TimerMode | new 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
Name | Type | Description |
---|---|---|
state | boolean | the 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
Name | Type | Description |
---|---|---|
time | number | is 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
Name | Type | Description |
---|---|---|
totalSeconds | number | is 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