kopia lustrzana https://github.com/cyoung/stratux
Antenna_Gain_rev1
rodzic
c11e5488b7
commit
de812ff36f
|
@ -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
|
||||
Gain float64
|
||||
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.Gain = 37.2
|
||||
globalSettings.APRS_Enabled = true
|
||||
globalSettings.GPS_Enabled = true
|
||||
globalSettings.IMU_Sensor_Enabled = true
|
||||
|
|
|
@ -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 "Gain":
|
||||
globalSettings.Gain = (val.(float64))
|
||||
case "PPM":
|
||||
globalSettings.PPM = int(val.(float64))
|
||||
case "AltitudeOffset":
|
||||
|
|
13
main/sdr.go
13
main/sdr.go
|
@ -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.Gain
|
||||
log.Printf("===== ES Device Serial: %s PPM %d Gain %.1f =====\n", e.serial, e.ppm,e.gain)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -309,6 +309,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
|
|||
$scope.PersistentLogging = settings.PersistentLogging;
|
||||
|
||||
$scope.PPM = settings.PPM;
|
||||
$scope.Gain = settings.Gain;
|
||||
$scope.AltitudeOffset = settings.AltitudeOffset;
|
||||
$scope.WatchList = settings.WatchList;
|
||||
$scope.OwnshipModeS = settings.OwnshipModeS;
|
||||
|
|
|
@ -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 ES Gain</label>
|
||||
<form name="gainForm" ng-submit="updategain()" novalidate>
|
||||
<select class="custom-select" ng-model="Gain" ng-blur="updategain()">
|
||||
<option value="0.9" ng-selected="Gain==0.9">0.9</option>
|
||||
<option value="1.4" ng-selected="Gain==1.4">1.4</option>
|
||||
<option value="2.7" ng-selected="Gain==2.7">2.7</option>
|
||||
<option value="3.7" ng-selected="Gain==3.7">3.7</option>
|
||||
<option value="7.7" ng-selected="Gain==7.7">7.7</option>
|
||||
<option value="8.7" ng-selected="Gain==8.7">8.7</option>
|
||||
<option value="12.5" ng-selected="Gain==12.5">12.5</option>
|
||||
<option value="14.4" ng-selected="Gain==14.4">14.4</option>
|
||||
<option value="15.7" ng-selected="Gain==15.7">15.7</option>
|
||||
<option value="16.6" ng-selected="Gain==16.6">16.6</option>
|
||||
<option value="19.7" ng-selected="Gain==19.7">19.7</option>
|
||||
<option value="20.7" ng-selected="Gain==20.7">20.7</option>
|
||||
<option value="22.9" ng-selected="Gain==22.9">22.9</option>
|
||||
<option value="25.4" ng-selected="Gain==25.4">25.4</option>
|
||||
<option value="28.0" ng-selected="Gain==28.0">28.0</option>
|
||||
<option value="29.7" ng-selected="Gain==29.7">29.7</option>
|
||||
<option value="32.8" ng-selected="Gain==32.8">32.8</option>
|
||||
<option value="33.8" ng-selected="Gain==33.8">33.8</option>
|
||||
<option value="36.4" ng-selected="Gain==36.4">36.4</option>
|
||||
<option value="37.2" ng-selected="Gain==37.2">37.2 DEFAULT</option>
|
||||
<option value="38.6" ng-selected="Gain==38.6">38.6</option>
|
||||
<option value="40.2" ng-selected="Gain==40.2">40.2</option>
|
||||
<option value="42.1" ng-selected="Gain==42.1">42.1</option>
|
||||
<option value="43.4" ng-selected="Gain==43.4">43.4</option>
|
||||
<option value="43.9" ng-selected="Gain==43.9">43.9</option>
|
||||
<option value="44.5" ng-selected="Gain==44.5">44.5</option>
|
||||
<option value="48.0" ng-selected="Gain==48.0">48.0</option>
|
||||
<option value="49.6" ng-selected="Gain==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>
|
||||
|
|
Ładowanie…
Reference in New Issue