Skip to main content

Class: PerformancePlanRepository<P, ID>

Correlates flight plan indices with performance plan objects

Type parameters

NameType
Pextends PerformancePlan
IDextends string = any

Constructors

constructor

new PerformancePlanRepository<P, ID>(id, bus, flightPlanner, definitions): PerformancePlanRepository<P, ID>

Ctor

Type parameters

NameType
Pextends PerformancePlan
IDextends string = any

Parameters

NameTypeDescription
idIDthe performance plan repository ID
busEventBusthe event bus
flightPlannerFlightPlanner<any>a flight planner instance
definitionsPerformancePlanDefinitionObject<P>an object containing definitions for each of the performance plan's properties

Returns

PerformancePlanRepository<P, ID>

Defined in

src/sdk/performance/PerformancePlanRepository.ts:66

Properties

plans

plans: readonly P[]

Defined in

src/sdk/performance/PerformancePlanRepository.ts:56


DEFAULT_VALUES_PLAN_INDEX

Static DEFAULT_VALUES_PLAN_INDEX: number = Number.MAX_SAFE_INTEGER

Defined in

src/sdk/performance/PerformancePlanRepository.ts:47

Methods

copy

copy(from, to, skipChecks?, sync?): void

Copies a performance plan onto another

Parameters

NameTypeDefault valueDescription
fromnumberundefinedfrom index
tonumberundefinedto index
skipChecksbooleanfalsewhether to skip flight planner checks
syncbooleantruewhether to trigger a perf plan sync

Returns

void

Defined in

src/sdk/performance/PerformancePlanRepository.ts:172


create

create(atIndex): P

Creates a performance plan at the given index if it doesn't exist, or returns the existing one

Parameters

NameTypeDescription
atIndexnumberthe index

Returns

P

the created plan

Defined in

src/sdk/performance/PerformancePlanRepository.ts:152


createPerformancePlanProxy

createPerformancePlanProxy(callbacks): PerformancePlanProxy<P>

Creates a performance plan proxy from the definitions object

Parameters

NameTypeDescription
callbacksPerformancePlanProxyCallbacks<P>an object containing the callbacks to attach to the proxy

Returns

PerformancePlanProxy<P>

a performance plan proxy

Defined in

src/sdk/performance/PerformancePlanRepository.ts:252


defaultValuesPlan

defaultValuesPlan(): P

Returns the performance plan containing default values

Returns

P

the plan

Defined in

src/sdk/performance/PerformancePlanRepository.ts:132


forFlightPlanIndex

forFlightPlanIndex(index): P

Returns a performance plan for a given flight plan index, or creates it

Parameters

NameTypeDescription
indexnumberflight plan index

Returns

P

the performance plan

Throws

if an invalid flight plan index is specified

Defined in

src/sdk/performance/PerformancePlanRepository.ts:109


getActivePlan

getActivePlan(): P

Gets the active plan. This is the plan that always exists even if there is no valid flight plan yet.

Returns

P

the active plan

Defined in

src/sdk/performance/PerformancePlanRepository.ts:123


has

has(index): boolean

Whether the repository has a performance plan already stored for a given index

Parameters

NameTypeDescription
indexnumberthe index

Returns

boolean

boolean

Defined in

src/sdk/performance/PerformancePlanRepository.ts:96


hasAnyPlan

hasAnyPlan(): boolean

Returns whether this plan repository has nay valid plans

Returns

boolean

boolean

Defined in

src/sdk/performance/PerformancePlanRepository.ts:141


triggerSync

triggerSync(planIndex): void

Triggers a synchronisation of the active plan performance plan over the EventBus.

Parameters

NameTypeDescription
planIndexnumberthe plan index

Returns

void

Defined in

src/sdk/performance/PerformancePlanRepository.ts:220