disable bandwidth adjusting for rtlsdr

This commit is contained in:
Johannes Pohl
2017-02-27 16:16:44 +01:00
parent 4bfee4e24b
commit be6516347d
4 changed files with 19 additions and 0 deletions

View File

@@ -32,6 +32,8 @@ class ReceiveDialogController(SendRecvDialogController):
self.scene_manager = None # type: LiveSceneManager
self.init_device()
self.ui.spinBoxBandwidth.setEnabled(self.device.bandwidth_is_adjustable)
self.ui.btnLockBWSR.setEnabled(self.device.bandwidth_is_adjustable)
self.graphics_view.setScene(self.scene_manager.scene)
self.graphics_view.scene_manager = self.scene_manager

View File

@@ -195,6 +195,10 @@ class SendRecvDialogController(QDialog):
self.ui.lineEditIP.setVisible(dev_name == "USRP")
self.ui.labelIP.setVisible(dev_name == "USRP")
if self.device is not None:
self.ui.spinBoxBandwidth.setEnabled(self.device.bandwidth_is_adjustable)
self.ui.btnLockBWSR.setEnabled(self.device.bandwidth_is_adjustable)
@pyqtSlot()
def on_start_clicked(self):
self.ui.spinBoxFreq.editingFinished.emit()

View File

@@ -33,6 +33,8 @@ class SpectrumDialogController(SendRecvDialogController):
self.ui.cbDevice.removeItem(index)
self.init_device()
self.ui.spinBoxBandwidth.setEnabled(self.device.bandwidth_is_adjustable)
self.ui.btnLockBWSR.setEnabled(self.device.bandwidth_is_adjustable)
self.create_connects()

View File

@@ -99,6 +99,17 @@ class VirtualDevice(QObject):
def bandwidth(self, value):
self.__dev.bandwidth = value
@property
def bandwidth_is_adjustable(self):
if self.backend == Backends.grc:
return True
elif self.backend == Backends.native:
return self.__dev.bandwidth_is_adjustable
elif self.backend == Backends.network:
return True
else:
raise ValueError("Unsupported Backend")
@property
def frequency(self):
if self.backend == Backends.grc: