Skip to main content

Class: GtcService

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:189

A service to manage GTC views

Constructors

Constructor

new GtcService(bus, instrumentIndex, config, instrumentConfig, obsSuspDataProvider): GtcService

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:347

Creates an instance of GtcService.

Parameters

ParameterTypeDescription
busEventBusThe event bus.
instrumentIndexnumberThe index of the GTC instrument to which this service belongs.
configAvionicsConfigThe general avionics configuration object.
instrumentConfigGtcConfigThe GTC instrument configuration object.
obsSuspDataProviderObsSuspDataProviderA provider of LNAV OBS/suspend data.

Returns

GtcService

Throws

Error if defaultControlMode is incompatible with controlSetup.

Properties

activeControlMode

readonly activeControlMode: Subscribable<GtcControlMode>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:221

The currently active control mode.


activeView

readonly activeView: Subscribable<GtcViewEntry<GtcView<GtcViewProps>>>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:246

The view that is currently at the top of the active view stack.


activeViewIsNotAHomePage

readonly activeViewIsNotAHomePage: Subscribable<boolean>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:253

Whether the currently active view is a control mode home page.


bus

readonly bus: EventBus

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:348

The event bus.


controlSetup

readonly controlSetup: GtcControlSetup

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:199

The control mode setup supported by this service's parent GTC.


currentInitializationTask

readonly currentInitializationTask: Subscribable<null | InitializationTaskDef>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:323

The current initialization task loaded for the active view stack.


currentPage

readonly currentPage: Subscribable<null | GtcViewEntry<GtcView<GtcViewProps>>>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:250

The page that is currently open in the active view stack.


displayPaneControlIndex

readonly displayPaneControlIndex: DisplayPaneControlGtcIndex

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:205

The display pane controlling index of this service's parent GTC.


displayPaneSettingManager

readonly displayPaneSettingManager: UserSettingManager<DisplayPaneAllUserSettingTypes>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:274

The display panes settings master manager.


displayPaneVisibleSettings

readonly displayPaneVisibleSettings: Record<ControllableDisplayPaneIndex, UserSetting<boolean>>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:276

The visibility setting for each display pane.


enabledControllablePanes

readonly enabledControllablePanes: readonly ControllableDisplayPaneIndex[]

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:264

An array containing the indexes of all enabled controllable display panes in ascending order.


gtcKnobStates

readonly gtcKnobStates: GtcKnobStates

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:330

The control states of the hardware knobs attached to this service's parent GTC.


gtcOtherSide

readonly gtcOtherSide: "left" | "right"

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:258

The string name for which side the other GTC is on.


gtcSettings

readonly gtcSettings: UserSettingManager<GtcAliasedUserSettingTypes>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:261

The GTC specific user settings for this GTC.


gtcThisSide

readonly gtcThisSide: "left" | "right"

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:256

The string name for which side this GTC is on.


hasMfdMode

readonly hasMfdMode: boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:208

Whether this GTC has an MFD mode and can control display panes.


hasNavComMode

readonly hasNavComMode: boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:212

Whether this GTC has a NAV_COM.


hasPfdMode

readonly hasPfdMode: boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:210

Whether this GTC has a PFD mode.


initializationDataProvider

readonly initializationDataProvider: InitializationDataProvider

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:311

A provider of initialization data.


instrumentIndex

readonly instrumentIndex: number

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:349

The index of the GTC instrument to which this service belongs.


isAdvancedVnav

readonly isAdvancedVnav: boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:215

Whether advanced VNAV is enabled.


isAwake

readonly isAwake: Subscribable<boolean>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:238

Whether this service is awake.


isHorizontal

readonly isHorizontal: boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:196

Whether this service's parent GTC is horizontal.


readonly navComEventHandler: Subject<null | GtcInteractionHandler>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:307


nextInitializationTask

readonly nextInitializationTask: Subscribable<null | InitializationTaskDef>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:327

The initialization task that follows the current initialization task loaded for the active view stack.


orientation

readonly orientation: GtcOrientation

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:193

The orientation (horizontal or vertical) of this service's parent GTC.


otherGtcSelectedPane

readonly otherGtcSelectedPane: ConsumerSubject<-1 | ControllableDisplayPaneIndex>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:270

The selected pane for the other GTC.


pfdControlIndex

readonly pfdControlIndex: PfdIndex

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:202

The index of the PFD controlled by this service's parent GTC.


pfdInstrumentPaneIndex

readonly pfdInstrumentPaneIndex: LeftPfdInstrument | RightPfdInstrument

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:295

The index of the PFD instrument display pane on the side of this GTC.


