From d3a307850467c6e54470c72660947647da94dbd8 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 31 May 2020 20:43:12 +0200 Subject: [PATCH] soapy gain input box for airspyhf --- htdocs/lib/settings/SdrDevice.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/htdocs/lib/settings/SdrDevice.js b/htdocs/lib/settings/SdrDevice.js index f8acada..79c970b 100644 --- a/htdocs/lib/settings/SdrDevice.js +++ b/htdocs/lib/settings/SdrDevice.js @@ -210,9 +210,31 @@ SdrplaySdrDevice.prototype.getMappings = function() { }); }; +AirspyHfSdrDevice = function() { + SoapySdrDevice.apply(this, arguments); +}; + +AirspyHfSdrDevice.prototype = Object.create(SoapySdrDevice.prototype); +AirspyHfSdrDevice.prototype.constructor = AirspyHfSdrDevice; + +AirspyHfSdrDevice.prototype.getMappings = function() { + var mappings = SoapySdrDevice.prototype.getMappings.apply(this, arguments); + return $.extend(new Object(), mappings, { + "rf_gain": { + constructor: SoapyGainInput, + initialValue: 0, + inputOptions: { + label: "Gain", + gains: ['RF', 'VGA'] + } + } + }); +}; + SdrDevice.types = { 'rtl_sdr': RtlSdrDevice, - 'sdrplay': SdrplaySdrDevice + 'sdrplay': SdrplaySdrDevice, + 'airspyhf': AirspyHfSdrDevice }; $.fn.sdrdevice = function() {