latest OGN tracker, fool proof configuration

pull/827/merge^2
Adrian Batzill 2020-12-22 09:51:08 +00:00
rodzic 1cc7961cc6
commit 826cb570eb
6 zmienionych plików z 30 dodań i 8 usunięć

Wyświetl plik

@ -526,7 +526,7 @@ func configureOgnTracker() {
}
gpsTimeOffsetPpsMs = 200 * time.Millisecond
serialPort.Write([]byte("$POGNS,NavRate=5\r\n")) // Also force NavRate directly, just to make sure it's always set
serialPort.Write([]byte("$POGNS\r\n")) // query current configuration
// Configuration for OGN Tracker T-Beam is similar to normal Ublox config, but
@ -2070,7 +2070,7 @@ func processNMEALine(l string) (sentenceUsed bool) {
if !ognTrackerConfigured {
ognTrackerConfigured = true
go func() {
time.Sleep(5 * time.Second)
time.Sleep(10 * time.Second)
configureOgnTracker()
}()
}
@ -2079,6 +2079,11 @@ func processNMEALine(l string) (sentenceUsed bool) {
}
if x[0] == "POGNS" {
// Tracker notified us of restart (crashed?) -> ensure we configure it again
if len(x) == 2 && x[1] == "SysStart" {
ognTrackerConfigured = false
return true
}
// OGN tracker sent us its configuration
log.Printf("Received OGN Tracker configuration: " + strings.Join(x, ","))
for i := 1; i < len(x); i++ {

@ -1 +1 @@
Subproject commit 0ef3ae4819f24e6807dec1832f7f5eed447a9b19
Subproject commit fcc2b17c56785e8175f7f27251c5a32ac1a6c7cf

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -515,4 +515,21 @@ angular.module('appControllers')
ctrl.$parsers.push(gLimitsValidation);
}
};
})
.directive('pilotnameInput', function() {
return {
require: 'ngModel',
link: function(scope, element, attr, ctrl) {
function pilotnameValidation(value) {
var r = "^[0-9a-zA-Z_]*$";
var valid = new RegExp(r).test(value);
ctrl.$setValidity('pilotname', valid);
if (valid)
return value;
else
return "";
}
ctrl.$parsers.push(pilotnameValidation);
}
}
});

Wyświetl plik

@ -84,7 +84,7 @@
<!-- Address Type -->
<div class="form-group reset-flow">
<label class="control-label col-xs-5">Tracker Address Type</label>
<select class="col-xs-7 custom-select" mode-input ng-model="OGNAddrType">
<select class="col-xs-7 custom-select" ng-model="OGNAddrType">
<option value="0" ng-selected="OGNAddrType=='0'">Random</option>
<option value="1" ng-selected="OGNAddrType=='1'">ICAO</option>
<option value="2" ng-selected="OGNAddrType=='2'">Flarm</option>
@ -101,7 +101,7 @@
<!-- Aircraft Type -->
<div class="form-group reset-flow">
<label class="control-label col-xs-5">Aircraft type</label>
<select class="col-xs-7 custom-select" mode-input ng-model="OGNAcftType">
<select class="col-xs-7 custom-select" ng-model="OGNAcftType">
<option value="1" ng-selected="OGNAcftType=='1'">Glider/Motorglider</option>
<option value="2" ng-selected="OGNAcftType=='2'">Tow plane</option>
<option value="3" ng-selected="OGNAcftType=='3'">Helicopter</option>
@ -123,7 +123,7 @@
<!-- Pilot name -->
<div class="form-group reset-flow">
<label class="control-label col-xs-5">Pilot Name</label>
<input class="col-xs-7" type="text" ng-model="OGNPilot" />
<input class="col-xs-7" type="text" pilotname-input ng-model="OGNPilot" />
</div>
<div class="form-group reset-flow">
@ -209,7 +209,7 @@
<form name="WiFiSettings">
<div class="form-group reset-flow">
<label class="control-label col-xs-5">WiFi Mode</label>
<select class="custom-select" mode-input ng-model="WiFiMode"
<select class="custom-select" ng-model="WiFiMode"
ng-change="WiFiSecurityEnabled=(WiFiSecurityEnabled || WiFiMode=='1')">
<option value="0" ng-selected="WiFiMode=='0'">AccessPoint</option>
<option value="1" ng-selected="WiFiMode=='1'">WiFi-Direct</option>
@ -315,7 +315,7 @@
<div class="form-group" ng-show="IMU_Sensor_Enabled">
<label class="control-label col-xs-7">Minimum fan duty cycle %</label>
<div class="col-xs-5">
<form name="PWMDutyMin" ng-submit="updatePWMDutyMin()" novalidate>
<form name="PWMDutyMinForm" ng-submit="updatePWMDutyMin()" novalidate>
<!-- type="number" not supported except on mobile -->
<input class="col-xs-7" type="number" ng-model="PWMDutyMin" placeholder="0-100" min="0" max="100"
ng-change="updatePWMDutyMin()" />