Class: PerformancePlanRepository<P, ID>
Defined in: src/sdk/performance/PerformancePlanRepository.ts:46
Correlates flight plan indices with performance plan objects
Type Parameters
| Type Parameter | Default type |
|---|---|
P extends PerformancePlan | - |
ID extends string | any |
Constructors
Constructor
new PerformancePlanRepository<
P,ID>(id,bus,flightPlanner,definitions):PerformancePlanRepository<P,ID>
Defined in: src/sdk/performance/PerformancePlanRepository.ts:66
Ctor
Parameters
| Parameter | Type | Description |
|---|---|---|
id | ID | the performance plan repository ID |
bus | EventBus | the event bus |
flightPlanner | FlightPlanner | a flight planner instance |
definitions | PerformancePlanDefinitionObject<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
staticDEFAULT_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
| Parameter | 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
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
| Parameter | Type | Description |
|---|---|---|
atIndex | number | the 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
| Parameter | Type | Description |
|---|---|---|
callbacks | PerformancePlanProxyCallbacks<P> | an object containing the callbacks to attach to the proxy |
Returns
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
| Parameter | Type | Description |
|---|---|---|
index | number | flight 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
| Parameter | Type | Description |
|---|---|---|
index | number | the 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
| Parameter | Type | Description |
|---|---|---|
planIndex | number | the plan index |
Returns
void