pfdPaneIndex

readonly pfdPaneIndex: LeftPfd | RightPfd

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:298

The index of the PFD display pane on the side of this GTC.


pfdPaneSettings

readonly pfdPaneSettings: DisplayPanesAliasedUserSettingManager

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:300

The display pane settings for this side's PFD display pane.


radioBeingTuned

readonly radioBeingTuned: Subject<ComRadio>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:306


selectedDisplayPane

readonly selectedDisplayPane: Subscribable<-1 | ControllableDisplayPaneIndex>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:289

The index of the currently selected display pane.


selectedPaneSettings

readonly selectedPaneSettings: DisplayPanesAliasedUserSettingManager

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:292

The settings manager for the currently selected display pane.


thisGtcSelectedPane

readonly thisGtcSelectedPane: ConsumerSubject<-1 | ControllableDisplayPaneIndex>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:267

The selected pane for this GTC.

Accessors

isVertNavComViewStackEmpty

Get Signature

get isVertNavComViewStackEmpty(): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:544

Whether the current vertical GTC NAV/COM view stack (i.e. the overlay view stack for the currently selected control mode) has no open popups.

Returns

boolean

Methods

attachPluginInteractionhandler()

attachPluginInteractionhandler(handler): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:663

Attaches an interaction event handler which executes event handling logic defined by plugins.

Parameters

ParameterTypeDescription
handlerGtcInteractionHandlerThe interaction event handler to attach.

Returns

void


attachPluginKnobStateOverrides()

attachPluginKnobStateOverrides(overrides): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:655

Attaches plugin-defined knob control state overrides.

Parameters

ParameterTypeDescription
overridesreadonly Readonly<GtcKnobStatePluginOverrides>[]An array of plugin-defined knob control state overrides. The array should be ordered such that the overrides appear in the order in which their parent plugins were loaded.

Returns

void


changeControlModeTo()

changeControlModeTo(controlMode): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1210

Changes the active control mode.

Parameters

ParameterTypeDescription
controlModeGtcControlModeThe control mode to change to.

Returns

void


changePageTo()

changePageTo<T>(key): GtcViewEntry<T>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1316

Opens a view as a page in the main view stack of the currently selected control mode and display pane (if applicable) and changes the current page to the opened view. This will close the current open page and any open popups in the main view stack.

Type Parameters

Type ParameterDefault type
T extends GtcView<GtcViewProps>GtcView<GtcViewProps>

Parameters

ParameterTypeDescription
keystringThe key of the view to open.

Returns

GtcViewEntry<T>

The entry of the opened view.

Throws

Error if there is no view registered under the specified key.


clearOverlayViewStack()

clearOverlayViewStack(): GtcViewEntry

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1817

Clears the overlay view stack of the currently selected control mode, closing all open popups in the stack and resetting its history.

Returns

GtcViewEntry

The active view entry after the operation is complete.


clearVerticalNavComViewStack()

clearVerticalNavComViewStack(): GtcViewEntry

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1847

Clears the current vertical GTC NAV/COM view stack (i.e. the overlay view stack of the currently selected control mode), closing all open popups in the stack and resetting its history.

Returns

GtcViewEntry

The active view entry after the operation is complete.

Throws

Error if this service's parent GTC has the horizontal orientation.

Deprecated

Please use clearOverlayViewStack() instead.


closeOverlayPopup()

closeOverlayPopup<F>(filter, closeOtherPopups): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1780

Attempts to close a popup in the current overlay view stack by rewinding the history state of the view stack until the target popup is no longer open.

Type Parameters

Type ParameterDefault type
F extends GtcView<GtcViewProps>GtcView<GtcViewProps>

Parameters

ParameterTypeDescription
filter(entry) => booleanA filter function which will be called once for each open popup found in the overlay view stack and returns whether the popup is the target popup to close.
closeOtherPopupsbooleanWhether all other open popups in the overlay view stack should be closed if the target popup is not open within the view stack.

Returns

boolean

Whether the specified popup was closed.


goBack()

goBack(): GtcViewEntry

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1600

Returns to the most recent previous history state of the active view stack.

Returns

GtcViewEntry

The active view entry after the operation is complete.

Throws

Error if the most recent previous history state of the active view stack is undefined.


goBackTo()

goBackTo(selector): GtcViewEntry

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1656

Attempts to return to a previous history state of the active view stack.

Parameters

ParameterTypeDescription
selector(steps, stackPeeker) => booleanA function which selects the history state to which to return. The function is called once for each history state in order of increasing age and takes two arguments: the number of steps from the present state to the selected state and a function which allows one to peek into the selected state's view stack by view entry. The function should return true if the operation should return to the selected state and false otherwise. If the function returns false for every selected state, then the operation is aborted.

