Commit Graph

28 Commits

Author SHA1 Message Date
Johannes Pohl
26e5bbb492 Add a CLI (#440)
* add argument parser for CLI

* add pause to cli

* parse messages to send

* add send function

* use while loop instead of hard sleep

* use logger for error msg

* use tabulator for progress bar

* prepare rx mode

* use Thread for Protocol Sniffer instead of qt signals

* adapt tests

* fix thread can only be started once error

* enable receiving from command line

* support send from file

* save gain correctly

* enable rx into file

* remove unused signal

* enable raw rx and file mode

* add support for device identifier

* add support for default pause

* enable abort sending witt ctrl c

* support encodings

* make logging multiprocessing aware and add autobuild extensions to cli

* move place

* fix sniffer when receiving multiple messages at once

* add test for modulator cli parsing and fix some bugs

* extend modulator test and fix another bug

* add unittests and reorder urh_cli structure

* add tests

* adapt CI to CLI tests

* force osx

* fix osx

* adapt close dialog method

* remove close dialog method

* test read messages to send

* centralize read messages method

* increase timeout for ci

* support loading of project files to load cli values

* add sleep for ci

* add cli to deployment

* replace static calls with ProjectManager Class

* use time sleep instead of qwait

* disable gc collect call

* disable gc collect for python 3.4 only

* gc collect only for osx

* simplify cleanup

* simplify cleanup

* advanced cleanup only for windows

* cleanup also for osx

* gc collect for osx

* add unittests

* consider frozen app path

* init multiprocessing first

* enable logging on cli for windows

* use log file handler for log

* add missing import
2018-06-01 09:59:53 +02:00
Johannes Pohl
98574c1129 Save num sending repeats (#415)
* save num sending repeats

* show device tab by default

* adapt unittest

* optimize teardown

* adapt travis conf

* update travis

* improve test

* add verbose flag

* remove options dialog test

* improve open recent test

* improve open recent test

* remove verbose flag

* set depth back
2018-03-21 15:19:10 +01:00
Johannes Pohl
8368b46f77 improve simulator unittests 2018-03-11 00:45:54 +01:00
Johannes Pohl
6c1ae0ec25 Integrate Simulator Tab (#395)
* enable simulator tab

* save simulated participant in project

* add link for checksum label and make it configurable

* handle checksum label change for simulator label

* fix crash when editing field types with active simulator labels

* allow assigning multiple source/destination at once

* remove unused event

* use default line color for arrows

* cleanup code

* refactor bootstrapping of device settings and sniff widget
add button for opening sniff dialog in simulator dialog

* reformat code

* enhance bootstrapping to keep initial project manager settings

* highlight simulated participants in flow graph

* more verbose logging

* reformat file

* fix initial gain settings

* reformat code

* also save antenna index

* unify sniffer settings

* add signal selection to sniff widget to take values from signal

* add default argument

* fix missing refresh when adding items to scene with participant assigned

* catch error when saving xml

* refactor SimulatorProtocolLabel

* Improve handling of checksum labels

* travis: generate coverage data for all python > 3.4

* replace print calls with logger calls

* refactor goto action

* refactor simulator message

* refactor simulator rule

* rename to SimulatorExternalProgramAction

* add tooltip for value type

* improve performance of protocol sniffer

* improve performance of protocol sniffer even further

* directly emit signal and do not use timer

* add unittest for protocol sniffer

* add test for clear action

* add test for settings proxy

* add test for accepting sniffed messages

* make test more generic

* repair test

* catch none error

* fix typo

* refactor dialog creation

* add test for simulation flow

* refactor read_receiving_queue

* fix unittest

* increase timeout for ci

* improve sniffer performance especially when reaching end of buffer

* catch error

* add timeout for windows

* improve condition

* move run command and parse command to util and refactor methods

* add validate command method and refactor run_command

* fix imports

* improve validate check

* proper renaming

* rename log messages accordingly

* cleanup method

* add external program support for simulator

* fix if condition

* travis ci: use sudo for all builds

* revert

* add wait for ci

* improve test

* fix shebang

* refactor run command

* fix enabled repeat status and add wait for sync send

* pad send buffer with zeros if not enough data present

* catch exceptions when closing errors

* Revert "pad send buffer with zeros if not enough data present"

This reverts commit b5ea80ae27.

* remove timeout and return zeros properly in callback

* prevent calling gnuradio installed check too often

* rename repeat -> copies

* mark get live vs static labels

* Get live from simulation -> Live Input

* use shlex for calling programs

* fix valid check

* catch empty list error

* check if commmand is available before running

* windows support

* catch value error

* improve windows support

* adapt unittests

* Revert "adapt unittests"

This reverts commit 97d8a2c45a.

* get and store default programs on windows

* improve condition and pipe stderr

* also pipe stderr

* add validity check when assigning multiple message sources/destinations

* remove Create new message type based on this message

* Rename External Program Action -> Trigger Command

* fix unittest

* increase timeout for ci

* get external command action to work

* add timeout for sync send devices

* fix windows test

* fix call

* improve logging view

* make use of filter

* append participants instead of overwriting to prevent key errors

* add sip version str

* travis: test revent pyqt5

* Revert "travis: test revent pyqt5"

This reverts commit df1b403a51.

* proper naming + add context menu action for set value type

* support batch assigning of value type index

* fix method name

* adapt unittest to new logic

* add copy and paste for simulator scene

* show transcript

* support bit and hex view for transcript

* Fix display error in simulator

* improve logging

* catch index error

* improve condition

* show signals in modulation dialog created from simulator dialog

* fix filtering for KDE users

* add comment

* improve performance of filtering rows

* remove redundant update

* fix empty frame visible status to handle larger protocol files

* fix sending finished status

* fix unittest

* enhance modulation API do not cache result to avoid memory leak

* increase wait for devices timeout

* Fix memory leak for send dialog

* fix data loss for tree views

* Fix sample rates for AirSpy
- R2: 10M only
- Mini: 6M only

* set delete on close attribute

* Fix sample rates for AirSpy
- R2: 10M only
- Mini: 6M only

* Fix sample rates for AirSpy
- R2: 10M only
- Mini: 6M only

* Fix sample rates for AirSpy
- R2: 10M only
- Mini: 6M only

* allow capture full rx in simulator and make it possible to save rx data

* do not add gr device for continuous send mode

* fix property

* Some UI improvements

* improve performance of fsk modulation

* Fixed handle width

* improve performance of ask modulation

* improve performance of psk modulation

* fix unittest

* improve gfsk performance

* remove old modulation implementation

* increase timeout for ci

* use sudo by default for travis

* use fsk for test

* remove prange as it can lead to errors in continous modulation

* short async wait

* use spawn on all platforms

* increase timeout for ci

* decrease modulator buffer size

* make fsk parallel

* improve data types

* centralize setting of CONTINUOUS_BUFFER_SIZE_MB

* add log message

* add reset link for filtering

* new simulator default timeout

* catch index error

* catch error

* use shared memory for send buffer

* remove auto assign decodings

* remove dup variable

* rename sendbuffersize to rx chunk size and remove var dup

* READ_SAMPLES->SYNC_RX_CHUNK_SIZE

* fix data type in send config and remove pause in simulation

* improve hackrf send callback

* Tab prio changed

* improve sending backend

* fix lime send

* fix usrp send

* improve continous send mode for usrp

* improve code

* pad limesdr with zeros if needed

* fix log error

* enter continuous send dialog earlier

* add missing set_bandwidth_status call for RTLSDR

* save gains and antenna index per rx/tx

* show modulation profiles only when requested in options

* decrease complexity

* add edit labels action to context menu in simulator message table

* improve performance of auto detect freq

* add sleep action

* fix unittests + remove redundant test

* add counter action

* add parent to timers + increase coverage for cfc

* improve test

* use sip to delete dialogs

* improve tests

* set dialog to none

* add log message

* remove unneeded base class

* remove redundant test

* do not inherit qttestcase without reason

* stop sniffer in test

* reformat test files

* add a short wait after teardown

* give each app a unique name

* fix travis conf

* name concurrency setting in coveragerc

* remove xml setting

* improve condition

* add combine

* coverage only for python 3.6

* install pytest cov and coveralls only for python 3.6

* remove concurrency setting

* update coveragerc

* add tests for decoding dialog

* Added external programm for decoding/encoding Homematic that does a dirty trick:
After "decryption" the CRC is recalculated and the corresponding field will be overwritten if the CRC was correct before. In this way you can directly see whether the Homematic message is correct without switching to a intermediate layer (before decryption).

* fix selection error in Decoding dialog and move test to TestExternalDecodings.py

* beautify simulation scene

* show shown rows labels always and not only for filter

* prevent auto default

* clear transcript only on start and add crc log

* Minor stuff:
* Timeout Sim in ms
* CRC Label check fixed
* transcript format improved

* improve loading of txt support transcript and hex

* fix close all disbled status

* prepare open in analysis

* implement logic for open in analysis button

* refactor transcript newline

* enhance order of close event

* improve logging output

* increase align depth

* only color got string in log

* update userguide
2018-02-28 10:15:08 +01:00
Johannes Pohl
fd933edfc7 integrate changes from simulator branch but disable simulator for now
The simulator is not yet ready for usage but the changes on the
architecture are valueable for the master branch.
Therefore, I merged the branch with the following addition:
 * Close the Simulator Tab whenever the program starts
2018-01-30 11:58:30 +01:00
Johannes Pohl
585173dbfe improve test cleanup 2017-12-04 18:16:25 +01:00
Johannes Pohl
86e20a3919 improve test cleanup 2017-12-03 12:05:37 +01:00
Johannes Pohl
f75e5787bf add spectrogram view and channel separation
* show getting start hint in interpretation

* add test for creating spectrogram

* add spectrogram page to signal frame
remove parent frame property from epic graphic view

* prototype for spectrogram drawing (has performance issues)

* enable yscale for spectrogram

* regen file

* enhance spectrogram performance by using QImage

* enable y scale for spectrogram

* add initial legend to spectrogram

* fix colormap location

* remove colormap legend

* add more colormaps

* make colormap configurable via ini

* make colormap configurable in settings

* make fft window size configurable

* rescale Y on signal frame resize

* adapt unittest to new api

* allow y move with drag for spectrogram view

* refactor painting backend

* enable vertical selection in spectrogram graphic view

* spectrum: fix order of y values

* use fliplr for compat

* add bandpass filter function

* add narrowband iir filter

* set lower bandwidth for test

* add windowed sinc to filter class and adapt unittest

* change default of hold shift to drag
This way making a selection does not require a key modifier by default

* add fft convolution

* add performance test for fft convolution

* speed up performance test

* fix error for small data sets

* add test for filtering channels

* use astype for compatibility with old numpy versions

* refactor context menu of graphic views

* remove fft convolve performance test to avoid random fails on CI

* fix spectrogram calculation

* fix spectrogram calculation

* improve stft performance

* show samples in view for spectrogram and allow deeper zoom

* enable zoom to selection for spectrogram

* enable start end and selection infos for spectrogram selection

* enable bandpass filtering from spectrogram

* fix selection start end behavior for spectrogram

* update spectrogram infos in start end edited

* add unittest for channel separation

* enhance architecture of spectrogram management

* add class SpectrogramSceneManager
* cache spectrogram
* fix x axis orientation
* move scene managers to painting

* redraw on fft size update

* add lod slider for spectrogram

* remove unused stuff

* add tooltip for lod slider

* update selected bandwidth on sample rate changed

* add update for gv signal on resize

* fix fftshift parameter

* remove xflip as this is corrected by fftshift now

* remove lod slider as it leads to confusion and low lods are hard to see

* clip f_low and f_high

* update spectrogram images on colormap change

* set loading cursor right before bandpass filtering signal

* add select all action with ctrl+a to graphic views

* use parameters from original signal for newly created signals

* fix noise level in unittest

* improve spectrogram performance by splitting image into segments

* avoid division by zero

* fix unittest

* improve signal redraw on resize

* add created signal right under original signal

* adapt unittest to filtered frame created under original signal

* add dialog for configure bandwidth and display default values

* make bandwidth configurable

* fix spectrogram scene rect for small signals

* make data min and data max for spectrogram configurable

* use object names for indexing settings as texts are not reliable

Some OSes insert & before texts probably for shortcuts

* use heuristic to choose normal or FFT convolution

* suggest a filename for unsaved signals based on their name

* fix subpath range calculation

* use window for subpath drawing to avoid flickering colors
2017-08-24 16:28:28 +02:00
Johannes Pohl
fa12774090 add checksum integration
* add draft for crc configure dialog

* add ui file

* improve delegate sizing

* fix open editors function call placement

* consider system font size for optimal editor height

* fix font height on windows only as other OSes are fine with default

* simplify windows height special case

* add draft for crc configure dialog

* add ui file

* add tab widget to properties dialog + remove unneeded underline fonts

* rename type -> field type + add crclabel class

* cast labels to crclabel if field type gets changed

* dynamic tab creation in label dialog depending on special status labels

* integrate CRC widget to dialog

* use model for crc data ranges and enhance editor behaviour

* move default crc polynomials to class level

* make crc polynomial configurable in widget

* fix line edit validator + set crc polynomial on combobox change

* show crc status in label table

* fix unnittest polynomial assignment

* Index error catched, when dragging WSP-encoded data into generator

* show expected CRC in value table

* add action for updating automatically assigned message types

* add draft for crc configure dialog

* add ui file

* add tab widget to properties dialog + remove unneeded underline fonts

* rename type -> field type + add crclabel class

* cast labels to crclabel if field type gets changed

* dynamic tab creation in label dialog depending on special status labels

* integrate CRC widget to dialog

* use model for crc data ranges and enhance editor behaviour

* move default crc polynomials to class level

* make crc polynomial configurable in widget

* fix line edit validator + set crc polynomial on combobox change

* show crc status in label table

* fix unnittest polynomial assignment

* show expected CRC in value table

* add action for updating automatically assigned message types

* centralize bit view methods

* make start value and final xor configurable

* add Checksum Label Type + WSP Checksum subtype

* Ensure Start Value and Final XOR have same length as polynomial

* pad zeros at front

* add crc info label and fix sync between polynomial and xor values

* various fixes

* test wsp hash functionality

* minor fixes

* use array.array for parameters to make crcs comparable

* integrate crc to generation

* add unittest for cc1101

* set wait cursor when extracting archives

* remove unneeded status bar in interpretation

* set wait cursor when extracting archives in project manager

* fix size policy for analysis search line edit

* save checksum labels in project

* improve alignment

* remove double line edit

* add test for checksum integration in generator

* update coverage

* specify coverage format

* generate xml coverage report

* generate coverage report only for python 3.5

* generate coverage report only for python 3.5

* add variable to control coverage

* generate coverage report on success

* generate coverage report after success

* remove deprecated

* add virtualenv opt

* use codecov

* revert to deprecated

* Removed CRC and 'remove_preamble, remove_sync' from CC1101 Data Whitening

* repair unittests

* fix table copy selection

* use plain bits for checksum calculation in generation

* add parent
2017-07-02 20:47:46 +02:00
Johannes Pohl
e11da13681 add unittests 2017-06-07 09:17:31 +02:00
Johannes Pohl
8071316423 show gui in tests only if file is present 2017-03-29 18:55:31 +02:00
Johannes Pohl
a9557c4eda make show configurable via file 2017-03-29 16:20:51 +02:00
Johannes Pohl
5f2d83e281 revert remove timeouts 2017-03-28 23:13:31 +02:00
Johannes Pohl
91d37a0a47 remove timeouts 2017-03-28 23:00:34 +02:00
Johannes Pohl
f9babedb50 close form in teardown if shown 2017-03-28 18:14:02 +02:00
Johannes Pohl
9568c54f7b add flag for showing GUI during tests 2017-03-28 17:36:41 +02:00
Johannes Pohl
5d8de032c8 centralize wait before new timeout variable 2017-03-28 16:41:35 +02:00
Johannes Pohl
7d893e0bbd add timeout before adding signalfile to prevent graphic view segfaults 2017-03-27 19:27:32 +02:00
Johannes Pohl
904048ffbf use instance process events 2017-03-27 19:00:37 +02:00
Johannes Pohl
4e2443bef6 decrease timeout to speed up tests 2017-03-27 15:56:47 +02:00
Johannes Pohl
e3a70f15a2 optimize memory management 2017-03-27 15:38:52 +02:00
Johannes Pohl
7a37a7dcba refactor close timeout 2017-03-27 15:10:50 +02:00
Johannes Pohl
716771128e optimize timeouts 2017-03-27 14:43:39 +02:00
jopohl
4536dd27ff fix test name and setup methods 2017-03-27 11:21:06 +02:00
jopohl
1a3135418b general teardown and optimized timeouts 2017-03-27 11:15:08 +02:00
jopohl
612dcdf38c centralize add signal to form 2017-03-27 10:58:13 +02:00
jopohl
e3eded89d9 optimize timeouts 2017-03-27 10:39:10 +02:00
jopohl
fc793e2e71 add common base class for test cases 2017-03-27 10:16:43 +02:00