Skip to content

Dashboard Widget

Shane Looker edited this page May 15, 2020 · 4 revisions

The dashboard widget is a compound widget that aggregates important physical state information about the aircraft into a dashboard. It includes the CompassWidget, AltitudeWidget, HomeDistanceWidget, RCDistanceWidget, HorizontalVelocityWidget, VerticalVelocityWidget, and the VPSWidget.

Images/DashboardWidgetImages/DashboardWidget.gif

Usage

If creating the dashboard widget through code it can be added using the convenience method:

- (void)installInViewController:(nullable UIViewController *)viewController

which adds the widget the method is called on, as a subview of the ViewController, that is passed in as an argument. Following this, add constraints to the widget using its widgetSizeHint property to determine width, height and aspect ratio constraints.

If creating the widget through storyboard use the object library to drag a container view controller into the desired view controller like so:

Following this make sure to change the class of the child view controller to be DUXBetaDashboardWidget. From here you can create the constraints on the container view using the Dashboard Widget's widgetSizeHint property.

Full list of properties

List of properties
  • locationManagerAccuracy - Type used to represent a location accuracy level in meters. The lower the value in meters, the more physically precise the location is. A negative accuracy value indicates an invalid location.
Clone this wiki locally