Skip to main content

Class: PFDViewService

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/PFDViewService.ts:17

A service to manage views.

Extends​

Constructors​

Constructor​

new PFDViewService(bus): PFDViewService

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/PFDViewService.ts:39

Constructs the view service.

Parameters​

ParameterTypeDescription
busEventBusThe event bus.

Returns​

PFDViewService

Overrides​

ViewService.constructor

Properties​

activeView​

readonly activeView: Subscribable<UiView<UiViewProps, any, any> | null>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:39

The currently active view.

Inherited from​

ViewService.activeView


activeViewKey​

readonly activeViewKey: Subscribable<string>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:37

The key of the currently active view.

Inherited from​

ViewService.activeViewKey


bus​

readonly bus: EventBus

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/PFDViewService.ts:39

The event bus.

Inherited from​

ViewService.bus


fmsEventMap​

protected readonly fmsEventMap: Map<string, FmsHEvent>

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/PFDViewService.ts:19

override in child class

Overrides​

ViewService.fmsEventMap


ignorePageHistory​

protected ignorePageHistory: boolean = false

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:42

Inherited from​

ViewService.ignorePageHistory


openPage​

readonly openPage: Subscribable<UiPage<UiPageProps> | null>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:33

The currently open page.

Inherited from​

ViewService.openPage


openPageKey​

readonly openPageKey: Subscribable<string>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:31

The key of the currently open page.

Inherited from​

ViewService.openPageKey


pageHistory​

protected readonly pageHistory: ViewEntry<UiView<UiViewProps, any, any>>[] = []

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:41

Inherited from​

ViewService.pageHistory

Methods​

clearPageHistory()​

clearPageHistory(): void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:237

Clears this view service's page history.

Returns​

void

Inherited from​

ViewService.clearPageHistory


clearStack()​

protected clearStack(closePage): void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:259

Closes all open views and clears the stack.

Parameters​

ParameterTypeDescription
closePagebooleanWhether to close the currently open page, if one exists.

Returns​

void

Inherited from​

ViewService.clearStack


closeActiveView()​

closeActiveView(): void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:244

Closes the currently active view.

Returns​

void

Inherited from​

ViewService.closeActiveView


closeAllViews()​

closeAllViews(): void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:251

Closes all open views except for the currently open page, if one exists.

Returns​

void

Inherited from​

ViewService.closeAllViews


getOpenViews()​

getOpenViews(): readonly UiView<UiViewProps, any, any>[]

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:96

Gets an array of all currently open views.

Returns​

readonly UiView<UiViewProps, any, any>[]

an array of all currently open views.

Inherited from​

ViewService.getOpenViews


onInteractionEvent()​

protected onInteractionEvent(hEvent): boolean

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/PFDViewService.ts:58

Routes the HEvents to the views.

Parameters​

ParameterTypeDescription
hEventstringThe event identifier.

Returns​

boolean

whether the event was handled

Overrides​

ViewService.onInteractionEvent


open()​

open<T>(type, isSubView): T

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:120

Opens a view. The opened view can be a page, regular view, or subview. Opening a page will close all other views, including the currently open page. Opening a regular view will close all other views except the currently open page. Opening a subview does not close any other views. The opened view will immediately become the active view, and the previously active view (if one exists) will be paused.

Type Parameters​

Type ParameterDefault type
T extends UiView<UiViewProps, any, any>UiView<UiViewProps, any, any>

Parameters​

ParameterTypeDefault valueDescription
typestringundefinedThe type of the view to open.
isSubViewbooleanfalseA boolean indicating if the view to be opened is a subview.

Returns​

T

The view that was opened.

Throws​

Error if the view type is not registered with this service.

Inherited from​

ViewService.open


openLastPage()​

openLastPage(): UiPage<UiPageProps> | null

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:223

Opens the page that was most recently closed.

Returns​

UiPage<UiPageProps> | null

The page that was opened.

Inherited from​

ViewService.openLastPage


registerView()​

registerView(type?, vnodeFn?): void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:105

Registers a view with the service.

Parameters​

ParameterTypeDescription
type?stringThe type of the view.
vnodeFn?() => VNodeA function creating the VNode.

Returns​

void

Inherited from​

ViewService.registerView


routeInteractionEventToViews()​

protected routeInteractionEventToViews(evt): boolean

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/ViewService.ts:84

Routes an interaction to the active view, and if it is not handled, re-routes the interaction to the currently open page if it exists and is not the active view.

Parameters​

ParameterTypeDescription
evtFmsHEventAn interaction event.

Returns​

boolean

Whether the event was handled.

Inherited from​

ViewService.routeInteractionEventToViews