Skip to main content

Class: TestingUtils

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:10

A set of functions for modifying a flight plan in the simplest way possible.

Constructors

Constructor

new TestingUtils(): TestingUtils

Returns

TestingUtils

Methods

directToRandom()

static directToRandom(fms, ident, course?): Promise<Facility>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:362

Creates a direct to random to the given ident.

Parameters

ParameterTypeDescription
fmsFmsThe Fms.
identstringThe ident.
course?numberThe magnetic course for the Direct To. If undefined, the Direct To will be initiated from the airplane's present position.

Returns

Promise<Facility>

The facility matching the ident.


findNearestFacilityFromIdent()

static findNearestFacilityFromIdent(fms, ident, facilityType): Promise<Facility>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:175

Searches for facilities matching ident, returns the nearest one.

Parameters

ParameterTypeDefault valueDescription
fmsFmsundefinedThe FMS.
identstringundefinedThe ident to search for.
facilityTypeFacilitySearchTypeFacilitySearchType.AllThe facility type to search for.

Returns

Promise<Facility>

The selected facility.


findNearestIntersectionFromIdent()

static findNearestIntersectionFromIdent(fms, ident): Promise<IntersectionFacility>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:164

Searches for facilities matching ident, returns the nearest one.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
identstringThe intersection ident to search for.

Returns

Promise<IntersectionFacility>

The selected facility.


getAirwayFromLeg()

static getAirwayFromLeg(fms, entryIdent, airwayName): Promise<AirwayObject>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:146

Checks for an airway at a leg and returns the airway.

Parameters

ParameterTypeDescription
fmsFmsThe Fms.
entryIdentstringThe icao of the entry to check.
airwayNamestringThe airway to search for.

Returns

Promise<AirwayObject>

The airway object.


insertAirway()

static insertAirway(fms, airwayName, entryIdent, exitIdent, segmentIndex, segmentLegIndex): Promise<[AirwayObject, IntersectionFacility, IntersectionFacility]>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:122

Sets the destination for the flight plan.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
airwayNamestringThe name of the airway.
entryIdentstringThe ident for the airway entry.
exitIdentstringThe ident for the airway exit.
segmentIndexnumberThe index of the segment to add the waypoint to.
segmentLegIndexnumberThe index inside the segment to insert the waypoint at (if none, append).

Returns

Promise<[AirwayObject, IntersectionFacility, IntersectionFacility]>

The destination facility.


insertWaypoint()

static insertWaypoint(fms, ident, segmentIndex, segmentLegIndex?): Promise<Facility>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:104

Sets the destination for the flight plan.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
identstringThe ident to search for.
segmentIndexnumberThe index of the segment to add the waypoint to.
segmentLegIndex?numberThe index inside the segment to insert the waypoint at (if none, append).

Returns

Promise<Facility>

The destination facility.


loadApproach()

static loadApproach(fms, destination, approachName, transitionName?): Promise<void>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:326

Loads an approach.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
destinationAirportFacilityThe destination facility. Get this by calling setDestination first.
approachNamestringThe name of the approach, like 'ILS 17L'.
transitionName?stringThe name of the approach transition, like 'BRK' or 'ADANE'.

Returns

Promise<void>

Throws

Error if something couldn't be found with given inputs.


loadArrival()

static loadArrival(fms, destination, arrivalName, transitionName?, runwayTransitionName?): void

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:274

Loads an arrival.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
destinationAirportFacilityThe destination facility. Get this by calling setDestination first.
arrivalNamestringThe name of the arrival, like 'DBRY4'.
transitionName?stringThe name of the arrival transition, like 'ALS'.
runwayTransitionName?stringThe name of the arrival runway transition, like '17R'.

Returns

void

Throws

Error if something couldn't be found with given inputs.


loadDeparture()

static loadDeparture(fms, origin, departureName, runwayName, transitionName?): void

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:219

Loads a departure.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
originAirportFacilityThe origin facility. Get this by calling setOrigin first.
departureNamestringThe departure name, like 'BAYLR6'.
runwayNamestringThe name of the runway, like '34L'.
transitionName?stringThe name of the enroute transition, like 'HBU'.

Returns

void

Throws

Error if something couldn't be found with given inputs.


removeDestination()

static removeDestination(fms): void

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:92

Removes the destination.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.

Returns

void


removeOrigin()

static removeOrigin(fms): void

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:84

Removes the origin.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.

Returns

void


setDestination()

static setDestination(fms, ident): Promise<AirportFacility>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:67

Sets the destination for the flight plan.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
identstringThe ICAO to set, like 'KCOS'.

Returns

Promise<AirportFacility>

The destination facility.


setOrigin()

static setOrigin(fms, ident): Promise<AirportFacility>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:18

Sets the origin for the flight plan.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
identstringThe ICAO to set, like 'KDEN'.

Returns

Promise<AirportFacility>

The origin facility.


setOriginRunway()

static setOriginRunway(fms, origin, runwayName): OneWayRunway

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/TestingUtils/TestingUtils.ts:41

Sets the origin for the flight plan.

Parameters

ParameterTypeDescription
fmsFmsThe FMS.
originAirportFacilityThe origin facility. Get this by calling setOrigin first.
runwayNamestringThe runway to set, like '34L'.

Returns

OneWayRunway

The runway.

Throws

Error if runway couldn't be found with given inputs.