Skip to content

Commit

Permalink
Refactor (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopohl authored Oct 28, 2020
1 parent cfae883 commit 611ef15
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 17 deletions.
1 change: 0 additions & 1 deletion data/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
architecture: 'x64'

- script: |
python -m pip install --upgrade pip twine
pip install -r data/requirements.txt
sudo apt-get install libhackrf-dev librtlsdr-dev xvfb libxkbcommon-x11-0 x11-utils libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0
pip install PyVirtualDisplay==0.2.5
Expand Down
108 changes: 108 additions & 0 deletions data/ui/costa.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogCosta</class>
<widget class="QDialog" name="DialogCosta">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Configure Costas Loop</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>URH uses a Costas loop for PSK demodulation. Configure the loop bandwidth below.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="labelLoopBandwidth">
<property name="text">
<string>Loop Bandwidth:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBoxLoopBandwidth">
<property name="decimals">
<number>4</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogCosta</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogCosta</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
19 changes: 3 additions & 16 deletions tests/QtTestCase.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import faulthandler
import gc
import os
import time
import unittest

import sip
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QDropEvent
from PyQt5.QtTest import QTest
from PyQt5.QtWidgets import QApplication

from tests.utils_testing import write_settings, get_path_for_data_file
from urh.controller.MainController import MainController
from urh.dev.BackendHandler import BackendHandler
from urh.signalprocessing.ProtocolSniffer import ProtocolSniffer

faulthandler.enable()
Expand All @@ -36,7 +33,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
cls.app.quit()
cls.app = None
del cls.app

def setUp(self):
ProtocolSniffer.BUFFER_SIZE_MB = 0.5
Expand All @@ -48,22 +45,12 @@ def setUp(self):
def tearDown(self):
if hasattr(self, "dialog"):
self.dialog.close()

try:
sip.delete(self.dialog)
except TypeError:
pass
self.dialog = None
del self.dialog

if hasattr(self, "form"):
self.form.close_all_files()
self.form.close()

try:
sip.delete(self.form)
except TypeError:
pass
self.form = None
del self.form

gc.collect()

Expand Down

0 comments on commit 611ef15

Please sign in to comment.