.the application in a nutshell
The Application object contains 2 main threads: a NMEA Sentence Broker thread that listens out for incoming NMEA data ('live' from a GPS unit or 'replayed' from a text file) and maintains a list of the most up-to-date copy of each NMEA Sentence received; and a Widget Manager thread that maintains a list of Widget objects and coordinates data sharing between them. Each NMEA Sentence object maintains a list of Widgets that are interested in being told when it changes. Each time a Widget gets notified of a Sentence update it refreshes the DrawnObject(s) that it contains using the new data.
Each DrawnObject is allocated a portion of 'real estate' within the Widget and it fills this area as it sees fit. Each DrawnObject adds its menu items to the Widget's MenuBar. Most DrawnObjects have a visual indicator (a coloured square) that indicates the relative age of the data it is displaying - green is recent/good, red is old/bad. Most DrawnObjects can be displayed in one of several formats (e.g. digital or analog) and using one of several units (e.g. km/h or m/s). Each DrawnObject also has options that are unique to itself.
The Application object also maintains a Waypoint Editor, as well as system-wide options such as data sources and colour scheme (the 'Night' colour scheme is showcased below). The configuration of each Widget (including screen location and size) plus the Application itself can be saved (to XML files).
.widget screen-shots
So far I have assembled eight Widgets (plus a Test Widget that simply displays textual output of every available NMEA Sentence). Several of the Widgets use the same DrawnOutput classes - each combination is tailored for a specific task. New Widgets can be built (using the available DrawnOutput objects) with very little coding - essentially all that is required is the specification of a visual layout and DrawnObject defaults. Here is a summary of the Widgets I have built to date ...
'GPS Combo' Widget
This Widget displays a collection of the most common GPS information types. Clicking on a specific DrawnOutput object makes it the right-most (i.e. largest scale) object displayed.
Displays an Altitude DrawnObject (Defaulted to: Display="Digital"; Source="GPS"; Units="Metres"), a Compass DrawnObject (Defaulted to: CMG Averaging="None"; Display="Analog"; Show="CMG (Heading)"; Units="True"), a Satellite DrawnObject (Defaulted to: Orientation="North Ahead"; Projection="Angular"; Satellite Label="Satellite ID (PRN)"; "Show PDOP"), a Speed DrawnObject (Defaulted to: Display="Digital"; Units="Knots") and a Time DrawnObject (Defaulted to: Display="Analog"; Zone="UTC").
'Track Plot' Widget
This Widget displays a plot of positions since the beginning of the journey, as well as a visual indication of the direct path to the next waypoint. Clicking+dragging anywhere on the Widget allows you to set the next waypoint (bearing and distance from current position are displayed whilst the new waypoint is dragged around). Apparent wind direction is also displayed (the data for this comes from a shared wind speed/direction object). Map image tiles can be optionally underlayed (the scale of the track plot is then set to that of the map image and the 'zoom' slider is disabled).
Displays a TripLog DrawnObject, type 1 (Defaulted to: Orientation="North Ahead" + "Auto-zoom").
'Trip Log' Widget
This Widget displays a graph of trip data. The graph can display 'altitude vs time', 'altitude vs distance', 'distance vs time', 'speed vs time' or 'speed vs distance'. Clicking anywhere on the Widget marks a point from which minimum, maximum and average values are calculated.
Displays a TripLog DrawnObject, type 2 (Defaulted to: Units="Metres" + "Knots").
'Navigator' Widget
This Widget facilitates getting to the next waypoint. Clicking anywhere on the Widget creates a MOB waypoint and makes this the new 'next waypoint'.
Displays a Compass DrawnObject (Defaulted to: CMG Averaging="Last 10 seconds"; Display="Relative To Next Waypoint"; Show="CMG (Heading)"+"Show Next Waypoint"; Units="True") and a Lat/Lon DrawnObject (Defaulted to: Show="Relative To Next Waypoint").
'Wind Indicator' Widget
This Widget is a little different from the others in that it uses input from a non-NMEA device (a home-built wind sensor) as well as NMEA-based CMG or Heading data. A single wind speed/direction object is shared by all Widgets via the Application object. The relative wind bearing is displayed inside a compass rose (CMG or Heading ahead). A configurable 'dead zone' segment is displayed as well.
Displays a WindIndicator DrawnObject (Defaulted to: Wind Speed Units="Knots"; CMG Averaging="None"; Show="CMG"+"Show Next Waypoint").
'GPS Fix Scatter Plot' Widget
This Widget displays a plot of position fixes over time. Its primary purpose is to average the position fixes of a stationary GPS unit to refine the accuracy of a fixed location. Latitude and longitude fixes are displayed on the 'bulls eye' and altitude fixes are displayed on the vertical axis on the right-hand side of the Widget.
Displays a Scatter DrawnObject (Defaulted to: Range="10m"; Sample Interval="Every 5 seconds").
'GPS Satellite Tracker' Widget
This Widget displays a Satellite DrawnObject (Defaulted to: Orientation="North Ahead"; Projection="Angular"; Satellite Label="Satellite ID (PRN)"; "Show PDOP").
'GPS Latitude & Longitude' Widget
This Widget displays a Lat/Lon DrawnObject (Defaulted to: Show="Absolute").
|