Sunday, 6 March 2016

It's all in the application: Recon Instruments Snow 2 vs Paragliding: Part 8

Continued from Part 7

The refactor continues.

With raw Channel* data being broadcast by the Flight Data Service, we still need to process it before it can be displayed to the user -> either due to the 'noisy' nature of the data (such as a fluctuations in instantaneous vario readings) or the need to aggregate multiple Channels (such as determining Wind Drift or Thermal Location).

The Processors exist to do these tasks of aggregation and low pass filtering. As Channel data arrives at the Display, that data is fed to each of the Processors that the Display has instantiated. If the Processor has all of the data it needs, a result will be returned. If insufficient time has passed since the last invocation of the Processor, the Processor will simply return the cached last result.

Processor

Processors come in two forms:
  1. Framed.
  2. Custom. 
Framed Processors are built from an aggregate of operations:
  1. Converters.
  2. Adjusters.
A Converter takes two or more raw Channels and performs an action upon them - such as subtraction or division - to then return a single result.

Adjusters, on the other hand, take a single raw Channel and perform an action upon it. Think low pass filtering as one example.

Converters and Adjusters

Framed Processors typically involve simple operations that do not involve complex computation or access to external data sources beyond the raw Channels.

For more complex computation, one would implement a Custom Processor. Examples would include Wind Drift and Waypoint Navigation.

Custom Processors

All of the Processors are obtained via the Processor Factory. This factory abstracts the need to differentiate between the Framed and Custom implementations. Requesting a Processor from the Factory is done via the Processor ID.

Processor IDs

With the Processors up and running, we can now Display the results.

* A Channel is a single raw stream of data coming directly from the device - such as vario, pressure or gps altitude, latitude, longitude, ground speed.

Onto Part 9: Displays.

No comments:

Post a Comment