Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not disable clear button #514

Merged
merged 3 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
- auto assign destination when dropping messages to simulator
- show participant address in participant legend if present
- auto assign participant address when clicking analyze button in analysis based on SRC address label
- consider API changes of SDRPlay 2.13 [#508](https://github.com/jopohl/urh/pull/508) thanks [@mehdideveloper](https://github.com/mehdideveloper)
- also consider participant address (next to RSSI) when auto assigning participants in analysis [#512](https://github.com/jopohl/urh/pull/512)
- Clear button stays enabled during operation so e.g. recordings can be cleared live [#514](https://github.com/jopohl/urh/pull/514)

### Bugfixes
- antenna selection is not saved when reopening dialog [#494](https://github.com/jopohl/urh/pull/494)
Expand Down
1 change: 0 additions & 1 deletion src/urh/controller/dialogs/ProtocolSniffDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def on_stop_clicked(self):

@pyqtSlot()
def on_clear_clicked(self):
self.ui.btnClear.setEnabled(False)
self.ui.txtEd_sniff_Preview.clear()
self.scene_manager.clear_path()
self.device.current_index = 0
Expand Down
5 changes: 0 additions & 5 deletions src/urh/controller/dialogs/SendRecvDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(self, project_manager: ProjectManager, is_tx: bool, continuous_send
self.backend_handler = BackendHandler()

self.ui.btnStop.setEnabled(False)
self.ui.btnClear.setEnabled(False)
self.ui.btnSave.setEnabled(False)

self.start = 0
Expand Down Expand Up @@ -126,7 +125,6 @@ def reset(self):
self.ui.lblCurrentRepeatValue.setText("-")
self.ui.progressBarSample.setValue(0)
self.ui.progressBarMessage.setValue(0)
self.ui.btnClear.setEnabled(False)
self.ui.btnSave.setEnabled(False)

def init_device(self):
Expand Down Expand Up @@ -163,7 +161,6 @@ def on_device_stopped(self):
self.set_device_ui_items_enabled(True)
self.ui.btnStart.setEnabled(True)
self.ui.btnStop.setEnabled(False)
self.ui.btnClear.setEnabled(True)
self.ui.btnSave.setEnabled(self.device.current_index > 0)
self.device_settings_widget.ui.comboBoxDeviceIdentifier.setEnabled(True)
self.device_settings_widget.ui.btnRefreshDeviceIdentifier.setEnabled(True)
Expand All @@ -179,8 +176,6 @@ def on_device_started(self):
self.graphics_view.capturing_data = True
self.ui.btnSave.setEnabled(False)
self.ui.btnStart.setEnabled(False)

self.ui.btnClear.setEnabled(False)
self.ui.btnStop.setEnabled(True)
self.device_settings_widget.ui.comboBoxDeviceIdentifier.setEnabled(False)
self.device_settings_widget.ui.btnRefreshDeviceIdentifier.setEnabled(False)
Expand Down
1 change: 0 additions & 1 deletion src/urh/controller/dialogs/SpectrumDialogController.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def on_start_clicked(self):
def on_device_started(self):
self.ui.graphicsViewSpectrogram.fitInView(self.ui.graphicsViewSpectrogram.scene().sceneRect())
super().on_device_started()
self.ui.btnClear.setEnabled(True)
self.device_settings_widget.ui.spinBoxPort.setEnabled(False)
self.device_settings_widget.ui.lineEditIP.setEnabled(False)
self.device_settings_widget.ui.cbDevice.setEnabled(False)
Expand Down
11 changes: 3 additions & 8 deletions tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,18 @@ def test_fft_convolution(self):
self.assertTrue(np.array_equal(result_np, expected_result))

result_fft = Filter.fft_convolve_1d(x, h)
self.assertTrue(np.array_equal(result_fft, expected_result))
self.assertEqual(len(expected_result), len(result_fft))
for i in range(len(expected_result)):
self.assertAlmostEqual(expected_result[i], result_fft[i], places=8, msg=str(i))

x = np.linspace(0, 1, num=10 ** 3).astype(np.complex64)
h = Filter.design_windowed_sinc_bandpass(0.1, 0.4, 0.01)
# fft convolve is faster if IR is round about 400 samples or windowed sinc has bandwidth of 0.01
#print(len(h))

t_np = time.time()
result_np = np.convolve(x, h, mode="same")
t_np = time.time() - t_np

t_fft = time.time()
result_fft = Filter.fft_convolve_1d(x, h)
t_fft = time.time() - t_fft

np.testing.assert_array_almost_equal(result_np, result_fft)
#print("fft convolve time", t_fft, "np convolve time", t_np)

def test_bandpass_filter(self):
# GUI tests for bandpass filter are in test_spectrogram.py
Expand Down