Skip to content

Commit

Permalink
Framework 0.3.0, NXi 1.0.3, and GSDK 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnischan committed Sep 29, 2022
1 parent 048189f commit 82b5560
Show file tree
Hide file tree
Showing 1,007 changed files with 45,934 additions and 31,309 deletions.
69 changes: 69 additions & 0 deletions src/garminsdk/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Working Title Garmin SDK v0.1

These are the changes between the initial public release of the garminsdk and current release version 0.1.0.

## AHRS / ADC
* Added `AdcSystem` and moved ADC-related events to that.
* `AhrsSystem` now republishes relevant AHRS data to the bus under its own indexed topics for ease of consumption.
* `AhrsSystem` now publishes whether heading and altitude data are valid.
* Magnetometer failure no longer causes AHRS to fail, and a functioning magnetometer is no longer required for AHRS alignment.
* Updated horizon display and ASI to fully source data from `AhrsSystem` and `AdcSystem`.

## Map
* The map now draws all fallback flight path vectors and certain CF leg vectors as roll-heading vectors (arrows).
* Transitions that are part of leg-to-leg turns where one half of the turn joins a roll-heading vector are now fully drawn as roll-heading vectors.
* `MapOrientationRTRController` and map builder now support mapping orientation modes to subscribable target offsets/range endpoints in addition to static ones.
* Maps now render TOD/BOD markers where appropriate.
* Maps now correctly revert to heading-up under the hood when in track-up mode while on the ground.
* Fixed bug where map range compass layer could be missing heading labels after a map resize.
* Tweaked various map builder options to adjust to the new `TrafficSystem` interface.

## Traffic
* All Garmin traffic systems now implement the new interface `TrafficSystem`.
* Added more styling options to `TrafficMapRangeLayer`.
* `TrafficMapRangeLayer` will now always display ranges in nautical miles.
* Fixed a bug where `TrafficMapRangeLayer` would not draw ticks correctly after its parent map was resized.
* Fixed traffic offscale indications persisting after alert had been canceled.

## Autopilot
* Change default max bank angle in `GarminAPConfig` from 30 to 25.
* Instantiate the new `APBackCourseDirector` in `GarminAPConfig`.

## FMS
* Add vector anticipation protection for invalid legs.
* CF leg calc now respects a leg's lat/lon fields if they are defined.
* `GarminObsDirector` now always uses the magnetic variation at the OBS fix to compute a true course to track.
* Added new `ObsSuspDataProvider` class to handle SUSP mode.
* Set `vnavNextLegTargetAltitude` in `GarminVNavManager`.
* `GarminVNavManager` no longer requires `nextLeg`.
* Send active leg change after segments cleared to reset active leg in `NavDataComputer`.
* `FmaDisplaySlot` renamed to `FmaModeSlot` and its props were changed to make it more explicit that it requires the transition state of the active mode rather than the armed modes.
* `FmaApSlot` renamed to `FmaMasterSlot` and changed to handle just one master setting each.
* Enhanced `isDuplicateLeg` in FMS to handle when idents match but assciated airport is different.
* Moved various FMA components from g1000 to garminsdk.
* Don't show VNAV UNAVAILABLE message when beyond FAF.
* Fixed issue where deduping a CF after an intercept leg alters the flight path significantly.
* Fixed a bug with path rearm due to changes in LNAV sequencing.
* Fixed a bug where `addVisualFacilityFromLeg` would try to add discos to the repo.
* Fixed a bug that caused GS GP to not fully deactivate in some cases.
* Fixed issue that could cause direct-to with MANSEQ active to activate the next leg.

## Altimeter / Minimums
* Added support for NXi/G3000-style altimeter.
* Added `RadarAltimeterSystem`.
* Added `RadarAltimeter` component.
* `RadarAltimeterDataProvider` now smooths the provided radar altitude and provides a data failed state.
* Added `MinimumsAlerter`.
* Added a standard PFD minimums display component.

