Porównaj commity

...

8 Commity

Autor SHA1 Wiadomość Data
claudius310 9934ea9f46
Merge 56d1e9d468 into eec0b15d4a 2024-04-02 07:08:23 +00:00
Adrian Batzill 56d1e9d468 Merge branch 'webimprovements' 2024-03-26 17:51:32 +00:00
Adrian Batzill 0be177e621 fix formatting 2024-03-26 17:50:43 +00:00
Stefano a953276386 Web minor improvements bugfixes 2024-04-01 19:07:26 +02:00
Stefano 73c1bce945 Renamed Gain to Dump1090Gain 2024-04-01 18:14:18 +02:00
Stefano 263e155d9d Antenna_Gain_UploadChanges 2024-04-01 18:14:18 +02:00
Stefano de812ff36f Antenna_Gain_rev1 2024-04-01 18:14:18 +02:00
Adrian Batzill 4f82c233a0 make gain setting actually work correctly 2024-03-26 17:41:20 +00:00
9 zmienionych plików z 86 dodań i 5 usunięć

Wyświetl plik

@ -1187,6 +1187,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
@ -1300,6 +1301,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
}
@ -805,6 +814,7 @@ func sdrWatcher() {
prevOGNEnabled := false
prevAISEnabled := false
prevOGNTXEnabled := false
prevdump1090Gain := globalSettings.Dump1090Gain
// Get the system (RPi) uptime.
info := syscall.Sysinfo_t{}
@ -883,6 +893,7 @@ func sdrWatcher() {
ognEnabled := globalSettings.OGN_Enabled
aisEnabled := globalSettings.AIS_Enabled
ognTXEnabled := globalSettings.OGNI2CTXEnabled
dump1090Gain := globalSettings.Dump1090Gain
count := rtl.GetDeviceCount()
interfaceCount := count
if globalStatus.UATRadio_connected {
@ -895,7 +906,8 @@ func sdrWatcher() {
count = 3
}
if interfaceCount == prevCount && prevESEnabled == esEnabled && prevUATEnabled == uatEnabled && prevOGNEnabled == ognEnabled && prevAISEnabled == aisEnabled && prevOGNTXEnabled == ognTXEnabled {
if interfaceCount == prevCount && prevESEnabled == esEnabled && prevUATEnabled == uatEnabled && prevOGNEnabled == ognEnabled && prevAISEnabled == aisEnabled &&
prevOGNTXEnabled == ognTXEnabled && prevdump1090Gain == dump1090Gain {
continue
}
@ -924,6 +936,7 @@ func sdrWatcher() {
prevOGNEnabled = ognEnabled
prevAISEnabled = aisEnabled
prevOGNTXEnabled = ognTXEnabled
prevdump1090Gain = dump1090Gain
countEnabled := 0

Wyświetl plik

@ -1,3 +1,4 @@
<div ui-content-for="title">Developer</div>
<div class="col-sm-12">
<div class="panel-group col-sm-6">
<div class="panel panel-default">

Wyświetl plik

@ -45,6 +45,11 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
};
socket.onmessage = function (msg) {
if ($scope === undefined || $scope === null) {
socket.close();
return;
}
loadSituation(msg.data);
$scope.$apply(); // trigger any needed refreshing of data
};
@ -61,7 +66,11 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
function sizeMap() {
var width = 0;
var el = document.getElementById("map_display").parentElement;
var div = document.getElementById("map_display");
if (div==null) {
return width;
}
var el = div.parentElement;
width = el.offsetWidth; // was (- (2 * el.offsetLeft))
if (width !== display_area_size) {
display_area_size = width;

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) {
@ -430,7 +443,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
$scope.updateBaud = function () {
settings["Baud"] = 0;
if (($scope.Baud !== undefined) && ($scope.Baud !== null)) {
if ($scope.Baud !== undefined && $scope.Baud !== null) {
settings["Baud"] = parseInt($scope.Baud);
var newsettings = {
"Baud": settings["Baud"]

Wyświetl plik

@ -210,6 +210,10 @@ function StatusCtrl($rootScope, $scope, $state, $http, $interval, craftService)
};
function getTowers() {
// Homepage status polling towers only if they are active
if ($scope.visible_uat===undefined || $scope.visible_uat==false) {
return;
}
// Simple GET request example (note: responce is asynchronous)
$http.get(URL_TOWERS_GET).
then(function (response) {

Wyświetl plik

@ -258,6 +258,7 @@ function TrafficCtrl($rootScope, $scope, $state, $http, $interval, craftService)
}
// stop stale traffic cleanup
$interval.cancel(clearStaleTraffic);
$interval.cancel(getClock);
};
// Traffic Controller tasks

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.toFixed(1)==0.9">0.9</option>
<option value="1.4" ng-selected="Dump1090Gain.toFixed(1)==1.4">1.4</option>
<option value="2.7" ng-selected="Dump1090Gain.toFixed(1)==2.7">2.7</option>
<option value="3.7" ng-selected="Dump1090Gain.toFixed(1)==3.7">3.7</option>
<option value="7.7" ng-selected="Dump1090Gain.toFixed(1)==7.7">7.7</option>
<option value="8.7" ng-selected="Dump1090Gain.toFixed(1)==8.7">8.7</option>
<option value="12.5" ng-selected="Dump1090Gain.toFixed(1)==12.5">12.5</option>
<option value="14.4" ng-selected="Dump1090Gain.toFixed(1)==14.4">14.4</option>
<option value="15.7" ng-selected="Dump1090Gain.toFixed(1)==15.7">15.7</option>
<option value="16.6" ng-selected="Dump1090Gain.toFixed(1)==16.6">16.6</option>
<option value="19.7" ng-selected="Dump1090Gain.toFixed(1)==19.7">19.7</option>
<option value="20.7" ng-selected="Dump1090Gain.toFixed(1)==20.7">20.7</option>
<option value="22.9" ng-selected="Dump1090Gain.toFixed(1)==22.9">22.9</option>
<option value="25.4" ng-selected="Dump1090Gain.toFixed(1)==25.4">25.4</option>
<option value="28.0" ng-selected="Dump1090Gain.toFixed(1)==28.0">28.0</option>
<option value="29.7" ng-selected="Dump1090Gain.toFixed(1)==29.7">29.7</option>
<option value="32.8" ng-selected="Dump1090Gain.toFixed(1)==32.8">32.8</option>
<option value="33.8" ng-selected="Dump1090Gain.toFixed(1)==33.8">33.8</option>
<option value="36.4" ng-selected="Dump1090Gain.toFixed(1)==36.4">36.4</option>
<option value="37.2" ng-selected="Dump1090Gain.toFixed(1)==37.2">37.2 DEFAULT</option>
<option value="38.6" ng-selected="Dump1090Gain.toFixed(1)==38.6">38.6</option>
<option value="40.2" ng-selected="Dump1090Gain.toFixed(1)==40.2">40.2</option>
<option value="42.1" ng-selected="Dump1090Gain.toFixed(1)==42.1">42.1</option>
<option value="43.4" ng-selected="Dump1090Gain.toFixed(1)==43.4">43.4</option>
<option value="43.9" ng-selected="Dump1090Gain.toFixed(1)==43.9">43.9</option>
<option value="44.5" ng-selected="Dump1090Gain.toFixed(1)==44.5">44.5</option>
<option value="48.0" ng-selected="Dump1090Gain.toFixed(1)==48.0">48.0</option>
<option value="49.6" ng-selected="Dump1090Gain.toFixed(1)==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>