Class: FmcScreen<P, E>
Defined in: src/sdk/fmc/FmcScreen.ts:91
An FMC screen.
This is the main object used to encapsulate an FMC screen and its rendering.
Type parameter T should be a subclass of the AbstractFmcPage that is universally used by pages in this implementation.
This is done so that different avionics can have different types for different kinds of events and any data that pages might need to be
instantiated with.
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
P extends AbstractFmcPage | AbstractFmcPage |
E | Record<string, unknown> |
Implements
FmcScreenPluginContext<P,E>
Constructors
Constructor
new FmcScreen<
P,E>(bus,pageFactory,options,renderer,scratchpad):FmcScreen<P,E>
Defined in: src/sdk/fmc/FmcScreen.ts:124
Ctor
Parameters
| Parameter | Type | Description |
|---|---|---|
bus | EventBus | the event bus |
pageFactory | FmcPageFactory<P> | the page factory to be used for creating FMC pages for this screen |
options | FmcScreenOptions | the screen options |
renderer | FmcRenderer | the renderer to use for this screen |
scratchpad | FmcScratchpad | the scratchpad to use for this screen |
Returns
FmcScreen<P, E>
Properties
bus
protectedreadonlybus:EventBus
Defined in: src/sdk/fmc/FmcScreen.ts:125
the event bus
currentlyDisplayedPage
protectedcurrentlyDisplayedPage:P|null=null
Defined in: src/sdk/fmc/FmcScreen.ts:108
options
readonlyoptions:Required<FmcScreenOptions>
Defined in: src/sdk/fmc/FmcScreen.ts:96
scratchpad
readonlyscratchpad:FmcScratchpad
Defined in: src/sdk/fmc/FmcScreen.ts:129
the scratchpad to use for this screen
Accessors
currentRoute
Get Signature
get currentRoute():
Subject<string>
Defined in: src/sdk/fmc/FmcScreen.ts:163
Gets the current route
Returns
Subject<string>
a string subject
currentSubpageCount
Get Signature
get currentSubpageCount():
Subject<number>
Defined in: src/sdk/fmc/FmcScreen.ts:181
Gets the current number of subpages for the current displayed page
Returns
Subject<number>
a number
currentSubpageIndex
Get Signature
get currentSubpageIndex():
Subject<number>
Defined in: src/sdk/fmc/FmcScreen.ts:172
Gets the current subpage index for the current displayed page, 1-indexed
Returns
Subject<number>
a number
Methods
acceptPageOutput()
protectedacceptPageOutput(output,template,atRowIndex):void
Defined in: src/sdk/fmc/FmcScreen.ts:425
Method called when a page is rendered to the screen. This can be overridden to intercept the page data and act upon it.
Parameters
| Parameter | Type | Description |
|---|---|---|
output | FmcOutputTemplate | the output template, displayed on the screen |
template | FmcRenderTemplate | the render template, rendered by the page |
atRowIndex | number | the row index at which the render occurred |
Returns
void
addLskEvents()
addLskEvents(
array):void
Defined in: src/sdk/fmc/FmcScreen.ts:354
Adds a list of LSK events bound to certain positions on the rendering grid
Parameters
| Parameter | Type | Description |
|---|---|---|
array | [keyof E & string, number, number][] | the LSK events and their positions |
Returns
void
addPageRoute()
Declares a route for a page class
Param
the route to set
Param
the page to associate with it
Param
the event to associate with it
Param
default typed parameters to pass in to the page
Call Signature
addPageRoute<
T>(route,page,routeEvent?):void
Defined in: src/sdk/fmc/FmcScreen.ts:276
Declares a route for a page class
Type Parameters
| Type Parameter |
|---|
T extends null |
Parameters
| Parameter | Type | Description |
|---|---|---|
route | string | the route to set |
page | PageConstructor<P & AbstractFmcPage<T>> | the page to associate with it |
routeEvent? | keyof E & string | the event to associate with it |
Returns
void
Call Signature
addPageRoute<
U>(route,page,routeEvent,defaultProps):void
Defined in: src/sdk/fmc/FmcScreen.ts:289
Declares a route for a page class
Type Parameters
| Type Parameter |
|---|
U extends PageConstructor<P, null> |
Parameters
| Parameter | Type | Description |
|---|---|---|
route | string | the route to set |
page | U | the page to associate with it |
routeEvent | keyof E & string | undefined | the event to associate with it |
defaultProps | U extends PageConstructor<AbstractFmcPage<V>, V> ? V : never | default props to pass in to the page |
Returns
void
addPagingEvents()
addPagingEvents(
events):void
Defined in: src/sdk/fmc/FmcScreen.ts:367
Adds paging events bound the page slewing
Parameters
| Parameter | Type | Description |
|---|---|---|
events | FmcPagingEvents<E> | the events to bind |
Returns
void
addPluginPageRoute()
addPluginPageRoute<
T>(route,page,routeEvent?,defaultTypedParameters?):void
Defined in: src/sdk/fmc/FmcScreen.ts:324
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type |
|---|---|
route | string |
page | PageConstructor<P & AbstractFmcPage<T>, T> |
routeEvent? | keyof E & string |
defaultTypedParameters? | T |
Returns
void
Inherit Doc
Implementation of
FmcScreenPluginContext.addPluginPageRoute
attachPageExtension()
attachPageExtension(
pageClass,extensionCtor):void
Defined in: src/sdk/fmc/FmcScreen.ts:344
Attaches a FmcPageExtension to a specific page class
Parameters
| Parameter | Type | Description |
|---|---|---|
pageClass | PageConstructor<P> | the page constructor (class) to attach the extension to |
extensionCtor | (...args) => AbstractFmcPageExtension<P> | the extension class (will be instantiated whenever the page is created) |
Returns
void
Implementation of
FmcScreenPluginContext.attachPageExtension
clearScratchpad()
clearScratchpad():
void
Defined in: src/sdk/fmc/FmcScreen.ts:265
Clears the scratchpad, if applicable
Returns
void
editOutputTemplate()
editOutputTemplate(
rowIndex,output):void
Defined in: src/sdk/fmc/FmcScreen.ts:393
Edits part of the screen output
Parameters
| Parameter | Type | Description |
|---|---|---|
rowIndex | number | the row index to insert at |
output | FmcOutputTemplate | the output to insert |
Returns
void
Throws
if rowIndex is too high
navigateTo()
Navigates to a given route and displays the associated page, if available
Param
the route
Param
the parameters to pass to the page
Throws
if a page class is passed in as the first argument and no associated route is found
Call Signature
navigateTo(
route,params?):void
Defined in: src/sdk/fmc/FmcScreen.ts:191
Navigates to a given route and displays the associated page, if available
Parameters
| Parameter | Type | Description |
|---|---|---|
route | string | the route |
params? | Record<string, unknown> | the parameters to pass to the page |
Returns
void
Call Signature
navigateTo<
U>(pageClass,props):void
Defined in: src/sdk/fmc/FmcScreen.ts:201
Navigates to a given route and displays the associated page, if available
Type Parameters
| Type Parameter |
|---|
U extends PageConstructor<P, null> |
Parameters
| Parameter | Type | Description |
|---|---|---|
pageClass | U | the page's class |
props | U extends PageConstructor<AbstractFmcPage<V>, V> ? V : never | props to pass in to the page |
Returns
void
onLineSelectKeyError()
protectedonLineSelectKeyError(error):void
Defined in: src/sdk/fmc/FmcScreen.ts:491
Called when an LSK error is thrown. Sets this.scratchpad.errorContents (if error is a string; otherwise throws) by default.
Parameters
| Parameter | Type | Description |
|---|---|---|
error | any | the LSK error |
Returns
void
onLineSelectKeyUnhandled()
protectedonLineSelectKeyUnhandled(selectKeyEvent):void
Defined in: src/sdk/fmc/FmcScreen.ts:481
Called when an LSK event is not handled by any code.
Parameters
| Parameter | Type | Description |
|---|---|---|
selectKeyEvent | LineSelectKeyEvent | the LSK event |
Returns
void
Throws
the value of options.lskNotHandledThrowValue by default
onPrefixedEvent()
onPrefixedEvent<
k>(event):Consumer<E[k]>
Defined in: src/sdk/fmc/FmcScreen.ts:381
Returns a consumer for an event prefixed for this particular screen.
Type Parameters
| Type Parameter |
|---|
k extends string |
Parameters
| Parameter | Type | Description |
|---|---|---|
event | k | The event to subscribe to. |
Returns
Consumer<E[k]>
A consumer for an event prefixed for this particular screen.
processPluginPageAdditions()
processPluginPageAdditions():
void
Defined in: src/sdk/fmc/FmcScreen.ts:143
Processes page replacement calls made by plugins. Must be called after plugins are initialized, and before stock routes are added.
Returns
void
processPluginPageReplacements()
processPluginPageReplacements():
void
Defined in: src/sdk/fmc/FmcScreen.ts:152
Processes page replacement calls made by plugins. Must be called after plugins are initialized, and after stock routes are added.
Returns
void
replacePageRoute()
replacePageRoute<
T>(route,page,routeEvent?,defaultTypedParameters?):void
Defined in: src/sdk/fmc/FmcScreen.ts:334
Adds a page route to the FMC screen. Has priority over routes added by the avionics.
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type | Description |
|---|---|---|
route | string | the route |
page | PageConstructor<P & AbstractFmcPage<T>, T> | the page constructor |
routeEvent? | keyof E & string | the FMC event, optionally, to bind the route to |
defaultTypedParameters? | T | - |
Returns
void