Returns

GtcViewEntry

The active view entry after the operation is complete.


goBackToHomePage()

goBackToHomePage(): GtcViewEntry

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1702

Goes back to the home page of the currently selected control mode.

Returns

GtcViewEntry

The active view entry after the operation is complete.


goBackToInitializationPage()

goBackToInitializationPage(): null | GtcViewEntry<GtcView<GtcViewProps>>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1916

Goes back to the initialization page. This will close all open popups in the overlay layer and rewind history until the initialization page is the active view. If there is no history state (including the current history state) in which the initialization page is the active view, or if the currently active control mode is not equal to 'MFD', then this method does nothing and returns null. the currently active control mode is not 'MFD', then this method does

Returns

null | GtcViewEntry<GtcView<GtcViewProps>>

The active view entry after the operation is complete, or null if the operation could not be completed.


goBackToItem()

goBackToItem(selector): GtcViewEntry

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1677

Attempts to return to a previous history state of the active view stack.

Parameters

ParameterTypeDescription
selector(steps, stackPeeker) => booleanA function which selects the history state to which to return. The function is called once for each history state in order of increasing age and takes two arguments: the number of steps from the present state to the selected state and a function which allows one to peek into the selected state's view stack by view stack item. The function should return true if the operation should return to the selected state and false otherwise. If the function returns false for every selected state, then the operation is aborted.

Returns

GtcViewEntry

The active view entry after the operation is complete.


goToHomePage()

