add information where to find network sdr send button when network sdr is selected in default sending dialog

This commit is contained in:
Johannes Pohl
2017-01-28 13:59:09 +01:00
parent 32c8c62ad9
commit adcbfa59f3
4 changed files with 29 additions and 6 deletions

View File

@@ -495,6 +495,10 @@ class GeneratorTabController(QWidget):
Errors.no_device()
dialog.close()
return
elif PluginManager().is_plugin_enabled("NetworkSDRInterface") and dialog.ui.cbDevice.count() == 1:
Errors.network_sdr_send_is_elsewhere()
dialog.close()
return
dialog.recording_parameters.connect(self.project_manager.set_recording_parameters)
dialog.show()

View File

@@ -8,6 +8,8 @@ from PyQt5.QtCore import Qt, pyqtSlot, QTimer, QRegExp, pyqtSignal
from PyQt5.QtGui import QRegExpValidator, QIcon
from PyQt5.QtWidgets import QDialog, QMessageBox, QApplication
from urh.plugins.NetworkSDRInterface.NetworkSDRInterfacePlugin import NetworkSDRInterfacePlugin
from urh.plugins.PluginManager import PluginManager
from urh.util.Formatter import Formatter
from urh.util.Logger import logger
@@ -95,6 +97,9 @@ class SendRecvDialogController(QDialog):
elif mode in (Mode.receive, Mode.spectrum) and dev.is_enabled and dev.supports_rx:
items.append(device_name)
if mode == Mode.send and PluginManager().is_plugin_enabled("NetworkSDRInterface"):
items.append(NetworkSDRInterfacePlugin.NETWORK_SDR_NAME)
self.ui.cbDevice.addItems(items)
if device in items:
self.ui.cbDevice.setCurrentIndex(items.index(device))
@@ -198,6 +203,14 @@ class SendRecvDialogController(QDialog):
@pyqtSlot()
def on_selected_device_changed(self):
dev_name = self.ui.cbDevice.currentText()
if dev_name == NetworkSDRInterfacePlugin.NETWORK_SDR_NAME:
self.ui.cbDevice.blockSignals(True)
self.ui.cbDevice.setCurrentText(self.device.name)
self.ui.cbDevice.blockSignals(False)
Errors.network_sdr_send_is_elsewhere()
return
nrep = self.ui.spinBoxNRepeat.value()
sts = self.device.samples_to_send
self.device.free_data()
@@ -399,6 +412,10 @@ class SendRecvDialogController(QDialog):
def closeEvent(self, QCloseEvent):
if self.device.backend == Backends.network:
QCloseEvent.accept()
return
self.device.stop("Dialog closed. Killing recording process.")
if self.mode == Mode.receive and not self.already_saved and self.device.current_index > 0:
reply = QMessageBox.question(self, self.tr("Save data?"),

View File

@@ -1,8 +1,4 @@
With this plugin you can interface external applications using TCP.
You can use your external application for performing protocol simulation on logical level or advanced modulation/decoding.
If you activate this plugin, a new SDR will be selectable:
1. in protocol sniffer dialog
2. in sending dialog.
Furthermore, a new button below generator table will be created.
If you activate this plugin, a new SDR will be selectable in protocol sniffer dialog.
Furthermore, a new button below generator table will be created.

View File

@@ -73,3 +73,9 @@ class Errors:
w = QWidget()
QMessageBox.critical(w, w.tr("Invalid Path"),
w.tr("The path {0} is invalid.".format(path)))
@staticmethod
def network_sdr_send_is_elsewhere():
w = QWidget()
QMessageBox.information(w, "This feature is elsewhere", "You can send your data with the network SDR by "
"using the button below the generator table.")