From c7ad7728d6ad8c1865f80b33aed1a1c9edca2893 Mon Sep 17 00:00:00 2001 From: Keith Tschohl Date: Sun, 25 Dec 2016 20:06:28 +0000 Subject: [PATCH] Add GPS hardware detection status to UI --- web/plates/js/status.js | 36 ++++++++++++++++++++++++++++++++++++ web/plates/status.html | 4 ++++ 2 files changed, 40 insertions(+) diff --git a/web/plates/js/status.js b/web/plates/js/status.js index a8e0aacc..43224239 100644 --- a/web/plates/js/status.js +++ b/web/plates/js/status.js @@ -55,6 +55,42 @@ function StatusCtrl($rootScope, $scope, $state, $http, $interval) { $scope.GPS_satellites_seen = status.GPS_satellites_seen; $scope.GPS_solution = status.GPS_solution; $scope.GPS_position_accuracy = String(status.GPS_solution ? ", " + status.GPS_position_accuracy.toFixed(1) + " m" : " "); + var gpsHardwareCode = (status.GPS_detected_type & 0x0f); + var tempGpsHardwareString = "Not installed"; + switch(gpsHardwareCode) { + case 1: + tempGpsHardwareString = "Serial port"; + break; + case 2: + tempGpsHardwareString = "Prolific USB-serial bridge"; + break; + case 6: + tempGpsHardwareString = "USB u-blox 6 GPS receiver"; + break; + case 7: + tempGpsHardwareString = "USB u-blox 7 GNSS receiver"; + break; + case 8: + tempGpsHardwareString = "USB u-blox 8 GNSS receiver"; + break; + default: + tempGpsHardwareString = "Not installed"; + } + $scope.GPS_hardware = tempGpsHardwareString; + var gpsProtocol = (status.GPS_detected_type >> 4); + var tempGpsProtocolString = "Not communicating"; + switch(gpsProtocol) { + case 1: + tempGpsProtocolString = "NMEA protocol"; + break; + case 3: + tempGpsProtocolString = "UBX protocol"; + break; + default: + tempGpsProtocolString = "Not communicating"; + } + $scope.GPS_protocol = tempGpsProtocolString; + $scope.UAT_METAR_total = status.UAT_METAR_total; $scope.UAT_TAF_total = status.UAT_TAF_total; $scope.UAT_NEXRAD_total = status.UAT_NEXRAD_total; diff --git a/web/plates/status.html b/web/plates/status.html index b56ebb2b..7a7a9fb6 100644 --- a/web/plates/status.html +++ b/web/plates/status.html @@ -64,6 +64,10 @@ {{UAT_Towers}} +
+ + {{GPS_hardware}} ({{GPS_protocol}}) +
{{GPS_solution}}{{GPS_position_accuracy}}