Skip to content

Feature: Display unit conversion #119

Description

@ETSells

Feature Suggestion

Describe the Feature

We should make the display units for the dashboard configurable. This will allow us to display certain quantities in units that are more human readable.

We will want to include settings for the following:

As a toggle switch, QNH <-> QFE (sea level reference pressure altitude to ground level reference pressure altitude). Note that this toggle will only enable QFE if a reference altitude packet has been received or reference altitude is manually configured, else the altitude functions should continue returning QNH.

Dropdowns for the following:

  • Altitude
    • ft (default)
    • m (SI/source unit)
  • Acceleration
    • g-force (default)
    • m/s^2 (SI/source unit)
  • Distance
    • Sm (default) (statute miles)
    • Nm (nautical miles)
    • m (meters) (SI/source unit)
    • ft (feet)
  • Attitude
    • Degrees Euler (pitch/yaw/roll degrees)
    • Unit Quaternion (no units apply

Liquids will require different display units that can re-use the same system (cc: @MasterUser43)

Ideally, we will be able to cache the selected units per-user.

Then, we should wire up these configurations to set variables that can be used in a system units utility for conversions before displaying.

Proposed Solution

The units options should be a section of the settings page. We will also want a system units utility:

getDistanceAsDisplayUnits( float inputVal ) --> float outputVal (inputVal in SI/system units, outputVal in display units)
getDistanceDisplayString( float distance) --> string unitsString (for example: ft if units are feet)

(extend for all other unit types)

It should be noted that altitude should have special formatting. If QNH is enabled, output the string as normal. If QFE is enabled, output the string like {value} {unit} AGL.

In case a given widget applies special handling for its units, we should also have a method to retrieve just the units string, and a boolean for QFE vs QNH mode for the altitude units.

Additional Notes

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

priority: mediumNormal priority, should be fixed soon.type: featureNew functionality, capability, or product additions.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions