kopia lustrzana https://github.com/cyoung/stratux
Porównaj commity
8 Commity
0316720262
...
9934ea9f46
Autor | SHA1 | Data |
---|---|---|
claudius310 | 9934ea9f46 | |
Adrian Batzill | 56d1e9d468 | |
Adrian Batzill | 0be177e621 | |
Stefano | a953276386 | |
Stefano | 73c1bce945 | |
Stefano | 263e155d9d | |
Stefano | de812ff36f | |
Adrian Batzill | 4f82c233a0 |
|
@ -1187,6 +1187,7 @@ type settings struct {
|
||||||
SensorQuaternion [4]float64 // Quaternion mapping from sensor frame to aircraft frame
|
SensorQuaternion [4]float64 // Quaternion mapping from sensor frame to aircraft frame
|
||||||
C, D [3]float64 // IMU Accel, Gyro zero bias
|
C, D [3]float64 // IMU Accel, Gyro zero bias
|
||||||
PPM int
|
PPM int
|
||||||
|
Dump1090Gain float64 // SDR RTL ES Gain
|
||||||
AltitudeOffset int
|
AltitudeOffset int
|
||||||
OwnshipModeS string
|
OwnshipModeS string
|
||||||
WatchList string
|
WatchList string
|
||||||
|
@ -1300,6 +1301,7 @@ func defaultSettings() {
|
||||||
globalSettings.UAT_Enabled = false
|
globalSettings.UAT_Enabled = false
|
||||||
globalSettings.ES_Enabled = true
|
globalSettings.ES_Enabled = true
|
||||||
globalSettings.OGN_Enabled = true
|
globalSettings.OGN_Enabled = true
|
||||||
|
globalSettings.Dump1090Gain = 37.2
|
||||||
globalSettings.APRS_Enabled = true
|
globalSettings.APRS_Enabled = true
|
||||||
globalSettings.GPS_Enabled = true
|
globalSettings.GPS_Enabled = true
|
||||||
globalSettings.IMU_Sensor_Enabled = true
|
globalSettings.IMU_Sensor_Enabled = true
|
||||||
|
|
|
@ -395,6 +395,8 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
|
||||||
myIMUReader.Close()
|
myIMUReader.Close()
|
||||||
globalStatus.IMUConnected = false // Force a restart of the IMU reader
|
globalStatus.IMUConnected = false // Force a restart of the IMU reader
|
||||||
}
|
}
|
||||||
|
case "Dump1090Gain":
|
||||||
|
globalSettings.Dump1090Gain = (val.(float64))
|
||||||
case "PPM":
|
case "PPM":
|
||||||
globalSettings.PPM = int(val.(float64))
|
globalSettings.PPM = int(val.(float64))
|
||||||
case "AltitudeOffset":
|
case "AltitudeOffset":
|
||||||
|
|
19
main/sdr.go
19
main/sdr.go
|
@ -32,6 +32,7 @@ type Device struct {
|
||||||
closeCh chan int
|
closeCh chan int
|
||||||
indexID int
|
indexID int
|
||||||
ppm int
|
ppm int
|
||||||
|
gain float64
|
||||||
serial string
|
serial string
|
||||||
idSet bool
|
idSet bool
|
||||||
}
|
}
|
||||||
|
@ -73,7 +74,14 @@ type AISTermMessage struct {
|
||||||
func (e *ES) read() {
|
func (e *ES) read() {
|
||||||
defer e.wg.Done()
|
defer e.wg.Done()
|
||||||
log.Println("Entered ES read() ...")
|
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()
|
stdout, _ := cmd.StdoutPipe()
|
||||||
stderr, _ := cmd.StderrPipe()
|
stderr, _ := cmd.StderrPipe()
|
||||||
|
|
||||||
|
@ -411,7 +419,8 @@ func getPPM(serial string) int {
|
||||||
|
|
||||||
func (e *ES) sdrConfig() (err error) {
|
func (e *ES) sdrConfig() (err error) {
|
||||||
e.ppm = getPPM(e.serial)
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -805,6 +814,7 @@ func sdrWatcher() {
|
||||||
prevOGNEnabled := false
|
prevOGNEnabled := false
|
||||||
prevAISEnabled := false
|
prevAISEnabled := false
|
||||||
prevOGNTXEnabled := false
|
prevOGNTXEnabled := false
|
||||||
|
prevdump1090Gain := globalSettings.Dump1090Gain
|
||||||
|
|
||||||
// Get the system (RPi) uptime.
|
// Get the system (RPi) uptime.
|
||||||
info := syscall.Sysinfo_t{}
|
info := syscall.Sysinfo_t{}
|
||||||
|
@ -883,6 +893,7 @@ func sdrWatcher() {
|
||||||
ognEnabled := globalSettings.OGN_Enabled
|
ognEnabled := globalSettings.OGN_Enabled
|
||||||
aisEnabled := globalSettings.AIS_Enabled
|
aisEnabled := globalSettings.AIS_Enabled
|
||||||
ognTXEnabled := globalSettings.OGNI2CTXEnabled
|
ognTXEnabled := globalSettings.OGNI2CTXEnabled
|
||||||
|
dump1090Gain := globalSettings.Dump1090Gain
|
||||||
count := rtl.GetDeviceCount()
|
count := rtl.GetDeviceCount()
|
||||||
interfaceCount := count
|
interfaceCount := count
|
||||||
if globalStatus.UATRadio_connected {
|
if globalStatus.UATRadio_connected {
|
||||||
|
@ -895,7 +906,8 @@ func sdrWatcher() {
|
||||||
count = 3
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -924,6 +936,7 @@ func sdrWatcher() {
|
||||||
prevOGNEnabled = ognEnabled
|
prevOGNEnabled = ognEnabled
|
||||||
prevAISEnabled = aisEnabled
|
prevAISEnabled = aisEnabled
|
||||||
prevOGNTXEnabled = ognTXEnabled
|
prevOGNTXEnabled = ognTXEnabled
|
||||||
|
prevdump1090Gain = dump1090Gain
|
||||||
|
|
||||||
countEnabled := 0
|
countEnabled := 0
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<div ui-content-for="title">Developer</div>
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="panel-group col-sm-6">
|
<div class="panel-group col-sm-6">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
|
|
@ -45,6 +45,11 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
||||||
};
|
};
|
||||||
|
|
||||||
socket.onmessage = function (msg) {
|
socket.onmessage = function (msg) {
|
||||||
|
if ($scope === undefined || $scope === null) {
|
||||||
|
socket.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
loadSituation(msg.data);
|
loadSituation(msg.data);
|
||||||
$scope.$apply(); // trigger any needed refreshing of data
|
$scope.$apply(); // trigger any needed refreshing of data
|
||||||
};
|
};
|
||||||
|
@ -61,7 +66,11 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
||||||
|
|
||||||
function sizeMap() {
|
function sizeMap() {
|
||||||
var width = 0;
|
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))
|
width = el.offsetWidth; // was (- (2 * el.offsetLeft))
|
||||||
if (width !== display_area_size) {
|
if (width !== display_area_size) {
|
||||||
display_area_size = width;
|
display_area_size = width;
|
||||||
|
|
|
@ -309,6 +309,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
|
||||||
$scope.PersistentLogging = settings.PersistentLogging;
|
$scope.PersistentLogging = settings.PersistentLogging;
|
||||||
|
|
||||||
$scope.PPM = settings.PPM;
|
$scope.PPM = settings.PPM;
|
||||||
|
$scope.Dump1090Gain = settings.Dump1090Gain;
|
||||||
$scope.AltitudeOffset = settings.AltitudeOffset;
|
$scope.AltitudeOffset = settings.AltitudeOffset;
|
||||||
$scope.WatchList = settings.WatchList;
|
$scope.WatchList = settings.WatchList;
|
||||||
$scope.OwnshipModeS = settings.OwnshipModeS;
|
$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() {
|
$scope.updatePWMDutyMin = function() {
|
||||||
settings['PWMDutyMin'] = 0;
|
settings['PWMDutyMin'] = 0;
|
||||||
if ($scope.PWMDutyMin !== undefined && $scope.PWMDutyMin !== null) {
|
if ($scope.PWMDutyMin !== undefined && $scope.PWMDutyMin !== null) {
|
||||||
|
@ -430,7 +443,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
|
||||||
|
|
||||||
$scope.updateBaud = function () {
|
$scope.updateBaud = function () {
|
||||||
settings["Baud"] = 0;
|
settings["Baud"] = 0;
|
||||||
if (($scope.Baud !== undefined) && ($scope.Baud !== null)) {
|
if ($scope.Baud !== undefined && $scope.Baud !== null) {
|
||||||
settings["Baud"] = parseInt($scope.Baud);
|
settings["Baud"] = parseInt($scope.Baud);
|
||||||
var newsettings = {
|
var newsettings = {
|
||||||
"Baud": settings["Baud"]
|
"Baud": settings["Baud"]
|
||||||
|
|
|
@ -210,6 +210,10 @@ function StatusCtrl($rootScope, $scope, $state, $http, $interval, craftService)
|
||||||
};
|
};
|
||||||
|
|
||||||
function getTowers() {
|
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)
|
// Simple GET request example (note: responce is asynchronous)
|
||||||
$http.get(URL_TOWERS_GET).
|
$http.get(URL_TOWERS_GET).
|
||||||
then(function (response) {
|
then(function (response) {
|
||||||
|
|
|
@ -258,6 +258,7 @@ function TrafficCtrl($rootScope, $scope, $state, $http, $interval, craftService)
|
||||||
}
|
}
|
||||||
// stop stale traffic cleanup
|
// stop stale traffic cleanup
|
||||||
$interval.cancel(clearStaleTraffic);
|
$interval.cancel(clearStaleTraffic);
|
||||||
|
$interval.cancel(getClock);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Traffic Controller tasks
|
// Traffic Controller tasks
|
||||||
|
|
|
@ -234,6 +234,42 @@
|
||||||
ng-blur="updateppm()" />
|
ng-blur="updateppm()" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</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)}">
|
<div class="form-group reset-flow" ng-class="{ 'section_invisible': (!visible_serialout)}">
|
||||||
<label class="control-label col-xs-5">Serial Output Baudrate</label>
|
<label class="control-label col-xs-5">Serial Output Baudrate</label>
|
||||||
<form name="ppmForm" ng-submit="updateBaud()" novalidate>
|
<form name="ppmForm" ng-submit="updateBaud()" novalidate>
|
||||||
|
|
Ładowanie…
Reference in New Issue