goToHomePage(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1276

Closes all open popups and the open page, then opens the home page for the currently selected control mode. This also resets the history for the open view stack.

Returns

void


initialize()

initialize(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:859

Initializes this service.

Returns

void


loadInitializationTask()

loadInitializationTask(uid): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1864

Loads an initialization task for the currently selected control mode and display pane. This method does nothing if the MFD control mode is not currently selected. When the task is loaded, the history of the view stack for the currently selected display pane will be rewound until the initialization page is the active view. If there is no previous history state in which the initialization page is the active view, then the initialization page will be opened instead. After the initialization page is made the active view, the task's associated page will be opened.

Parameters

ParameterTypeDescription
uidstringThe unique ID of the initialization task to load.

Returns

boolean

Whether the task was successfully loaded.


onGtcContainerRendered()

onGtcContainerRendered(viewStackRefs): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:645

Called by GtcContainer to pass in the refs to all the view stacks. Should only be called once.

Parameters

ParameterTypeDescription
viewStackRefsViewStackRefsThe view stack refs.

Returns

void


onInteractionEvent()

onInteractionEvent(event): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:2050

Called when an interaction event needs to be sent to the active view.

Parameters

ParameterTypeDescription
eventGtcInteractionEventThe event.

Returns

void


openOverlayPopup()

openOverlayPopup<T>(key, popupType, backgroundOcclusion): GtcViewEntry<T>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1470

Opens a view as a popup in the overlay view stack of the currently selected control mode. The opened view will be brought to the top of the overlay view stack as the active view.

Type Parameters

Type ParameterDefault type
T extends GtcView<GtcViewProps>GtcView<GtcViewProps>

Parameters

ParameterTypeDefault valueDescription
keystringundefinedThe key of the view to open.
popupTypeGtcPopupType'normal'The type of popup to open the view as. Defaults to 'normal'.
backgroundOcclusionGtcViewOcclusionType'darken'The occlusion type applied to views beneath the popup. If 'none' is chosen, then the popup will not prevent mouse events from reaching views beneath it (unless the mouse event was triggered on an element in the popup). Defaults to 'darken'.

Returns

GtcViewEntry<T>

The entry of the opened view.

Throws

Error if there is no view registered under the specified key.


openPopup()

openPopup<T>(key, popupType, backgroundOcclusion): GtcViewEntry<T>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1350

Opens a view as a popup in the main view stack of the currently selected control mode and display pane (if applicable). The opened view will be brought to the top of the main view stack.

Type Parameters

Type ParameterDefault type
T extends GtcView<GtcViewProps>GtcView<GtcViewProps>

Parameters

ParameterTypeDefault valueDescription
keystringundefinedThe key of the view to open.
popupTypeGtcPopupType'normal'The type of popup to open the view as. Defaults to 'normal'.
backgroundOcclusionGtcViewOcclusionType'darken'The occlusion type applied to views beneath the popup. If 'none' is chosen, then the popup will not prevent mouse events from reaching views beneath it (unless the mouse event was triggered on an element in the popup). Defaults to 'darken'.

Returns

GtcViewEntry<T>

The entry of the opened view.

Throws

Error if there is no view registered under the specified key.


openVerticalNavComPopup()

openVerticalNavComPopup<T>(key, popupType, backgroundOcclusion): GtcViewEntry<T>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1497

Opens a view as a vertical GTC NAV/COM popup. The opened view will be brought to the top of the overlay view stack of the currently selected control mode as the active view.

Type Parameters

Type ParameterDefault type
T extends GtcView<GtcViewProps>GtcView<GtcViewProps>

Parameters

ParameterTypeDefault valueDescription
keystringundefinedThe key of the view to open.
popupTypeGtcPopupType'normal'The type of popup to open the view as. Defaults to 'normal'.
backgroundOcclusionGtcViewOcclusionType'darken'The occlusion type applied to views beneath the popup. If 'none' is chosen, then the popup will not prevent mouse events from reaching views beneath it (unless the mouse event was triggered on an element in the popup). Defaults to 'darken'.

Returns

GtcViewEntry<T>

The entry of the opened view.

Throws

Error if this service's GTC is horizontal or there is no view registered under the specified key.

Deprecated

Please use openOverlayPopup() instead.


registerOverlayView()

registerOverlayView(lifecyclePolicy, key, factory, controlMode?): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:751

Registers and renders a view (page or popup) with this service for an overlay view stack. Once a view is registered, it may be opened by referencing its key.

Each view is registered with a specific view stack. There is one overlay view stack for each of the three control modes (PFD, MFD, and NAV/COM). Registering a view under the same key as an existing view in the same stack will replace the existing view.

Parameters

ParameterTypeDescription
lifecyclePolicyGtcViewLifecyclePolicyThe lifecycle policy to apply to the view. If the view is registered under a home page key, then this value is ignored and the GtcViewLifecyclePolicy.Static policy will automatically be applied.
keystringThe key to register the view under.
factory(gtcService, controlMode, displayPaneIndex, isInOverlayStack) => VNodeA function that renders the view.
controlMode?GtcControlModeThe control mode for which to register the view. If not defined, then the view will be registered once for each control mode supported by this service.

Returns

void


registerView()

registerView(lifecyclePolicy, key, controlMode, factory, displayPaneIndex?): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:686

Registers and renders a view (page or popup) with this service for a main view stack. Once a view is registered, it may be opened by referencing its key.

Each view is registered with a specific view stack. There is one main view stack for each of the PFD and NAV/COM control modes, and four main view stacks for the MFD control mode (one for each controllable display pane). Views registered with different stacks may share the same key. Registering a view under the same key as an existing view in the same stack will replace the existing view.

If this service's parent GTC has the horizontal orientation, then registering views for the NAV/COM view stack using this method will cause the views to be registered for the PFD and MFD overlay view stacks instead.

Parameters

ParameterTypeDescription
lifecyclePolicyGtcViewLifecyclePolicyThe lifecycle policy to apply to the view. If the view is registered under a home page key, then this value is ignored and the GtcViewLifecyclePolicy.Static policy will automatically be applied.
keystringThe key to register the view under.
controlModeGtcControlModeThe control mode for which to register the view.
factory(gtcService, controlMode, displayPaneIndex, isInOverlayStack) => VNodeA function that renders the view.
displayPaneIndex?ControllableDisplayPaneIndexThe index of the display pane for which to register the view. Ignored if controlMode is not 'MFD'. If not defined, then the view will be registered once for each display pane.

Returns

void


reset()

reset(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:988

Resets this service, which does the following:

  • Closes all open popups.
  • Changes the open page to the home page of this service's default control mode.
  • Clears all history.
  • Sets the controlled display pane to this service's default, if applicable.

Has no effect if this service is not initialized.

Returns

void


sleep()

sleep(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1131

Puts this service to sleep. Once asleep, this service will deselect any controlled display pane and will not respond to interaction events.

Returns

void


visitHistory()

visitHistory(visitor): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1151

Visits each history state of the current view stack.

Parameters

ParameterTypeDescription
visitor(steps, stackPeeker) => booleanA function which will visit each history state. The function is called once for each history state in order of increasing age (beginning with the present state) and takes two arguments: the number of steps from the present state to the selected state and a function which allows one to peek into the selected state's view stack. The function should return true if visitation should continue and false if visitation should stop.

Returns

void


wake()

wake(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcService.tsx:1117

Wakes this service. Once awake, this service will attempt to select an appropriate display pane to control and will respond to interaction events.

Returns

void