Class: PerformancePlanRepository<P, ID>
Correlates flight plan indices with performance plan objects
Type parameters
Name | Type |
---|---|
P | extends PerformancePlan |
ID | extends string = any |
Constructors
constructor
• new PerformancePlanRepository<P
, ID
>(id
, bus
, flightPlanner
, definitions
): PerformancePlanRepository
<P
, ID
>
Ctor
Type parameters
Name | Type |
---|---|
P | extends PerformancePlan |
ID | extends string = any |
Parameters
Name | Type | Description |
---|---|---|
id | ID | the performance plan repository ID |
bus | EventBus | the event bus |
flightPlanner | FlightPlanner <any > | a flight planner instance |
definitions | PerformancePlanDefinitionObject <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
Name | Type | Default value | Description |
---|---|---|---|
from | number | undefined | from index |
to | number | undefined | to index |
skipChecks | boolean | false | whether to skip flight planner checks |
sync | boolean | true | whether 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
Name | Type | Description |
---|---|---|
atIndex | number | the 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
Name | Type | Description |
---|---|---|
callbacks | PerformancePlanProxyCallbacks <P > | an object containing the callbacks to attach to the proxy |
Returns
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
Name | Type | Description |
---|---|---|
index | number | flight 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
Name | Type | Description |
---|---|---|
index | number | the 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
Name | Type | Description |
---|---|---|
planIndex | number | the plan index |
Returns
void
Defined in
src/sdk/performance/PerformancePlanRepository.ts:220