Skip to content

Commit

Permalink
consider checksum label in copy operation (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopohl authored Sep 20, 2020
1 parent 162dda8 commit 1fcf4ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
18 changes: 1 addition & 17 deletions data/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,27 +246,11 @@ jobs:
displayName: 'Install dependencies'
- script: |
brew install portaudio hackrf librtlsdr airspy
brew install airspy hackrf librtlsdr portaudio uhd
python -m pip install --upgrade wheel twine six appdirs packaging setuptools pyinstaller pyaudio
python -c "import tempfile, os; open(os.path.join(tempfile.gettempdir(), 'urh_releasing'), 'w').close()"
displayName: "Install build dependencies"
- script: |
echo "Reinstall icu4c"
brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/a806a621ed3722fb580a58000fb274a2f2d86a6d/Formula/icu4c.rb
echo "Link icu4c"
brew link icu4c --force
echo "Install boost"
brew install --force --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/8d748e26ccc9afc8ea0d0201ae234fda35de721e/Formula/boost.rb
cd /tmp
wget https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.tar.bz2
tar xf libusb-1.0.22.tar.bz2
cd libusb-1.0.22
./configure
make
sudo make install
displayName: "Install libusb and boost"
- script: python src/urh/cythonext/build.py
displayName: "Build extensions"

Expand Down
9 changes: 8 additions & 1 deletion src/urh/signalprocessing/MessageType.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
import random
import uuid
import xml.etree.ElementTree as ET
Expand Down Expand Up @@ -154,9 +155,15 @@ def add_protocol_label_start_length(self, start: int, length: int, name=None, co

def add_label(self, lbl: ProtocolLabel, allow_overlapping=True):
if allow_overlapping or not any(lbl.overlaps_with(l) for l in self):
added = self.add_protocol_label(lbl.start, lbl.end - 1, name=lbl.name, color_ind=lbl.color_index)
added = self.add_protocol_label(lbl.start, lbl.end - 1,
name=lbl.name, color_ind=lbl.color_index,
type=lbl.field_type)
added.display_format_index = lbl.display_format_index
added.display_bit_order_index = lbl.display_bit_order_index
if isinstance(lbl, ChecksumLabel) and isinstance(added, ChecksumLabel):
added.data_ranges = copy.copy(lbl.data_ranges)
added.category = copy.copy(lbl.category)
added.checksum = copy.copy(lbl.checksum)

def remove(self, lbl: ProtocolLabel):
if lbl in self:
Expand Down

0 comments on commit 1fcf4ae

Please sign in to comment.