hackrf gain settings

This commit is contained in:
Jakob Ketterl 2020-05-31 20:52:45 +02:00
parent d3a3078504
commit adcac7b54a

View File

@ -185,10 +185,22 @@ SoapySdrDevice.prototype.getMappings = function() {
label: "Soapy device selector" label: "Soapy device selector"
}, },
initialValue: "" initialValue: ""
},
"rf_gain": {
constructor: SoapyGainInput,
initialValue: 0,
inputOptions: {
label: "Gain",
gains: this.getGains()
}
} }
}); });
}; };
SoapySdrDevice.prototype.getGains = function() {
return [];
};
SdrplaySdrDevice = function() { SdrplaySdrDevice = function() {
SoapySdrDevice.apply(this, arguments); SoapySdrDevice.apply(this, arguments);
}; };
@ -196,18 +208,8 @@ SdrplaySdrDevice = function() {
SdrplaySdrDevice.prototype = Object.create(SoapySdrDevice.prototype); SdrplaySdrDevice.prototype = Object.create(SoapySdrDevice.prototype);
SdrplaySdrDevice.prototype.constructor = SdrplaySdrDevice; SdrplaySdrDevice.prototype.constructor = SdrplaySdrDevice;
SdrplaySdrDevice.prototype.getMappings = function() { SdrplaySdrDevice.prototype.getGains = function() {
var mappings = SoapySdrDevice.prototype.getMappings.apply(this, arguments); return ['RFGR', 'IFGR'];
return $.extend(new Object(), mappings, {
"rf_gain": {
constructor: SoapyGainInput,
initialValue: 0,
inputOptions: {
label: "Gain",
gains: ['RFGR', 'IFGR']
}
}
});
}; };
AirspyHfSdrDevice = function() { AirspyHfSdrDevice = function() {
@ -217,24 +219,26 @@ AirspyHfSdrDevice = function() {
AirspyHfSdrDevice.prototype = Object.create(SoapySdrDevice.prototype); AirspyHfSdrDevice.prototype = Object.create(SoapySdrDevice.prototype);
AirspyHfSdrDevice.prototype.constructor = AirspyHfSdrDevice; AirspyHfSdrDevice.prototype.constructor = AirspyHfSdrDevice;
AirspyHfSdrDevice.prototype.getMappings = function() { AirspyHfSdrDevice.prototype.getGains = function() {
var mappings = SoapySdrDevice.prototype.getMappings.apply(this, arguments); return ['RF', 'VGA'];
return $.extend(new Object(), mappings, { };
"rf_gain": {
constructor: SoapyGainInput, HackRfSdrDevice = function() {
initialValue: 0, SoapySdrDevice.apply(this, arguments);
inputOptions: { };
label: "Gain",
gains: ['RF', 'VGA'] HackRfSdrDevice.prototype = Object.create(SoapySdrDevice.prototype);
} HackRfSdrDevice.prototype.constructor = HackRfSdrDevice;
}
}); HackRfSdrDevice.prototype.getGains = function() {
return ['LNA', 'VGA', 'AMP'];
}; };
SdrDevice.types = { SdrDevice.types = {
'rtl_sdr': RtlSdrDevice, 'rtl_sdr': RtlSdrDevice,
'sdrplay': SdrplaySdrDevice, 'sdrplay': SdrplaySdrDevice,
'airspyhf': AirspyHfSdrDevice 'airspyhf': AirspyHfSdrDevice,
'hackrf': HackRfSdrDevice
}; };
$.fn.sdrdevice = function() { $.fn.sdrdevice = function() {