Skip to main content

Class: PerformancePlanRepository<P, ID>

Defined in: src/sdk/performance/PerformancePlanRepository.ts:46

Correlates flight plan indices with performance plan objects

Type Parameters​

Type ParameterDefault type
P extends PerformancePlan-
ID extends stringany

Constructors​

Constructor​

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

Defined in: src/sdk/performance/PerformancePlanRepository.ts:66

Ctor

Parameters​

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

Returns​

PerformancePlanRepository<P, ID>

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

Defined in: src/sdk/performance/PerformancePlanRepository.ts:172

Copies a performance plan onto another

Parameters​

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

Returns​

void


create()​

create(atIndex): P

Defined in: src/sdk/performance/PerformancePlanRepository.ts:152

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

Parameters​

ParameterTypeDescription
atIndexnumberthe index

Returns​

P

the created plan


createPerformancePlanProxy()​

createPerformancePlanProxy(callbacks): PerformancePlanProxy<P>

Defined in: src/sdk/performance/PerformancePlanRepository.ts:252

Creates a performance plan proxy from the definitions object

Parameters​

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

Returns​

PerformancePlanProxy<P>

a performance plan proxy


defaultValuesPlan()​

defaultValuesPlan(): P

Defined in: src/sdk/performance/PerformancePlanRepository.ts:132

Returns the performance plan containing default values

Returns​

P

the plan


forFlightPlanIndex()​

forFlightPlanIndex(index): P

Defined in: src/sdk/performance/PerformancePlanRepository.ts:109

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

Parameters​

ParameterTypeDescription
indexnumberflight plan index

Returns​

P

the performance plan

Throws​

if an invalid flight plan index is specified


getActivePlan()​

getActivePlan(): P

Defined in: src/sdk/performance/PerformancePlanRepository.ts:123

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


has()​

has(index): boolean

Defined in: src/sdk/performance/PerformancePlanRepository.ts:96

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

Parameters​

ParameterTypeDescription
indexnumberthe index

Returns​

boolean

boolean


hasAnyPlan()​

hasAnyPlan(): boolean

Defined in: src/sdk/performance/PerformancePlanRepository.ts:141

Returns whether this plan repository has nay valid plans

Returns​

boolean

boolean


triggerSync()​

triggerSync(planIndex): void

Defined in: src/sdk/performance/PerformancePlanRepository.ts:220

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

Parameters​

ParameterTypeDescription
planIndexnumberthe plan index

Returns​

void