diff --git a/generate_ui.py b/generate_ui.py index 6ee0580b..8544aa0c 100644 --- a/generate_ui.py +++ b/generate_ui.py @@ -34,7 +34,7 @@ def gen(): # Remove Line: # Form implementation generated from reading ui file '/home/joe/GIT/urh/ui/fuzzing.ui' # to avoid useless git updates when working on another computer for line in fileinput.input(out_file_path, inplace=True): - if line.startswith("# Form implementation generated from reading ui file"): + if line.startswith("# Form implementation generated from reading ui file") or line.startswith("# Created by: "): continue print(line, end='') diff --git a/src/urh/ui/ui_analysis_frame.py b/src/urh/ui/ui_analysis_frame.py index 9fd35e52..f780ce47 100644 --- a/src/urh/ui/ui_analysis_frame.py +++ b/src/urh/ui/ui_analysis_frame.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! @@ -372,6 +371,7 @@ class Ui_FAnalysis(object): self.pageButtonAnalyzer = QtWidgets.QWidget() self.pageButtonAnalyzer.setObjectName("pageButtonAnalyzer") self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.pageButtonAnalyzer) + self.verticalLayout_5.setContentsMargins(0, 0, 0, 0) self.verticalLayout_5.setObjectName("verticalLayout_5") self.btnAnalyze = QtWidgets.QToolButton(self.pageButtonAnalyzer) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) @@ -387,6 +387,7 @@ class Ui_FAnalysis(object): self.pageProgressBar = QtWidgets.QWidget() self.pageProgressBar.setObjectName("pageProgressBar") self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.pageProgressBar) + self.verticalLayout_6.setContentsMargins(0, 0, 0, 0) self.verticalLayout_6.setObjectName("verticalLayout_6") self.progressBarLogicAnalyzer = QtWidgets.QProgressBar(self.pageProgressBar) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) diff --git a/src/urh/ui/ui_decoding.py b/src/urh/ui/ui_decoding.py index 4f686a04..5ef370b5 100644 --- a/src/urh/ui/ui_decoding.py +++ b/src/urh/ui/ui_decoding.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! @@ -169,6 +168,7 @@ class Ui_Decoder(object): self.page_substitution = QtWidgets.QWidget() self.page_substitution.setObjectName("page_substitution") self.gridLayout = QtWidgets.QGridLayout(self.page_substitution) + self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") self.substitution_rows = QtWidgets.QSpinBox(self.page_substitution) self.substitution_rows.setMinimum(1) diff --git a/src/urh/ui/ui_fuzzing.py b/src/urh/ui/ui_fuzzing.py index 965078af..c85a7375 100644 --- a/src/urh/ui/ui_fuzzing.py +++ b/src/urh/ui/ui_fuzzing.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_generator.py b/src/urh/ui/ui_generator.py index 1288fd11..abf1684a 100644 --- a/src/urh/ui/ui_generator.py +++ b/src/urh/ui/ui_generator.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! @@ -34,6 +33,7 @@ class Ui_GeneratorTab(object): self.tab_proto = QtWidgets.QWidget() self.tab_proto.setObjectName("tab_proto") self.horizontalLayout = QtWidgets.QHBoxLayout(self.tab_proto) + self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.treeProtocols = GeneratorTreeView(self.tab_proto) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) @@ -48,6 +48,7 @@ class Ui_GeneratorTab(object): self.tab_4 = QtWidgets.QWidget() self.tab_4.setObjectName("tab_4") self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_4) + self.gridLayout_4.setContentsMargins(0, 0, 0, 0) self.gridLayout_4.setObjectName("gridLayout_4") self.lWPauses = GeneratorListWidget(self.tab_4) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) @@ -64,6 +65,7 @@ class Ui_GeneratorTab(object): self.tab_5 = QtWidgets.QWidget() self.tab_5.setObjectName("tab_5") self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.tab_5) + self.verticalLayout_8.setContentsMargins(0, 0, 0, 0) self.verticalLayout_8.setSpacing(6) self.verticalLayout_8.setObjectName("verticalLayout_8") self.listViewProtoLabels = GeneratorListView(self.tab_5) diff --git a/src/urh/ui/ui_labelset_options.py b/src/urh/ui/ui_labelset_options.py index 4396b65e..f6b815fd 100644 --- a/src/urh/ui/ui_labelset_options.py +++ b/src/urh/ui/ui_labelset_options.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_main.py b/src/urh/ui/ui_main.py index 897d86d8..a58e503f 100644 --- a/src/urh/ui/ui_main.py +++ b/src/urh/ui/ui_main.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! @@ -27,6 +26,7 @@ class Ui_MainWindow(object): self.layoutWidget = QtWidgets.QWidget(self.splitter) self.layoutWidget.setObjectName("layoutWidget") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.layoutWidget) + self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.lnEdtTreeFilter = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) @@ -65,6 +65,7 @@ class Ui_MainWindow(object): self.tabParticipants = QtWidgets.QWidget() self.tabParticipants.setObjectName("tabParticipants") self.horizontalLayout = QtWidgets.QHBoxLayout(self.tabParticipants) + self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.listViewParticipants = QtWidgets.QListView(self.tabParticipants) self.listViewParticipants.setObjectName("listViewParticipants") @@ -73,6 +74,7 @@ class Ui_MainWindow(object): self.tabDescription = QtWidgets.QWidget() self.tabDescription.setObjectName("tabDescription") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tabDescription) + self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.textEditProjectDescription = QtWidgets.QTextEdit(self.tabDescription) self.textEditProjectDescription.setObjectName("textEditProjectDescription") @@ -90,16 +92,19 @@ class Ui_MainWindow(object): self.tab_interpretation = QtWidgets.QWidget() self.tab_interpretation.setObjectName("tab_interpretation") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab_interpretation) + self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.tabWidget.addTab(self.tab_interpretation, "") self.tab_protocol = QtWidgets.QWidget() self.tab_protocol.setObjectName("tab_protocol") self.verticalLayout = QtWidgets.QVBoxLayout(self.tab_protocol) + self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.tabWidget.addTab(self.tab_protocol, "") self.tab_generator = QtWidgets.QWidget() self.tab_generator.setObjectName("tab_generator") self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.tab_generator) + self.verticalLayout_5.setContentsMargins(0, 0, 0, 0) self.verticalLayout_5.setObjectName("verticalLayout_5") self.tabWidget.addTab(self.tab_generator, "") self.verticalLayout_4.addWidget(self.splitter) diff --git a/src/urh/ui/ui_modulation.py b/src/urh/ui/ui_modulation.py index 6eef8cf0..89e4973c 100644 --- a/src/urh/ui/ui_modulation.py +++ b/src/urh/ui/ui_modulation.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_options.py b/src/urh/ui/ui_options.py index 31dd959c..b70ad494 100644 --- a/src/urh/ui/ui_options.py +++ b/src/urh/ui/ui_options.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! @@ -18,6 +17,7 @@ class Ui_DialogOptions(object): self.tabInterpretation = QtWidgets.QWidget() self.tabInterpretation.setObjectName("tabInterpretation") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tabInterpretation) + self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.groupBox = QtWidgets.QGroupBox(self.tabInterpretation) self.groupBox.setObjectName("groupBox") @@ -77,6 +77,7 @@ class Ui_DialogOptions(object): self.tabView = QtWidgets.QWidget() self.tabView.setObjectName("tabView") self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tabView) + self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.verticalLayout_4.setObjectName("verticalLayout_4") self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") @@ -121,6 +122,7 @@ class Ui_DialogOptions(object): self.tabDevices = QtWidgets.QWidget() self.tabDevices.setObjectName("tabDevices") self.gridLayout_3 = QtWidgets.QGridLayout(self.tabDevices) + self.gridLayout_3.setContentsMargins(0, 0, 0, 0) self.gridLayout_3.setObjectName("gridLayout_3") self.listWidgetDevices = QtWidgets.QListWidget(self.tabDevices) self.listWidgetDevices.setObjectName("listWidgetDevices") diff --git a/src/urh/ui/ui_plugins.py b/src/urh/ui/ui_plugins.py index 2b7cb981..29f6f617 100644 --- a/src/urh/ui/ui_plugins.py +++ b/src/urh/ui/ui_plugins.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_project.py b/src/urh/ui/ui_project.py index 7fa34a8c..ff7c8896 100644 --- a/src/urh/ui/ui_project.py +++ b/src/urh/ui/ui_project.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_properties_dialog.py b/src/urh/ui/ui_properties_dialog.py index 4c42d5d5..c36e1c5e 100644 --- a/src/urh/ui/ui_properties_dialog.py +++ b/src/urh/ui/ui_properties_dialog.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_proto_sniff.py b/src/urh/ui/ui_proto_sniff.py index e7e38b25..b0d640ba 100644 --- a/src/urh/ui/ui_proto_sniff.py +++ b/src/urh/ui/ui_proto_sniff.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_send_recv.py b/src/urh/ui/ui_send_recv.py index b78fdd4e..14936794 100644 --- a/src/urh/ui/ui_send_recv.py +++ b/src/urh/ui/ui_send_recv.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_signal_details.py b/src/urh/ui/ui_signal_details.py index ed0d37fc..4766139d 100644 --- a/src/urh/ui/ui_signal_details.py +++ b/src/urh/ui/ui_signal_details.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/src/urh/ui/ui_signal_frame.py b/src/urh/ui/ui_signal_frame.py index c31aec8b..fe9764dd 100644 --- a/src/urh/ui/ui_signal_frame.py +++ b/src/urh/ui/ui_signal_frame.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! @@ -253,7 +252,7 @@ class Ui_SignalFrame(object): self.layoutWidget.setObjectName("layoutWidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget) self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint) - self.verticalLayout.setContentsMargins(-1, -1, -1, 0) + self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") diff --git a/src/urh/ui/ui_tab_interpretation.py b/src/urh/ui/ui_tab_interpretation.py index 988ef3e6..62e79863 100644 --- a/src/urh/ui/ui_tab_interpretation.py +++ b/src/urh/ui/ui_tab_interpretation.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! diff --git a/tests/test_encoding.py b/tests/test_encoding.py index 804468a8..e856c703 100644 --- a/tests/test_encoding.py +++ b/tests/test_encoding.py @@ -2,7 +2,7 @@ import unittest from urh.signalprocessing.encoding import encoding -class TestCarrier(unittest.TestCase): +class TestDecoding(unittest.TestCase): # Testmethode muss immer mit Präfix test_* starten def test_carrier(self): e = encoding() @@ -17,3 +17,34 @@ class TestCarrier(unittest.TestCase): newinpt, err = e.code_carrier(False, output) print("Encoded: ", newinpt, err) self.assertEqual(original_inpt, newinpt) + + def test_enocean(self): + e = encoding() + + + # received = "01010101011010011110101011101110111011101110011000101110101000101110111011011101110100" + # First step is invert the received bits!!! + received = "10101010 1001 011000010101 000100010001 000100011001 110100010101 110100010001 0010001000 1011" + preamble = "10101010" + sof = "1001" + eof = "1011" + + self.assertIn(preamble, received) + self.assertIn(sof, received) + self.assertIn(eof, received) + + print("Received data", received) + + # Preamble/SOF/EOF remain unchanged + expected_result = preamble + sof + "01100001 00000000 00000010 11000001 11000000 00100100" + eof + + # Needs to be fixed! + decoded = e.decode(e.str2bit(received.replace(" ",""))) + + self.assertEqual(decoded, e.str2bit(expected_result.replace(" ", ""))) + + + + + +