## Miscellaneous
* Added `WeatherRadar` component and `WeatherRadarUserSettingTypes` user setting type definition.
* Added support for properly updating flight plan state when using the travel-to feature.
* Added display of bush trip flight plans based on community feedback.
* Moved softkey framework from g1000 project to garminsdk.
* Moved some HSI components to garminsdk.
* Added `CdiScaleFormatter` class to generate text formatters for CDI scaling modes.
* Changed `UnitFormatter` output string for inches of mercury to 'IN'.
* TAS/TIS now correctly initialize to operating mode if starting flight in air.
* Fixed garmin visual approach legs not showing up in procedure previews
* Fixed various issues related to the display of bearing pointers and related info.
2 changes: 1 addition & 1 deletion src/garminsdk/autopilot/FmaData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APAltitudeModes, APLateralModes, APVerticalModes } from 'msfssdk/autopilot';
import { APAltitudeModes, APLateralModes, APVerticalModes } from 'msfssdk';

/**
* A G1000 NXi FMA data object.
Expand Down
34 changes: 20 additions & 14 deletions src/garminsdk/autopilot/GarminAPConfig.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { FlightPlanner } from 'msfssdk/flightplan';
import { APConfig, APLateralModes, APValues, APVerticalModes, BottomTargetPathCalculator, PlaneDirector, VNavManager } from 'msfssdk/autopilot';
import { APAltCapDirector, APLvlDirector, APAltDirector, APFLCDirector, APGPDirector, APGSDirector, APHdgDirector, APNavDirector, APPitchDirector, APRollDirector, APVSDirector, LNavDirector, APVNavPathDirector } from 'msfssdk/autopilot/directors';
import { GarminNavToNavManager } from './GarminNavToNavManager';
import {
APAltCapDirector, APAltDirector, APBackCourseDirector, APConfig, APFLCDirector, APGPDirector, APGSDirector, APHdgDirector, APLateralModes, APLvlDirector,
APNavDirector, APPitchDirector, APRollDirector, APValues, APVerticalModes, APVNavPathDirector, APVSDirector, BottomTargetPathCalculator, EventBus,
FlightPlanner, LNavDirector, NavMath, PlaneDirector, UnitType, VNavManager
} from 'msfssdk';

import { GarminObsDirector } from './directors';
import { NavMath, UnitType } from 'msfssdk';
import { EventBus } from 'msfssdk/data/EventBus';
import { GarminNavToNavManager } from './GarminNavToNavManager';
import { GarminVNavManager } from './GarminVNavManager';


/**
* A Garmin Autopilot Configuration.
*/
export class GarminAPConfig implements APConfig {
public defaultLateralMode = APLateralModes.ROLL;
public defaultVerticalMode = APVerticalModes.PITCH;
public defaultMaxBankAngle = 25; // Note this is the max bank angle for most G1000/GFC700 installations, but not all. Some are 22, some are 27.
private obsDirector = new GarminObsDirector(this.bus);
/**
* Instantiates the AP Config for the Autopilot.
Expand All @@ -24,14 +25,20 @@ export class GarminAPConfig implements APConfig {
constructor(private readonly bus: EventBus, private readonly flightPlanner: FlightPlanner, private readonly verticalPathCalculator: BottomTargetPathCalculator) {
}

/** @inheritdoc */
public createVariableBankManager(): undefined {
return undefined;
}

/** @inheritdoc */
public createHeadingDirector(apValues: APValues): APHdgDirector {
return new APHdgDirector(this.bus, apValues);
}

/** @inheritdoc */
public createRollDirector(): APRollDirector {
return new APRollDirector(this.bus, { minimumBankAngle: 6, maximumBankAngle: 22 });
public createRollDirector(apValues: APValues): APRollDirector {
// Note: This max bank angle is for the C172, while other aircraft have higher limits.
return new APRollDirector(this.bus, apValues, { minimumBankAngle: 6, maximumBankAngle: 22 });
}

/** @inheritdoc */
Expand All @@ -40,8 +47,8 @@ export class GarminAPConfig implements APConfig {
}

/** @inheritdoc */
public createGpssDirector(): LNavDirector {
return new LNavDirector(this.bus, this.flightPlanner, this.obsDirector, this.lnavInterceptCurve.bind(this));
public createGpssDirector(apValues: APValues): LNavDirector {
return new LNavDirector(this.bus, apValues, this.flightPlanner, this.obsDirector, this.lnavInterceptCurve.bind(this), true);
}

/** @inheritdoc */
Expand All @@ -55,8 +62,8 @@ export class GarminAPConfig implements APConfig {
}

/** @inheritdoc */
public createBcDirector(): undefined {
return undefined;
public createBcDirector(apValues: APValues): APBackCourseDirector {
return new APBackCourseDirector(this.bus, apValues, APLateralModes.BC, this.navInterceptCurve.bind(this));
}

/** @inheritdoc */
Expand Down Expand Up @@ -209,4 +216,3 @@ export class GarminAPConfig implements APConfig {
return UnitType.RADIAN.convertTo(Math.acos(NavMath.clamp((turnRadius - Math.abs(xtk)) / turnRadius, -1, 1)), UnitType.DEGREE) / 2;
}
}

6 changes: 3 additions & 3 deletions src/garminsdk/autopilot/GarminAPStateManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ControlEvents, HEvent, KeyEventData, KeyInterceptManager, SimVarValueType } from 'msfssdk/data';
import { NavSourceType } from 'msfssdk/instruments';
import { APLateralModes, APModeType, APStateManager, APVerticalModes } from 'msfssdk/autopilot';
import {
APLateralModes, APModeType, APStateManager, APVerticalModes, ControlEvents, HEvent, KeyEventData, KeyInterceptManager, NavSourceType, SimVarValueType
} from 'msfssdk';

/**
* A G1000 NXi autopilot state manager.
Expand Down
13 changes: 5 additions & 8 deletions src/garminsdk/autopilot/GarminNavToNavManager.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { NavMath, UnitType, GeoPoint } from 'msfssdk';
import { EventBus, ControlEvents, Consumer } from 'msfssdk/data';
import { Localizer, CdiDeviation, Radio, RadioType, NavSourceId, NavSourceType, RadioEvents, FrequencyBank, ADCEvents, NavEvents, GNSSEvents, NavRadioEvents, ClockEvents } from 'msfssdk/instruments';
import { FacilityFrequency, FixTypeFlags } from 'msfssdk/navigation';
import { APValues, NavToNavManager } from 'msfssdk/autopilot';
import { FlightPlanner } from 'msfssdk/flightplan';
import { LNavEvents } from 'msfssdk/autopilot';
import {
AhrsEvents, APValues, CdiDeviation, ClockEvents, Consumer, ControlEvents, EventBus, FacilityFrequency, FixTypeFlags, FlightPlanner, FrequencyBank, GeoPoint,
GNSSEvents, LNavEvents, Localizer, NavEvents, NavMath, NavRadioEvents, NavSourceId, NavSourceType, NavToNavManager, Radio, RadioEvents, RadioType, UnitType
} from 'msfssdk';

/**
* A Garmin nav-to-nav manager.
Expand Down Expand Up @@ -169,7 +166,7 @@ export class GarminNavToNavManager implements NavToNavManager {
* Method to monitor nav events to keep track of NAV related data needed for guidance.
*/
private monitorEvents(): void {
const sub = this.bus.getSubscriber<RadioEvents & NavEvents & NavRadioEvents & ADCEvents & GNSSEvents & LNavEvents & ControlEvents & ClockEvents>();
const sub = this.bus.getSubscriber<RadioEvents & NavEvents & NavRadioEvents & AhrsEvents & GNSSEvents & LNavEvents & ControlEvents & ClockEvents>();

sub.on('set_radio_state').handle((state) => {
this.updateRadioState(state);
Expand Down
Loading

0 comments on commit 82b5560

Please sign in to comment.