Skip to main content

Class: PerformancePlanRepository

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:24

Correlates flight plan indices with performance plan objects

Constructors

Constructor

new PerformancePlanRepository(flightPlanner, bus): PerformancePlanRepository

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:36

Ctor

Parameters

ParameterTypeDescription
flightPlannerFlightPlannera flight planner instance
busEventBusthe event bus

Returns

PerformancePlanRepository

Methods

copy()

copy(from, to, skipChecks): void

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:159

Copies a performance plan onto another

Parameters

ParameterTypeDefault valueDescription
fromnumberundefinedfrom index
tonumberundefinedto index
skipChecksbooleanfalsewhether to skip flight planner checks

Returns

void


create()

create(atIndex): PerformancePlan

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:144

Creates a performance plan at the given index

Parameters

ParameterTypeDescription
atIndexnumberthe index

Returns

PerformancePlan

the created plan


defaultValuesPlan()

defaultValuesPlan(): PerformancePlan

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:124

Returns the performance plan containing default values

Returns

PerformancePlan

the plan


forFlightPlanIndex()

forFlightPlanIndex(index): PerformancePlan

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:83

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

Parameters

ParameterTypeDescription
indexnumberflight plan index

Returns

PerformancePlan

the performance plan

Throws

if an invalid flight plan index is specified


getActivePlan()

getActivePlan(): PerformancePlan

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:107

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

Returns

PerformancePlan

the active plan


getModPlan()

getModPlan(): PerformancePlan

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:115

Gets the mod plan.

Returns

PerformancePlan

the mod plan


has()

has(index): boolean

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:70

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: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:133

Returns whether this plan repository has nay valid plans

Returns

boolean

boolean


triggerSync()

triggerSync(planIndex): void

Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:178

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

Parameters

ParameterTypeDescription
planIndexnumberthe plan index

Returns

void