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
Parameter | Type | Description |
---|---|---|
flightPlanner | FlightPlanner | a flight planner instance |
bus | EventBus | the 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
Parameter | Type | Default value | Description |
---|---|---|---|
from | number | undefined | from index |
to | number | undefined | to index |
skipChecks | boolean | false | whether 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
Parameter | Type | Description |
---|---|---|
atIndex | number | the index |
Returns
the created plan
defaultValuesPlan()
defaultValuesPlan():
PerformancePlan
Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:124
Returns the performance plan containing default values
Returns
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
Parameter | Type | Description |
---|---|---|
index | number | flight plan index |
Returns
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
the active plan
getModPlan()
getModPlan():
PerformancePlan
Defined in: workingtitle-instruments-wt21/shared/Performance/PerformancePlanRepository.ts:115
Gets the mod plan.
Returns
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
Parameter | Type | Description |
---|---|---|
index | number | the 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
Parameter | Type | Description |
---|---|---|
planIndex | number | the plan index |
Returns
void