Merge branch 'master' into bookworm

pull/827/head
Adrian Batzill 2024-04-01 19:12:23 +02:00
commit d8c53c998e
5 zmienionych plików z 64 dodań i 2 usunięć

Wyświetl plik

@ -1188,6 +1188,7 @@ type settings struct {
SensorQuaternion [4]float64 // Quaternion mapping from sensor frame to aircraft frame
C, D [3]float64 // IMU Accel, Gyro zero bias
PPM int
Dump1090Gain float64 // SDR RTL ES Gain
AltitudeOffset int
OwnshipModeS string
WatchList string
@ -1301,6 +1302,7 @@ func defaultSettings() {
globalSettings.UAT_Enabled = false
globalSettings.ES_Enabled = true
globalSettings.OGN_Enabled = true
globalSettings.Dump1090Gain = 37.2
globalSettings.APRS_Enabled = true
globalSettings.GPS_Enabled = true
globalSettings.IMU_Sensor_Enabled = true

Wyświetl plik

@ -395,6 +395,8 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
myIMUReader.Close()
globalStatus.IMUConnected = false // Force a restart of the IMU reader
}
case "Dump1090Gain":
globalSettings.Dump1090Gain = (val.(float64))
case "PPM":
globalSettings.PPM = int(val.(float64))
case "AltitudeOffset":

Wyświetl plik

@ -32,6 +32,7 @@ type Device struct {
closeCh chan int
indexID int
ppm int
gain float64
serial string
idSet bool
}
@ -73,7 +74,14 @@ type AISTermMessage struct {
func (e *ES) read() {
defer e.wg.Done()
log.Println("Entered ES read() ...")
cmd := exec.Command(STRATUX_HOME + "/bin/dump1090", "--fix", "--gain", "37.2", "--net-stratux-port", "30006", "--net", "--device-index", strconv.Itoa(e.indexID), "--ppm", strconv.Itoa(e.ppm))
// RTL SDR Standard Gains: 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
if(e.gain<0.9){
e.gain = 37.2
}
cmd := exec.Command(STRATUX_HOME + "/bin/dump1090", "--fix", "--net-stratux-port", "30006", "--net", "--device-index", strconv.Itoa(e.indexID),
"--ppm", strconv.Itoa(e.ppm),
"--gain",strconv.FormatFloat(e.gain,'f',-1,32),
"--mlat") // display raw messages in Beast ascii mode
stdout, _ := cmd.StdoutPipe()
stderr, _ := cmd.StderrPipe()
@ -411,7 +419,8 @@ func getPPM(serial string) int {
func (e *ES) sdrConfig() (err error) {
e.ppm = getPPM(e.serial)
log.Printf("===== ES Device Serial: %s PPM %d =====\n", e.serial, e.ppm)
e.gain = globalSettings.Dump1090Gain
log.Printf("===== ES Device Serial: %s PPM %d Gain %.1f =====\n", e.serial, e.ppm,e.gain)
return
}

Wyświetl plik

@ -309,6 +309,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
$scope.PersistentLogging = settings.PersistentLogging;
$scope.PPM = settings.PPM;
$scope.Dump1090Gain = settings.Dump1090Gain;
$scope.AltitudeOffset = settings.AltitudeOffset;
$scope.WatchList = settings.WatchList;
$scope.OwnshipModeS = settings.OwnshipModeS;
@ -417,6 +418,18 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
}
};
$scope.updategain = function () {
settings["Dump1090Gain"] = 0;
if (($scope.Dump1090Gain !== undefined) && ($scope.Dump1090Gain !== null)) {
settings["Dump1090Gain"] = parseFloat($scope.Dump1090Gain);
var newsettings = {
"Dump1090Gain": settings["Dump1090Gain"]
};
// console.log(angular.toJson(newsettings));
setSettings(angular.toJson(newsettings));
}
};
$scope.updatePWMDutyMin = function() {
settings['PWMDutyMin'] = 0;
if ($scope.PWMDutyMin !== undefined && $scope.PWMDutyMin !== null) {

Wyświetl plik

@ -234,6 +234,42 @@
ng-blur="updateppm()" />
</form>
</div>
<div ng-show="DeveloperMode" class="form-group reset-flow">
<label class="control-label col-xs-5">SDR Dump 1090 ES Gain</label>
<form name="gainForm" ng-submit="updategain()" novalidate>
<select class="custom-select" ng-model="Dump1090Gain" ng-blur="updategain()">
<option value="0.9" ng-selected="Dump1090Gain==0.9">0.9</option>
<option value="1.4" ng-selected="Dump1090Gain==1.4">1.4</option>
<option value="2.7" ng-selected="Dump1090Gain==2.7">2.7</option>
<option value="3.7" ng-selected="Dump1090Gain==3.7">3.7</option>
<option value="7.7" ng-selected="Dump1090Gain==7.7">7.7</option>
<option value="8.7" ng-selected="Dump1090Gain==8.7">8.7</option>
<option value="12.5" ng-selected="Dump1090Gain==12.5">12.5</option>
<option value="14.4" ng-selected="Dump1090Gain==14.4">14.4</option>
<option value="15.7" ng-selected="Dump1090Gain==15.7">15.7</option>
<option value="16.6" ng-selected="Dump1090Gain==16.6">16.6</option>
<option value="19.7" ng-selected="Dump1090Gain==19.7">19.7</option>
<option value="20.7" ng-selected="Dump1090Gain==20.7">20.7</option>
<option value="22.9" ng-selected="Dump1090Gain==22.9">22.9</option>
<option value="25.4" ng-selected="Dump1090Gain==25.4">25.4</option>
<option value="28.0" ng-selected="Dump1090Gain==28.0">28.0</option>
<option value="29.7" ng-selected="Dump1090Gain==29.7">29.7</option>
<option value="32.8" ng-selected="Dump1090Gain==32.8">32.8</option>
<option value="33.8" ng-selected="Dump1090Gain==33.8">33.8</option>
<option value="36.4" ng-selected="Dump1090Gain==36.4">36.4</option>
<option value="37.2" ng-selected="Dump1090Gain==37.2">37.2 DEFAULT</option>
<option value="38.6" ng-selected="Dump1090Gain==38.6">38.6</option>
<option value="40.2" ng-selected="Dump1090Gain==40.2">40.2</option>
<option value="42.1" ng-selected="Dump1090Gain==42.1">42.1</option>
<option value="43.4" ng-selected="Dump1090Gain==43.4">43.4</option>
<option value="43.9" ng-selected="Dump1090Gain==43.9">43.9</option>
<option value="44.5" ng-selected="Dump1090Gain==44.5">44.5</option>
<option value="48.0" ng-selected="Dump1090Gain==48.0">48.0</option>
<option value="49.6" ng-selected="Dump1090Gain==49.6">49.6</option>
</select>
</form>
</div>
<div class="form-group reset-flow" ng-class="{ 'section_invisible': (!visible_serialout)}">
<label class="control-label col-xs-5">Serial Output Baudrate</label>
<form name="ppmForm" ng-submit="updateBaud()" novalidate>