├── .github └── workflows │ └── build.yml ├── .gitignore ├── CMake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in └── memaccess.cmake ├── CMakeLists.txt ├── COPYING ├── Doxyfile ├── HACKING ├── INSTALL ├── NEWS ├── README ├── android ├── AndroidManifest.xml ├── assetreader.cpp ├── assetreader.hpp ├── bundled_libs.xml.in ├── custom_rules.xml ├── loghandler.cpp ├── loghandler.hpp ├── res │ ├── layout │ │ └── splash.xml │ └── values │ │ ├── libs.xml │ │ └── strings-pv.xml └── src │ └── org │ └── sigrok │ └── pulseview │ ├── PulseViewActivity.java │ └── PulseViewApplication.java ├── config.h.in ├── contrib ├── org.sigrok.PulseView.appdata.xml ├── org.sigrok.PulseView.desktop └── pulseview_cross.nsi.in ├── doc └── pulseview.1 ├── extdef.h ├── icons ├── add-decoder.svg ├── add-math-signal.svg ├── application-exit.png ├── channels.svg ├── decoder-delete.svg ├── decoder-hidden.svg ├── decoder-shown.svg ├── document-new.png ├── document-open.png ├── document-save-as.png ├── edit-paste.svg ├── help-browser.png ├── information.svg ├── math.svg ├── media-playback-pause.png ├── media-playback-start.png ├── menu.svg ├── preferences-system.png ├── pulseview.ico ├── pulseview.png ├── pulseview.svg ├── search.svg ├── settings-general.png ├── settings-views.svg ├── show-cursors.svg ├── status-green.svg ├── status-grey.svg ├── status-red.svg ├── trigger-change.svg ├── trigger-falling.svg ├── trigger-high.svg ├── trigger-low.svg ├── trigger-marker-change.svg ├── trigger-marker-falling.svg ├── trigger-marker-high.svg ├── trigger-marker-low.svg ├── trigger-marker-rising.svg ├── trigger-none.svg ├── trigger-rising.svg ├── view-displaymode-last_complete_segment.svg ├── view-displaymode-last_segment.svg ├── view-displaymode-single_segment.svg ├── window-new.png ├── zoom-fit-best.png ├── zoom-in.png └── zoom-out.png ├── l10n ├── de.ts ├── es_MX.ts ├── ja_jp.ts └── zh_cn.ts ├── main.cpp ├── manual ├── CMakeLists.txt ├── acquisition.txt ├── analysis.txt ├── asciidoctor-stylesheet-factory │ ├── LICENSE │ └── stylesheets │ │ └── readthedocs.css ├── cli.txt ├── decoders.txt ├── images │ ├── _callouts.xcf │ ├── device_selector.png │ ├── device_selector_dropdown.png │ ├── device_selector_scan.png │ ├── pv_after_startup.png │ ├── pv_after_startup.xcf │ ├── pv_analysis.png │ ├── pv_analysis.xcf │ ├── pv_ann_export_format.png │ ├── pv_ann_export_menu.png │ ├── pv_binary_decoder_output_view.png │ ├── pv_binary_decoder_output_view_i2s.png │ ├── pv_class_selectors.png │ ├── pv_conversion_a2l.png │ ├── pv_cursors_markers.png │ ├── pv_cursors_markers.xcf │ ├── pv_decoders_1.png │ ├── pv_decoders_1.xcf │ ├── pv_decoders_2.png │ ├── pv_decoders_3.png │ ├── pv_decoders_3.xcf │ ├── pv_decoders_4.png │ ├── pv_device_config.png │ ├── pv_device_config.xcf │ ├── pv_import.png │ ├── pv_marker_deltas.png │ ├── pv_nodevice.png │ └── top_bar.png ├── import_export.txt ├── installation.txt ├── license.txt ├── manual.txt └── overview.txt ├── pulseview.qrc ├── pulseviewico.rc ├── pv ├── application.cpp ├── application.hpp ├── binding │ ├── binding.cpp │ ├── binding.hpp │ ├── decoder.cpp │ ├── decoder.hpp │ ├── device.cpp │ ├── device.hpp │ ├── inputoutput.cpp │ └── inputoutput.hpp ├── data │ ├── analog.cpp │ ├── analog.hpp │ ├── analogsegment.cpp │ ├── analogsegment.hpp │ ├── decode │ │ ├── annotation.cpp │ │ ├── annotation.hpp │ │ ├── decoder.cpp │ │ ├── decoder.hpp │ │ ├── row.cpp │ │ ├── row.hpp │ │ ├── rowdata.cpp │ │ └── rowdata.hpp │ ├── decodesignal.cpp │ ├── decodesignal.hpp │ ├── logic.cpp │ ├── logic.hpp │ ├── logicsegment.cpp │ ├── logicsegment.hpp │ ├── mathsignal.cpp │ ├── mathsignal.hpp │ ├── segment.cpp │ ├── segment.hpp │ ├── signalbase.cpp │ ├── signalbase.hpp │ ├── signaldata.cpp │ └── signaldata.hpp ├── devicemanager.cpp ├── devicemanager.hpp ├── devices │ ├── device.cpp │ ├── device.hpp │ ├── file.cpp │ ├── file.hpp │ ├── hardwaredevice.cpp │ ├── hardwaredevice.hpp │ ├── inputfile.cpp │ ├── inputfile.hpp │ ├── sessionfile.cpp │ └── sessionfile.hpp ├── dialogs │ ├── connect.cpp │ ├── connect.hpp │ ├── inputoutputoptions.cpp │ ├── inputoutputoptions.hpp │ ├── settings.cpp │ ├── settings.hpp │ ├── storeprogress.cpp │ └── storeprogress.hpp ├── exprtk.hpp ├── globalsettings.cpp ├── globalsettings.hpp ├── logging.cpp ├── logging.hpp ├── mainwindow.cpp ├── mainwindow.hpp ├── metadata_obj.cpp ├── metadata_obj.hpp ├── popups │ ├── channels.cpp │ ├── channels.hpp │ ├── deviceoptions.cpp │ └── deviceoptions.hpp ├── prop │ ├── bool.cpp │ ├── bool.hpp │ ├── double.cpp │ ├── double.hpp │ ├── enum.cpp │ ├── enum.hpp │ ├── int.cpp │ ├── int.hpp │ ├── property.cpp │ ├── property.hpp │ ├── string.cpp │ └── string.hpp ├── session.cpp ├── session.hpp ├── storesession.cpp ├── storesession.hpp ├── strnatcmp.hpp ├── subwindows │ ├── decoder_selector │ │ ├── item.cpp │ │ ├── model.cpp │ │ ├── subwindow.cpp │ │ └── subwindow.hpp │ ├── subwindowbase.cpp │ └── subwindowbase.hpp ├── toolbars │ ├── mainbar.cpp │ └── mainbar.hpp ├── util.cpp ├── util.hpp ├── views │ ├── decoder_binary │ │ ├── QHexView.cpp │ │ ├── QHexView.hpp │ │ ├── view.cpp │ │ └── view.hpp │ ├── tabular_decoder │ │ ├── model.cpp │ │ ├── view.cpp │ │ └── view.hpp │ ├── trace │ │ ├── analogsignal.cpp │ │ ├── analogsignal.hpp │ │ ├── cursor.cpp │ │ ├── cursor.hpp │ │ ├── cursorpair.cpp │ │ ├── cursorpair.hpp │ │ ├── decodetrace.cpp │ │ ├── decodetrace.hpp │ │ ├── flag.cpp │ │ ├── flag.hpp │ │ ├── header.cpp │ │ ├── header.hpp │ │ ├── logicsignal.cpp │ │ ├── logicsignal.hpp │ │ ├── marginwidget.cpp │ │ ├── marginwidget.hpp │ │ ├── mathsignal.cpp │ │ ├── mathsignal.hpp │ │ ├── ruler.cpp │ │ ├── ruler.hpp │ │ ├── signal.cpp │ │ ├── signal.hpp │ │ ├── standardbar.cpp │ │ ├── standardbar.hpp │ │ ├── timeitem.cpp │ │ ├── timeitem.hpp │ │ ├── timemarker.cpp │ │ ├── timemarker.hpp │ │ ├── trace.cpp │ │ ├── trace.hpp │ │ ├── tracegroup.cpp │ │ ├── tracegroup.hpp │ │ ├── tracepalette.cpp │ │ ├── tracepalette.hpp │ │ ├── tracetreeitem.cpp │ │ ├── tracetreeitem.hpp │ │ ├── tracetreeitemowner.cpp │ │ ├── tracetreeitemowner.hpp │ │ ├── triggermarker.cpp │ │ ├── triggermarker.hpp │ │ ├── view.cpp │ │ ├── view.hpp │ │ ├── viewitem.cpp │ │ ├── viewitem.hpp │ │ ├── viewitemiterator.hpp │ │ ├── viewitemowner.cpp │ │ ├── viewitemowner.hpp │ │ ├── viewitempaintparams.cpp │ │ ├── viewitempaintparams.hpp │ │ ├── viewport.cpp │ │ ├── viewport.hpp │ │ ├── viewwidget.cpp │ │ └── viewwidget.hpp │ ├── viewbase.cpp │ └── viewbase.hpp └── widgets │ ├── colorbutton.cpp │ ├── colorbutton.hpp │ ├── colorpopup.cpp │ ├── colorpopup.hpp │ ├── decodergroupbox.cpp │ ├── decodergroupbox.hpp │ ├── decodermenu.cpp │ ├── decodermenu.hpp │ ├── devicetoolbutton.cpp │ ├── devicetoolbutton.hpp │ ├── exportmenu.cpp │ ├── exportmenu.hpp │ ├── flowlayout.cpp │ ├── flowlayout.hpp │ ├── importmenu.cpp │ ├── importmenu.hpp │ ├── popup.cpp │ ├── popup.hpp │ ├── popuptoolbutton.cpp │ ├── popuptoolbutton.hpp │ ├── sweeptimingwidget.cpp │ ├── sweeptimingwidget.hpp │ ├── timestampspinbox.cpp │ ├── timestampspinbox.hpp │ ├── wellarray.cpp │ └── wellarray.hpp ├── signalhandler.cpp ├── signalhandler.hpp ├── test ├── CMakeLists.txt ├── data │ ├── analogsegment.cpp │ ├── decoderstack.cpp │ ├── logicsegment.cpp │ └── segment.cpp ├── test.cpp ├── test.hpp ├── util.cpp └── view │ └── ruler.cpp ├── themes ├── darkstyle │ ├── darkstyle.qss │ ├── icon_branch_closed.png │ ├── icon_branch_end.png │ ├── icon_branch_more.png │ ├── icon_branch_open.png │ ├── icon_checkbox_checked.png │ ├── icon_checkbox_checked_disabled.png │ ├── icon_checkbox_checked_pressed.png │ ├── icon_checkbox_indeterminate.png │ ├── icon_checkbox_indeterminate_disabled.png │ ├── icon_checkbox_indeterminate_pressed.png │ ├── icon_checkbox_unchecked.png │ ├── icon_checkbox_unchecked_disabled.png │ ├── icon_checkbox_unchecked_pressed.png │ ├── icon_close.png │ ├── icon_radiobutton_checked.png │ ├── icon_radiobutton_checked_disabled.png │ ├── icon_radiobutton_checked_pressed.png │ ├── icon_radiobutton_unchecked.png │ ├── icon_radiobutton_unchecked_disabled.png │ ├── icon_radiobutton_unchecked_pressed.png │ ├── icon_restore.png │ ├── icon_undock.png │ └── icon_vline.png └── qdarkstyle │ ├── rc │ ├── Hmovetoolbar.png │ ├── Hsepartoolbar.png │ ├── Vmovetoolbar.png │ ├── Vsepartoolbar.png │ ├── branch_closed-on.png │ ├── branch_closed.png │ ├── branch_open-on.png │ ├── branch_open.png │ ├── checkbox_checked.png │ ├── checkbox_checked_disabled.png │ ├── checkbox_checked_focus.png │ ├── checkbox_indeterminate.png │ ├── checkbox_indeterminate_disabled.png │ ├── checkbox_indeterminate_focus.png │ ├── checkbox_unchecked.png │ ├── checkbox_unchecked_disabled.png │ ├── checkbox_unchecked_focus.png │ ├── close-hover.png │ ├── close-pressed.png │ ├── close.png │ ├── down_arrow.png │ ├── down_arrow_disabled.png │ ├── left_arrow.png │ ├── left_arrow_disabled.png │ ├── radio_checked.png │ ├── radio_checked_disabled.png │ ├── radio_checked_focus.png │ ├── radio_unchecked.png │ ├── radio_unchecked_disabled.png │ ├── radio_unchecked_focus.png │ ├── right_arrow.png │ ├── right_arrow_disabled.png │ ├── sizegrip.png │ ├── stylesheet-branch-end.png │ ├── stylesheet-branch-more.png │ ├── stylesheet-vline.png │ ├── transparent.png │ ├── undock.png │ ├── up_arrow.png │ └── up_arrow_disabled.png │ └── style.qss └── translations.qrc /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build PulseView artifacts 2 | 3 | on: 4 | push: # When the repo itself has a new commit on the master branch 5 | branches: 6 | - master 7 | tags: # When a new tag was created 8 | workflow_dispatch: # When the workflow was started manually from github 9 | pull_request: 10 | types: 11 | - labeled # When a pull request received a new label (e.g. "provide_binaries") 12 | - synchronize # When a pull request's branch was updated with a new commit 13 | 14 | jobs: 15 | call-build-workflow: 16 | name: Sigrok artifact builder 17 | uses: sigrokproject/sigrok-build/.github/workflows/build.yml@master 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | .*.swo 4 | 5 | pulseview 6 | pulseview-test 7 | libpulseview.so 8 | 9 | # CMake cruft 10 | /*.cmake 11 | CMakeCache.txt 12 | CMakeFiles/ 13 | cotire/ 14 | Makefile 15 | Testing/ 16 | 17 | .ninja_deps 18 | .ninja_log 19 | *.ninja 20 | 21 | # qt generated code 22 | *.qrc.depends 23 | moc_*.cxx 24 | qrc_*.cxx 25 | moc_*.cpp 26 | qrc_*.cpp 27 | ui_*.h 28 | *.cxx_parameters 29 | *.cpp_parameters 30 | 31 | config.h 32 | 33 | android/libs/ 34 | android/assets/ 35 | android/res/drawable/ 36 | android/res/values/bundled_libs.xml 37 | android/res/*/strings.xml 38 | android/res/xml/device_filter.xml 39 | android/build.xml 40 | android/project.properties 41 | android/local.properties 42 | android/proguard-project.txt 43 | android/bin/ 44 | android/gen/ 45 | android/ant/build/ 46 | android/ant/tasks.jar 47 | android/src/org/qtproject/ 48 | android/src/org/kde/ 49 | 50 | # QtCreator cruft 51 | /CMakeLists.txt.user* 52 | *.cbp 53 | 54 | # KDE temp file show marker 55 | .directory 56 | 57 | doxy 58 | build/ 59 | 60 | contrib/pulseview_cross.nsi 61 | cmake_install.cmake 62 | install_manifest.txt 63 | manual/cmake_install.cmake 64 | manual/manual.html 65 | manual/manual.pdf 66 | test/cmake_install.cmake 67 | *_autogen 68 | 69 | # Translation binaries 70 | *.qm 71 | -------------------------------------------------------------------------------- /CMake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /CMake/memaccess.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the PulseView project. 3 | ## 4 | ## Copyright (C) 2014 Marcus Comstedt 5 | ## 6 | ## This program is free software: you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation, either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program. If not, see . 18 | ## 19 | 20 | include(CheckCSourceRuns) 21 | 22 | function(memaccess_check_unaligned_le _var) 23 | if(NOT CMAKE_CROSSCOMPILING) 24 | CHECK_C_SOURCE_RUNS(" 25 | #include 26 | int main() { 27 | int i; 28 | union { uint64_t u64; uint8_t u8[16]; } d; 29 | uint64_t v; 30 | for (i=0; i<16; i++) 31 | d.u8[i] = i; 32 | v = *(uint64_t *)(d.u8+1); 33 | if (v != 0x0807060504030201ULL) 34 | return 1; 35 | return 0; 36 | }" ${_var}) 37 | endif() 38 | if(CMAKE_CROSSCOMPILING) 39 | message(STATUS "Cross compiling - using portable code for memory access") 40 | endif() 41 | endfunction() 42 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | INSTALL 3 | ------------------------------------------------------------------------------- 4 | 5 | Requirements 6 | ------------ 7 | 8 | - git (only needed when building from git) 9 | - A C++ compiler with C++11 support (-std=c++11 option), e.g. 10 | - g++ (>= 4.8.1) 11 | - clang++ (>= 3.3) 12 | - make 13 | - libtool (only needed when building from git) 14 | - pkg-config >= 0.22 15 | - cmake >= 2.8.12 16 | - libglib >= 2.28.0 17 | - glibmm-2.4 (>= 2.28.0) 18 | - Qt5 (>= 5.3), including the following components: 19 | - Qt5Core, Qt5Gui, Qt5Widgets, Qt5Svg, 20 | Qt5LinguistTools (qttools5-dev, qttools5-dev-tools) 21 | - Qt translation package (optional; needed at runtime, not build time) 22 | - libboost >= 1.55 (including the following libs): 23 | - libboost-system 24 | - libboost-filesystem 25 | - libboost-serialization 26 | - libboost-test (optional, only needed to run the unit tests) 27 | - libboost-stacktrace (optional, only needed for debugging) 28 | - libsigrokcxx >= 0.5.2 (libsigrok C++ bindings) 29 | - libsigrokdecode >= 0.5.2 30 | - libsigrokandroidutils >= 0.1.0 (optional, only needed on Android) 31 | - asciidoctor (optional, only needed to build the HTML manual) 32 | - asciidoctor-pdf (optional, only needed to build the PDF manual) 33 | 34 | 35 | Building and installing 36 | ----------------------- 37 | 38 | In order to get the PulseView source code and build it, run: 39 | 40 | $ git clone git://sigrok.org/pulseview 41 | $ cd pulseview 42 | $ cmake . 43 | $ make 44 | 45 | For installing PulseView: 46 | 47 | $ make install 48 | 49 | See the following wiki page for more (OS-specific) instructions: 50 | 51 | http://sigrok.org/wiki/Building 52 | 53 | 54 | Creating a source distribution package 55 | -------------------------------------- 56 | 57 | In order to build a source package begin with an unconfigured source tree. 58 | 59 | $ mkdir dist 60 | $ cd dist 61 | $ cmake .. 62 | $ make package_source 63 | 64 | 65 | Generating the manual 66 | --------------------- 67 | 68 | To generate the HTML manual, you only need Asciidoctor. If you also want 69 | to generate the PDF manual, you need to install asciidoctor-pdf as well 70 | and make it available for execution: 71 | 72 | $ gem install --pre asciidoctor-pdf 73 | $ export PATH=~/.gem/ruby/2.3.0/bin:$PATH 74 | 75 | Then, to build the PulseView manual, run: 76 | 77 | $ make manual 78 | 79 | Note: The stylesheet used is a lightly modified version of "Read The Docs" 80 | from the Asciidoctor stylesheet factory: 81 | https://asciidoctor.org/docs/user-manual/#stylesheet-factory 82 | -------------------------------------------------------------------------------- /android/assetreader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Daniel Elstner 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include "assetreader.hpp" 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | using namespace pv; 31 | 32 | using std::string; 33 | using std::unique_ptr; 34 | 35 | void AndroidAssetReader::open(struct sr_resource *res, string name) 36 | { 37 | if (res->type == SR_RESOURCE_FIRMWARE) { 38 | auto path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, 39 | QString::fromStdString("sigrok-firmware/" + name)); 40 | if (path.isEmpty()) 41 | path = QString::fromStdString("assets:/sigrok-firmware/" + name); 42 | 43 | unique_ptr file {new QFile{path}}; 44 | 45 | if (!file->open(QIODevice::ReadOnly)) 46 | throw sigrok::Error{SR_ERR}; 47 | 48 | const auto size = file->size(); 49 | if (size < 0) 50 | throw sigrok::Error{SR_ERR}; 51 | 52 | res->size = size; 53 | res->handle = file.release(); 54 | } else { 55 | qWarning() << "AndroidAssetReader: Unknown resource type" << res->type; 56 | throw sigrok::Error{SR_ERR}; 57 | } 58 | } 59 | 60 | void AndroidAssetReader::close(struct sr_resource *res) 61 | { 62 | if (!res->handle) { 63 | qCritical("AndroidAssetReader: Invalid handle"); 64 | throw sigrok::Error{SR_ERR_ARG}; 65 | } 66 | const unique_ptr file {static_cast(res->handle)}; 67 | res->handle = nullptr; 68 | 69 | file->close(); 70 | } 71 | 72 | size_t AndroidAssetReader::read(const struct sr_resource *res, void *buf, size_t count) 73 | { 74 | if (!res->handle) { 75 | qCritical("AndroidAssetReader: Invalid handle"); 76 | throw sigrok::Error{SR_ERR_ARG}; 77 | } 78 | auto *const file = static_cast(res->handle); 79 | 80 | const auto n_read = file->read(static_cast(buf), count); 81 | if (n_read < 0) 82 | throw sigrok::Error{SR_ERR}; 83 | 84 | return n_read; 85 | } 86 | -------------------------------------------------------------------------------- /android/assetreader.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Daniel Elstner 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_ANDROID_ASSETREADER_HPP 21 | #define PULSEVIEW_ANDROID_ASSETREADER_HPP 22 | 23 | #include 24 | 25 | using std::string; 26 | 27 | namespace pv { 28 | 29 | class AndroidAssetReader : public sigrok::ResourceReader 30 | { 31 | public: 32 | AndroidAssetReader() = default; 33 | virtual ~AndroidAssetReader() = default; 34 | 35 | private: 36 | void open(struct sr_resource *res, string name) override; 37 | void close(struct sr_resource *res) override; 38 | size_t read(const struct sr_resource *res, void *buf, size_t count) override; 39 | }; 40 | 41 | } // namespace pv 42 | 43 | #endif // !PULSEVIEW_ANDROID_ASSETREADER_HPP 44 | -------------------------------------------------------------------------------- /android/bundled_libs.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | @bundled_libs@ 23 | 24 | 25 | -------------------------------------------------------------------------------- /android/loghandler.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Marcus Comstedt 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_ANDROID_LOGHANDLER_HPP 21 | #define PULSEVIEW_ANDROID_LOGHANDLER_HPP 22 | 23 | #include 24 | 25 | namespace pv { 26 | 27 | class AndroidLogHandler 28 | { 29 | private: 30 | static int sr_callback(void *cb_data, int loglevel, const char *format, va_list args); 31 | static int srd_callback(void *cb_data, int loglevel, const char *format, va_list args); 32 | 33 | public: 34 | static void install_callbacks(); 35 | }; 36 | 37 | } // namespace pv 38 | 39 | #endif // PULSEVIEW_ANDROID_LOGHANDLER_HPP 40 | -------------------------------------------------------------------------------- /android/res/layout/splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | -------------------------------------------------------------------------------- /android/res/values/libs.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | https://download.qt-project.org/ministro/android/qt5/qt-5.3 23 | 24 | 25 | 26 | gnustl_shared 27 | Qt5Core 28 | Qt5Gui 29 | Qt5Widgets 30 | Qt5Svg 31 | 32 | 33 | 34 | libplugins_platforms_android_libqtforandroid.so:plugins/platforms/android/libqtforandroid.so 35 | libplugins_platforms_libqeglfs.so:plugins/platforms/libqeglfs.so 36 | libplugins_platforms_libqminimal.so:plugins/platforms/libqminimal.so 37 | libplugins_platforms_libqminimalegl.so:plugins/platforms/libqminimalegl.so 38 | libplugins_platforms_libqoffscreen.so:plugins/platforms/libqoffscreen.so 39 | libplugins_generic_libqevdevkeyboardplugin.so:plugins/generic/libqevdevkeyboardplugin.so 40 | libplugins_generic_libqevdevmouseplugin.so:plugins/generic/libqevdevmouseplugin.so 41 | libplugins_generic_libqevdevtabletplugin.so:plugins/generic/libqevdevtabletplugin.so 42 | libplugins_generic_libqevdevtouchplugin.so:plugins/generic/libqevdevtouchplugin.so 43 | libplugins_imageformats_libqsvg.so:plugins/imageformats/libqsvg.so 44 | libplugins_iconengines_libqsvgicon.so:plugins/iconengines/libqsvgicon.so 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /android/res/values/strings-pv.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | PulseView 22 | 23 | -------------------------------------------------------------------------------- /android/src/org/sigrok/pulseview/PulseViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Marcus Comstedt 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package org.sigrok.pulseview; 21 | 22 | import org.qtproject.qt5.android.bindings.QtActivity; 23 | import org.sigrok.androidutils.UsbSupplicant; 24 | 25 | import android.os.Bundle; 26 | 27 | public class PulseViewActivity extends QtActivity 28 | { 29 | private UsbSupplicant supplicant; 30 | 31 | @Override 32 | public void onCreate(Bundle savedInstanceState) 33 | { 34 | super.onCreate(savedInstanceState); 35 | supplicant = new UsbSupplicant(getApplicationContext(), R.xml.device_filter); 36 | } 37 | 38 | @Override 39 | protected void onStart() 40 | { 41 | super.onStart(); 42 | supplicant.start(); 43 | } 44 | 45 | @Override 46 | protected void onStop() 47 | { 48 | supplicant.stop(); 49 | super.onStop(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /android/src/org/sigrok/pulseview/PulseViewApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Marcus Comstedt 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package org.sigrok.pulseview; 21 | 22 | import org.qtproject.qt5.android.bindings.QtApplication; 23 | import org.sigrok.androidutils.Environment; 24 | import org.sigrok.androidutils.UsbHelper; 25 | 26 | import java.io.File; 27 | import java.io.IOException; 28 | 29 | public class PulseViewApplication extends QtApplication 30 | { 31 | @Override 32 | public void onCreate() 33 | { 34 | Environment.initEnvironment(getApplicationInfo().sourceDir); 35 | UsbHelper.setContext(getApplicationContext()); 36 | super.onCreate(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Alexandru Gagniuc 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef _PULSEVIEW_CONFIG_H 21 | #define _PULSEVIEW_CONFIG_H 22 | 23 | /* Application details */ 24 | #define PV_TITLE "@PV_TITLE@" 25 | #define PV_BIN_NAME "@PROJECT_NAME@" 26 | 27 | /* Pulseview version information */ 28 | #define PV_VERSION_MAJOR @PV_VERSION_MAJOR@ 29 | #define PV_VERSION_MINOR @PV_VERSION_MINOR@ 30 | #define PV_VERSION_MICRO @PV_VERSION_MICRO@ 31 | #define PV_VERSION_SUFFIX @PV_VERSION_SUFFIX@ 32 | #define PV_VERSION_STRING "@PV_VERSION_STRING@" 33 | 34 | /* Platform properties */ 35 | #cmakedefine HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS 36 | 37 | /* Presence of features which depend on library versions. */ 38 | #cmakedefine HAVE_SRD_SESSION_SEND_EOF 1 39 | 40 | #define PV_GLIBMM_VERSION "@PV_GLIBMM_VERSION@" 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /contrib/org.sigrok.PulseView.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.sigrok.PulseView.desktop 5 | CC0-1.0 6 | GPL-3.0+ 7 | PulseView 8 | Logic analyzer, oscilloscope and MSO GUI 9 | 10 |

PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI for sigrok supporting various features:

11 |
    12 |
  • Fast O(log N) signal rendering at all zoom levels
  • 13 |
  • Protocol decoder support
  • 14 |
  • Trace groups support
  • 15 |
16 |
17 | https://sigrok.org/wiki/PulseView 18 | https://sigrok.org/bugzilla/enter_bug.cgi?format=guided&product=PulseView 19 | https://sigrok.org/wiki/FAQ 20 | 21 | 22 | https://sigrok.org/wimg/e/ee/PulseView_I2C_DS1307_Decode.png 23 | 24 | 25 | 26 | pulseview 27 | 28 | 29 | org.sigrok.sigrok-firmware 30 | org.sigrok.sigrok-firmware-fx2lafw 31 | 32 | org.sigrok.PulseView.desktop 33 | 34 | application/vnd.sigrok.session 35 | 36 |
37 | -------------------------------------------------------------------------------- /contrib/org.sigrok.PulseView.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | # Creative Commons CC0 1.0 Universal (CC0-1.0, Public Domain Dedication). 3 | Name=PulseView 4 | GenericName=Logic analyzer, oscilloscope and MSO GUI 5 | Categories=Development;Electronics; 6 | Comment=Control your logic analyzer, oscilloscope, or MSO 7 | Exec=pulseview 8 | Icon=pulseview 9 | Type=Application 10 | MimeType=application/vnd.sigrok.session; 11 | -------------------------------------------------------------------------------- /extdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_EXTDEF_H 21 | #define PULSEVIEW_EXTDEF_H 22 | 23 | #define countof(x) (sizeof(x) / sizeof(x[0])) 24 | 25 | #define begin_element(x) (&x[0]) 26 | #define end_element(x) (&x[countof(x)]) 27 | 28 | #endif // PULSEVIEW_EXTDEF_H 29 | -------------------------------------------------------------------------------- /icons/add-decoder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /icons/application-exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/application-exit.png -------------------------------------------------------------------------------- /icons/channels.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /icons/decoder-delete.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /icons/decoder-hidden.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /icons/decoder-shown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /icons/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/document-new.png -------------------------------------------------------------------------------- /icons/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/document-open.png -------------------------------------------------------------------------------- /icons/document-save-as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/document-save-as.png -------------------------------------------------------------------------------- /icons/help-browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/help-browser.png -------------------------------------------------------------------------------- /icons/media-playback-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/media-playback-pause.png -------------------------------------------------------------------------------- /icons/media-playback-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/media-playback-start.png -------------------------------------------------------------------------------- /icons/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /icons/preferences-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/preferences-system.png -------------------------------------------------------------------------------- /icons/pulseview.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/pulseview.ico -------------------------------------------------------------------------------- /icons/pulseview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/pulseview.png -------------------------------------------------------------------------------- /icons/settings-general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/settings-general.png -------------------------------------------------------------------------------- /icons/show-cursors.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /icons/status-green.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /icons/status-grey.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /icons/status-red.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /icons/trigger-change.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /icons/trigger-falling.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /icons/trigger-high.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /icons/trigger-low.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /icons/trigger-marker-change.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 35 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /icons/trigger-marker-falling.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | -------------------------------------------------------------------------------- /icons/trigger-marker-high.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | -------------------------------------------------------------------------------- /icons/trigger-marker-low.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /icons/trigger-marker-rising.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /icons/trigger-none.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /icons/trigger-rising.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | image/svg+xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /icons/window-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/window-new.png -------------------------------------------------------------------------------- /icons/zoom-fit-best.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/zoom-fit-best.png -------------------------------------------------------------------------------- /icons/zoom-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/zoom-in.png -------------------------------------------------------------------------------- /icons/zoom-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/icons/zoom-out.png -------------------------------------------------------------------------------- /manual/asciidoctor-stylesheet-factory/LICENSE: -------------------------------------------------------------------------------- 1 | Asciidoctor styles 2 | ------------------ 3 | 4 | Copyright (c) 2013 Dan Allen 5 | 6 | MIT License 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | 28 | Other licensed work 29 | ------------------- 30 | 31 | - Foundation 4 by Zurb, on which the themes are built, is licensed under the 32 | Apache License, v2.0: 33 | 34 | http://apache.org/licenses/LICENSE-2.0 35 | http://foundation.zurb.com 36 | 37 | - The riak theme is derived from the Riak documentation theme by Basho, 38 | licensed under the Creative Commons Attribution 3.0 Unported License: 39 | 40 | http://creativecommons.org/licenses/by/3.0/us 41 | http://docs.basho.org 42 | 43 | - The iconic theme is inspired by O'Reilly typography and Atlas manual. 44 | 45 | http://oreilly.com 46 | -------------------------------------------------------------------------------- /manual/cli.txt: -------------------------------------------------------------------------------- 1 | == Command-line Interface 2 | 3 | Even though PulseView has a graphical user interface, there is also a command-line interface that 4 | you can make use of. It is meant to provide functions for convenience and debug purposes, not to 5 | replace the user interface itself. 6 | 7 | Running 8 | 9 | pulseview -h 10 | 11 | gives you a list of these functions. 12 | 13 | Since PulseView can't automatically scan for devices connected to a COM port (ttySx on Linux) or 14 | Ethernet, you can tell it to look for a specific device using the -d or --driver parameter. Its 15 | usage is the same as for sigrok-cli. For example: 16 | 17 | pulseview -d lecroy-xstream:conn=vxi/192.168.178.20/111 18 | 19 | Also, just as with sigrok-cli, you can specify -i / --input-file and -I / --input-format to open 20 | a file on startup. Without -I, it is assumed that the file is in the native sigrok format (.sr). 21 | You can also specify more than one file but they are all expected to be in the same format then. 22 | Example: 23 | 24 | pulseview -i data.csv -I csv:samplerate=3000000 25 | 26 | If you previously saved a PulseView session setup alongside your input file, PulseView will 27 | automatically load those settings so long as the setup file (.pvs) has the same base name 28 | as your input file. 29 | You can also manually specify a PulseView session setup file to load with -s / --settings. 30 | Example: 31 | 32 | pulseview -s settings.pvs data.sr 33 | 34 | The remaining parameters are mostly for debug purposes: 35 | 36 | -V / --version Shows the release version 37 | -l / --loglevel Sets the libsigrok/libsigrokdecode log level (max is 5) 38 | -D / --dont-scan Don't auto-scan for devices 39 | -c / --clean Don't restore previous sessions on startup 40 | 41 | Of these, -D / --dont-scan can be useful when PulseView gets stuck during the startup device scan. 42 | No such scan will be performed then, allowing the program to start up but you'll have to scan for 43 | your acquisition device(s) manually before you can use them. 44 | 45 | Another potentially useful option is -c / --clean, which can be used when PulseView doesn't start 46 | up and you don't know what could cause this. 47 | 48 | Thus, the combination of both parameters can be seen as some kind of "safe mode" for PulseView: 49 | 50 | pulseview -c -D 51 | -------------------------------------------------------------------------------- /manual/images/_callouts.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/_callouts.xcf -------------------------------------------------------------------------------- /manual/images/device_selector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/device_selector.png -------------------------------------------------------------------------------- /manual/images/device_selector_dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/device_selector_dropdown.png -------------------------------------------------------------------------------- /manual/images/device_selector_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/device_selector_scan.png -------------------------------------------------------------------------------- /manual/images/pv_after_startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_after_startup.png -------------------------------------------------------------------------------- /manual/images/pv_after_startup.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_after_startup.xcf -------------------------------------------------------------------------------- /manual/images/pv_analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_analysis.png -------------------------------------------------------------------------------- /manual/images/pv_analysis.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_analysis.xcf -------------------------------------------------------------------------------- /manual/images/pv_ann_export_format.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_ann_export_format.png -------------------------------------------------------------------------------- /manual/images/pv_ann_export_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_ann_export_menu.png -------------------------------------------------------------------------------- /manual/images/pv_binary_decoder_output_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_binary_decoder_output_view.png -------------------------------------------------------------------------------- /manual/images/pv_binary_decoder_output_view_i2s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_binary_decoder_output_view_i2s.png -------------------------------------------------------------------------------- /manual/images/pv_class_selectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_class_selectors.png -------------------------------------------------------------------------------- /manual/images/pv_conversion_a2l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_conversion_a2l.png -------------------------------------------------------------------------------- /manual/images/pv_cursors_markers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_cursors_markers.png -------------------------------------------------------------------------------- /manual/images/pv_cursors_markers.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_cursors_markers.xcf -------------------------------------------------------------------------------- /manual/images/pv_decoders_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_decoders_1.png -------------------------------------------------------------------------------- /manual/images/pv_decoders_1.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_decoders_1.xcf -------------------------------------------------------------------------------- /manual/images/pv_decoders_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_decoders_2.png -------------------------------------------------------------------------------- /manual/images/pv_decoders_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_decoders_3.png -------------------------------------------------------------------------------- /manual/images/pv_decoders_3.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_decoders_3.xcf -------------------------------------------------------------------------------- /manual/images/pv_decoders_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_decoders_4.png -------------------------------------------------------------------------------- /manual/images/pv_device_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_device_config.png -------------------------------------------------------------------------------- /manual/images/pv_device_config.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_device_config.xcf -------------------------------------------------------------------------------- /manual/images/pv_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_import.png -------------------------------------------------------------------------------- /manual/images/pv_marker_deltas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_marker_deltas.png -------------------------------------------------------------------------------- /manual/images/pv_nodevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/pv_nodevice.png -------------------------------------------------------------------------------- /manual/images/top_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/manual/images/top_bar.png -------------------------------------------------------------------------------- /manual/import_export.txt: -------------------------------------------------------------------------------- 1 | == Data Import/Export 2 | 3 | In order to facilitate versatile use of the sigrok suite, libsigrok allows users to import 4 | and export data from files in various formats - some of them as generic as possible, others 5 | very specific. For a list and details, make sure to check https://sigrok.org/wiki/Input_output_formats[the wiki]. 6 | 7 | === Import 8 | 9 | The first step to importing data from a file is to know what format the data in the file is 10 | encoded in. There are common, not-so-common and outright exotic ways to represent data and sigrok 11 | tries to suit as many needs as it can. To see which formats your version of PulseView supports, 12 | just click on the small arrow next to the _Open_ button: 13 | 14 | image::pv_import.png[] 15 | 16 | After choosing the format that you want to use, PulseView will ask for the file name to open. 17 | Once you picked the file, you may be asked to specify the details of the format, if the input 18 | module requires them. 19 | 20 | For example, the VCD import will ask you for these: 21 | 22 | * Compress idle periods: Compress idle periods longer than the specified value (default 0) 23 | * Downsampling factor: Downsample, i.e. divide the samplerate by the specified factor (default 1) 24 | * Number of logic channels: The number of (logic) channels in the data (default 0) 25 | * Skip samples until timestamp: Skip samples until the specified timestamp; < 0: Skip until first timestamp listed; 0: Don't skip (default -1) 26 | 27 | The detailed description of each item can also be seen when clicking on the help icon on the right 28 | or hovering your mouse over it. A click on _OK_ then loads the data from the selected file and you 29 | can work with it. 30 | 31 | === Export 32 | 33 | Export works just the same as the import: clicking on the small arrow next to the _Save_ button 34 | brings up the export menu. Simply choose the format you want to use and proceed. 35 | -------------------------------------------------------------------------------- /manual/license.txt: -------------------------------------------------------------------------------- 1 | == License 2 | 3 | This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. 4 | -------------------------------------------------------------------------------- /manual/manual.txt: -------------------------------------------------------------------------------- 1 | PulseView User Manual 2 | ===================== 3 | unreleased pulseview development snapshot, manual last changed 2020-02-29 4 | :doctype: book 5 | :imagesdir: ./images 6 | :sectnums: 7 | :toc: 8 | :toclevels: 2 9 | :icons: font 10 | :figure-caption: Image 11 | 12 | ifdef::ebook-format[:leveloffset: -1] 13 | 14 | include::license.txt[] 15 | 16 | include::overview.txt[] 17 | 18 | include::installation.txt[] 19 | 20 | include::acquisition.txt[] 21 | 22 | include::analysis.txt[] 23 | 24 | include::decoders.txt[] 25 | 26 | include::import_export.txt[] 27 | 28 | include::cli.txt[] 29 | -------------------------------------------------------------------------------- /manual/overview.txt: -------------------------------------------------------------------------------- 1 | [[overview,Overview]] 2 | == Overview 3 | 4 | PulseView is a graphical frontend for the libsigrok and libsigrokdecode libraries, permitting 5 | access to a wide range of devices and protocol decoders to let you record, analyze, process 6 | and export analog and logic data. It is part of the sigrok suite, just like the libraries that 7 | it makes use of. 8 | 9 | The sigrok suite needs some kind of hardware to interface to the signals you want to examine. 10 | We found that most people are currently using logic analyzers based on the http://www.cypress.com/products/ez-usb-fx2lp[Cypress FX2 microcontroller]. 11 | With http://sigrok.org/wiki/Fx2lafw[fx2lafw], sigrok's open source runtime firmware, any device 12 | containing an FX2 can become a powerful streaming logic analyzer. 13 | A variety of compatible low cost chinese made logic analyzer products are available for as little 14 | as $5. These can easily be found by searching for _24MHz Logic Analyzer_. There are also barebone 15 | Cypress FX2 boards such as the Lcsoft Mini Board, which can usually be found by searching for 16 | _Cypress FX2 Board_ or similar. 17 | 18 | Additionally, a good set of https://sigrok.org/wiki/Probe_comparison[quality probe hooks] is recommended. 19 | 20 | Aside from FX2-based logic analyzers, sigrok also supports FX2-based oscilloscopes such as the 21 | https://sigrok.org/wiki/Hantek_6022BE[Hantek 6022BE], non-FX2 devices like the 22 | https://sigrok.org/wiki/Openbench_Logic_Sniffer[Openbench Logic Sniffer] or devices that make use 23 | of the SCPI protocol, as all reasonably modern oscilloscopes do (Rigol DS1054z, LeCroy WaveRunner, 24 | Yokogawa DLM and similar). 25 | 26 | Please be aware however, that PulseView currently only supports devices that can either work as an 27 | https://sigrok.org/wiki/Supported_hardware#Oscilloscopes[oscilloscope], 28 | a https://sigrok.org/wiki/Supported_hardware#Logic_analyzers[logic analyzer] or 29 | a https://sigrok.org/wiki/Supported_hardware#Mixed-signal_devices[mixed-signal device]. This 30 | means that multimeters in particular are currently only usable with either https://sigrok.org/wiki/Sigrok-cli[sigrok-cli] 31 | or https://sigrok.org/wiki/Sigrok-meter[sigrok-meter]. 32 | 33 | image::pv_after_startup.png[] 34 | 35 | The PulseView user interface is geared towards navigation and analysis of captured waveforms, so 36 | the most space is by default used up by the main trace view. From here, you can access the most 37 | often used features. 38 | 39 | Before we dive deeper into how to accomplish things, let's make PulseView available on your 40 | system first. 41 | -------------------------------------------------------------------------------- /pulseviewico.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "icons/pulseview.ico" 2 | -------------------------------------------------------------------------------- /pv/application.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Martin Ling 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_APPLICATION_HPP 21 | #define PULSEVIEW_PV_APPLICATION_HPP 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include "devicemanager.hpp" 32 | #include "globalsettings.hpp" 33 | 34 | using std::shared_ptr; 35 | using std::pair; 36 | using std::vector; 37 | 38 | class Application : public QApplication, public pv::GlobalSettingsInterface 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | Application(int &argc, char* argv[]); 44 | 45 | const QStringList get_languages() const; 46 | const QString get_language_editors(const QString& language) const; 47 | void switch_language(const QString& language); 48 | 49 | void on_setting_changed(const QString &key, const QVariant &value); 50 | 51 | void collect_version_info(pv::DeviceManager &device_manager); 52 | void print_version_info(); 53 | 54 | vector< pair > get_version_info() const; 55 | vector get_fw_path_list() const; 56 | vector get_pd_path_list() const; 57 | vector< pair > get_driver_list() const; 58 | vector< pair > get_input_format_list() const; 59 | vector< pair > get_output_format_list() const; 60 | vector< pair > get_pd_list() const; 61 | 62 | private: 63 | bool notify(QObject *receiver, QEvent *event); 64 | 65 | vector< pair > version_info_; 66 | vector fw_path_list_; 67 | vector pd_path_list_; 68 | vector< pair > driver_list_; 69 | vector< pair > input_format_list_; 70 | vector< pair > output_format_list_; 71 | vector< pair > pd_list_; 72 | 73 | QTranslator app_translator_, qt_translator_, qtbase_translator_; 74 | }; 75 | 76 | #endif // PULSEVIEW_PV_APPLICATION_HPP 77 | -------------------------------------------------------------------------------- /pv/binding/binding.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_BINDING_BINDING_HPP 21 | #define PULSEVIEW_PV_BINDING_BINDING_HPP 22 | 23 | #include 24 | // Suppress warnings due to use of deprecated std::auto_ptr<> by glibmm. 25 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS 26 | #include 27 | G_GNUC_END_IGNORE_DEPRECATIONS 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | 36 | using std::map; 37 | using std::shared_ptr; 38 | using std::vector; 39 | 40 | class QFormLayout; 41 | class QLabel; 42 | class QWidget; 43 | 44 | namespace pv { 45 | 46 | namespace prop { 47 | class Property; 48 | } 49 | 50 | namespace binding { 51 | 52 | class Binding: public QObject 53 | { 54 | Q_OBJECT 55 | 56 | public: 57 | const vector< shared_ptr >& properties(); 58 | 59 | void commit(); 60 | 61 | void add_properties_to_form(QFormLayout *layout, bool auto_commit = false); 62 | 63 | QWidget* get_property_form(QWidget *parent, bool auto_commit = false); 64 | 65 | void update_property_widgets(); 66 | 67 | static QString print_gvariant(Glib::VariantBase gvar); 68 | 69 | protected Q_SLOTS: 70 | void on_help_clicked(); 71 | 72 | protected: 73 | vector< shared_ptr > properties_; 74 | map help_labels_; 75 | }; 76 | 77 | } // namespace binding 78 | } // namespace pv 79 | 80 | #endif // PULSEVIEW_PV_BINDING_BINDING_HPP 81 | -------------------------------------------------------------------------------- /pv/binding/decoder.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_BINDING_DECODER_HPP 21 | #define PULSEVIEW_PV_BINDING_DECODER_HPP 22 | 23 | #include "binding.hpp" 24 | 25 | #include 26 | 27 | using std::shared_ptr; 28 | 29 | struct srd_decoder_option; 30 | 31 | namespace pv { 32 | 33 | namespace data { 34 | class DecodeSignal; 35 | namespace decode { 36 | class Decoder; 37 | } 38 | } 39 | 40 | namespace binding { 41 | 42 | class Decoder : public Binding 43 | { 44 | public: 45 | Decoder(shared_ptr decode_signal, 46 | shared_ptr decoder); 47 | 48 | private: 49 | static shared_ptr bind_enum(const QString &name, 50 | const QString &desc, const srd_decoder_option *option, 51 | prop::Property::Getter getter, prop::Property::Setter setter); 52 | 53 | Glib::VariantBase getter(const char *id); 54 | 55 | void setter(const char *id, Glib::VariantBase value); 56 | 57 | private: 58 | shared_ptr decode_signal_; 59 | shared_ptr decoder_; 60 | }; 61 | 62 | } // namespace binding 63 | } // namespace pv 64 | 65 | #endif // PULSEVIEW_PV_BINDING_DECODER_HPP 66 | -------------------------------------------------------------------------------- /pv/binding/device.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_BINDING_DEVICE_HPP 21 | #define PULSEVIEW_PV_BINDING_DEVICE_HPP 22 | 23 | #include 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include "binding.hpp" 31 | 32 | #include 33 | 34 | #include 35 | 36 | using std::function; 37 | using std::pair; 38 | using std::set; 39 | using std::shared_ptr; 40 | 41 | namespace pv { 42 | 43 | namespace binding { 44 | 45 | class Device : public Binding 46 | { 47 | Q_OBJECT 48 | 49 | public: 50 | Device(shared_ptr configurable); 51 | 52 | Q_SIGNALS: 53 | void config_changed(); 54 | 55 | private: 56 | void bind_bool(const QString &name, const QString &desc, 57 | prop::Property::Getter getter, prop::Property::Setter setter); 58 | void bind_enum(const QString &name, const QString &desc, 59 | const sigrok::ConfigKey *key, 60 | set capabilities, 61 | prop::Property::Getter getter, prop::Property::Setter setter, 62 | function printer = print_gvariant); 63 | void bind_int(const QString &name, const QString &desc, QString suffix, 64 | boost::optional< pair > range, 65 | prop::Property::Getter getter, prop::Property::Setter setter, 66 | QString special_value_text = ""); 67 | 68 | static QString print_timebase(Glib::VariantBase gvar); 69 | static QString print_vdiv(Glib::VariantBase gvar); 70 | static QString print_voltage_threshold(Glib::VariantBase gvar); 71 | static QString print_probe_factor(Glib::VariantBase gvar); 72 | static QString print_averages(Glib::VariantBase gvar); 73 | 74 | protected: 75 | shared_ptr configurable_; 76 | }; 77 | 78 | } // namespace binding 79 | } // namespace pv 80 | 81 | #endif // PULSEVIEW_PV_BINDING_DEVICE_HPP 82 | -------------------------------------------------------------------------------- /pv/binding/inputoutput.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_BINDING_INPUTOUTPUT_HPP 21 | #define PULSEVIEW_PV_BINDING_INPUTOUTPUT_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "binding.hpp" 28 | 29 | #include 30 | 31 | using std::map; 32 | using std::shared_ptr; 33 | using std::string; 34 | using std::vector; 35 | 36 | namespace sigrok { 37 | class Option; 38 | } 39 | 40 | namespace pv { 41 | namespace binding { 42 | 43 | /** 44 | * A binding of glibmm variants for sigrok input and output options. 45 | */ 46 | class InputOutput : public Binding 47 | { 48 | public: 49 | /** 50 | * Constructs a new @c InputOutput binding. 51 | * @param options the map of options to use as a template. 52 | */ 53 | InputOutput(const map> &options); 54 | 55 | /** 56 | * Gets the map of selected options. 57 | * @return the options. 58 | */ 59 | const map& options() const; 60 | 61 | private: 62 | /** 63 | * A helper function to bind an option list to and enum property. 64 | * @param name the name of the property. 65 | * @param name the description of the property. 66 | * @param values the list of values. 67 | * @param getter the getter that will read the values out of the map. 68 | * @param setter the setter that will set the values into the map. 69 | */ 70 | shared_ptr bind_enum(const QString &name, 71 | const QString &desc, const vector &values, 72 | prop::Property::Getter getter, prop::Property::Setter setter); 73 | 74 | private: 75 | /** 76 | * The current map of options. 77 | */ 78 | map options_; 79 | }; 80 | 81 | } // namespace binding 82 | } // namespace pv 83 | 84 | #endif // PULSEVIEW_PV_BINDING_INPUTOUTPUT_HPP 85 | -------------------------------------------------------------------------------- /pv/data/analog.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DATA_ANALOG_HPP 21 | #define PULSEVIEW_PV_DATA_ANALOG_HPP 22 | 23 | #include "signaldata.hpp" 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | #include "pv/data/segment.hpp" 30 | 31 | using std::deque; 32 | using std::shared_ptr; 33 | using std::vector; 34 | 35 | namespace pv { 36 | namespace data { 37 | 38 | class AnalogSegment; 39 | 40 | class Analog : public SignalData 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | Analog(); 46 | 47 | void push_segment(shared_ptr &segment); 48 | 49 | const deque< shared_ptr >& analog_segments() const; 50 | 51 | vector< shared_ptr > segments() const; 52 | 53 | uint32_t get_segment_count() const; 54 | 55 | void clear(); 56 | 57 | void set_samplerate(double value); 58 | 59 | double get_samplerate() const; 60 | 61 | uint64_t max_sample_count() const; 62 | 63 | void notify_samples_added(shared_ptr segment, uint64_t start_sample, 64 | uint64_t end_sample); 65 | 66 | void notify_min_max_changed(float min, float max); 67 | 68 | Q_SIGNALS: 69 | void samples_cleared(); 70 | 71 | void samples_added(SharedPtrToSegment segment, uint64_t start_sample, 72 | uint64_t end_sample); 73 | 74 | void min_max_changed(float min, float max); 75 | 76 | private Q_SLOTS: 77 | void on_segment_completed(); 78 | 79 | private: 80 | double samplerate_; 81 | deque< shared_ptr > segments_; 82 | }; 83 | 84 | } // namespace data 85 | } // namespace pv 86 | 87 | #endif // PULSEVIEW_PV_DATA_ANALOG_HPP 88 | -------------------------------------------------------------------------------- /pv/data/decode/annotation.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DATA_DECODE_ANNOTATION_HPP 21 | #define PULSEVIEW_PV_DATA_DECODE_ANNOTATION_HPP 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include "pv/data/decode/row.hpp" 30 | 31 | using std::vector; 32 | 33 | struct srd_proto_data; 34 | 35 | namespace pv { 36 | namespace data { 37 | namespace decode { 38 | 39 | class RowData; 40 | 41 | class Annotation 42 | { 43 | public: 44 | Annotation(uint64_t start_sample, uint64_t end_sample, 45 | const vector* texts, uint32_t ann_class_id, const RowData *data); 46 | Annotation(Annotation&& a); 47 | Annotation& operator=(Annotation&& a); 48 | 49 | const RowData* row_data() const; 50 | const Row* row() const; 51 | 52 | uint64_t start_sample() const; 53 | uint64_t end_sample() const; 54 | uint64_t length() const; 55 | 56 | uint32_t ann_class_id() const; 57 | const QString ann_class_name() const; 58 | const QString ann_class_description() const; 59 | 60 | const vector* annotations() const; 61 | const QString longest_annotation() const; 62 | 63 | bool visible() const; 64 | 65 | const QColor color() const; 66 | const QColor bright_color() const; 67 | const QColor dark_color() const; 68 | 69 | bool operator<(const Annotation &other) const; 70 | 71 | private: 72 | uint64_t start_sample_; 73 | uint64_t end_sample_; 74 | const vector* texts_; 75 | uint32_t ann_class_id_; 76 | const RowData* data_; 77 | }; 78 | 79 | } // namespace decode 80 | } // namespace data 81 | } // namespace pv 82 | 83 | #endif // PULSEVIEW_PV_DATA_DECODE_ANNOTATION_HPP 84 | -------------------------------------------------------------------------------- /pv/data/decode/rowdata.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DATA_DECODE_ROWDATA_HPP 21 | #define PULSEVIEW_PV_DATA_DECODE_ROWDATA_HPP 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | #include 33 | 34 | using std::deque; 35 | using std::unordered_map; 36 | 37 | #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) 38 | namespace std { 39 | template<> struct hash { 40 | std::size_t operator()(const QString& s) const noexcept { 41 | return (size_t) qHash(s); 42 | } 43 | }; 44 | } 45 | #endif 46 | 47 | namespace pv { 48 | namespace data { 49 | namespace decode { 50 | 51 | class Row; 52 | 53 | class RowData 54 | { 55 | public: 56 | RowData(Row* row); 57 | 58 | const Row* row() const; 59 | 60 | uint64_t get_max_sample() const; 61 | 62 | uint64_t get_annotation_count() const; 63 | 64 | /** 65 | * Extracts annotations between the given sample range into a vector. 66 | * Note: The annotations are unsorted and only annotations that fully 67 | * fit into the sample range are considered. 68 | */ 69 | void get_annotation_subset(deque &dest, 70 | uint64_t start_sample, uint64_t end_sample) const; 71 | 72 | const deque& annotations() const; 73 | 74 | const Annotation* emplace_annotation(srd_proto_data *pdata); 75 | 76 | private: 77 | deque annotations_; 78 | unordered_map > ann_texts_; // unordered_map since pointers must not change 79 | Row* row_; 80 | uint64_t prev_ann_start_sample_; 81 | }; 82 | 83 | } // namespace decode 84 | } // namespace data 85 | } // namespace pv 86 | 87 | #endif // PULSEVIEW_PV_DATA_DECODE_ROWDATA_HPP 88 | -------------------------------------------------------------------------------- /pv/data/logic.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DATA_LOGIC_HPP 21 | #define PULSEVIEW_PV_DATA_LOGIC_HPP 22 | 23 | #include "signaldata.hpp" 24 | #include "segment.hpp" 25 | 26 | #include 27 | 28 | #include 29 | 30 | using std::deque; 31 | using std::shared_ptr; 32 | using std::vector; 33 | 34 | namespace pv { 35 | namespace data { 36 | 37 | class LogicSegment; 38 | 39 | class Logic : public SignalData 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | Logic(unsigned int num_channels); 45 | 46 | unsigned int num_channels() const; 47 | 48 | void push_segment(shared_ptr &segment); 49 | 50 | const deque< shared_ptr >& logic_segments() const; 51 | deque< shared_ptr >& logic_segments(); 52 | 53 | vector< shared_ptr > segments() const; 54 | 55 | uint32_t get_segment_count() const; 56 | 57 | void clear(); 58 | 59 | void set_samplerate(double value); 60 | 61 | double get_samplerate() const; 62 | 63 | uint64_t max_sample_count() const; 64 | 65 | void notify_samples_added(shared_ptr segment, uint64_t start_sample, 66 | uint64_t end_sample); 67 | 68 | Q_SIGNALS: 69 | void samples_cleared(); 70 | 71 | void samples_added(SharedPtrToSegment segment, uint64_t start_sample, 72 | uint64_t end_sample); 73 | 74 | private Q_SLOTS: 75 | void on_segment_completed(); 76 | 77 | private: 78 | double samplerate_; 79 | const unsigned int num_channels_; 80 | deque< shared_ptr > segments_; 81 | }; 82 | 83 | } // namespace data 84 | } // namespace pv 85 | 86 | #endif // PULSEVIEW_PV_DATA_LOGIC_HPP 87 | -------------------------------------------------------------------------------- /pv/data/signaldata.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "signaldata.hpp" 21 | 22 | namespace pv { 23 | namespace data { 24 | 25 | } // namespace data 26 | } // namespace pv 27 | -------------------------------------------------------------------------------- /pv/data/signaldata.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DATA_SIGNALDATA_HPP 21 | #define PULSEVIEW_PV_DATA_SIGNALDATA_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | using std::shared_ptr; 30 | using std::vector; 31 | 32 | namespace pv { 33 | namespace data { 34 | 35 | class Segment; 36 | 37 | class SignalData : public QObject 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | SignalData() = default; 43 | virtual ~SignalData() = default; 44 | 45 | public: 46 | virtual vector< shared_ptr > segments() const = 0; 47 | 48 | virtual uint32_t get_segment_count() const = 0; 49 | 50 | virtual void clear() = 0; 51 | 52 | virtual uint64_t max_sample_count() const = 0; 53 | 54 | virtual void set_samplerate(double value) = 0; 55 | 56 | virtual double get_samplerate() const = 0; 57 | 58 | Q_SIGNALS: 59 | void segment_completed(); 60 | }; 61 | 62 | } // namespace data 63 | } // namespace pv 64 | 65 | #endif // PULSEVIEW_PV_DATA_SIGNALDATA_HPP 66 | -------------------------------------------------------------------------------- /pv/devices/device.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DEVICES_DEVICE_HPP 21 | #define PULSEVIEW_PV_DEVICES_DEVICE_HPP 22 | 23 | #include 24 | #include 25 | 26 | using std::shared_ptr; 27 | using std::string; 28 | 29 | namespace sigrok { 30 | class ConfigKey; 31 | class Device; 32 | class Session; 33 | } // namespace sigrok 34 | 35 | namespace pv { 36 | 37 | class DeviceManager; 38 | 39 | namespace devices { 40 | 41 | class Device 42 | { 43 | protected: 44 | Device() = default; 45 | 46 | public: 47 | virtual ~Device(); 48 | 49 | shared_ptr session() const; 50 | 51 | shared_ptr device() const; 52 | 53 | template 54 | T read_config(const sigrok::ConfigKey *key, const T default_value = 0); 55 | 56 | /** 57 | * Builds the full name. It only contains all the fields. 58 | */ 59 | virtual string full_name() const = 0; 60 | 61 | /** 62 | * Builds the display name. It only contains fields as required. 63 | * @param device_manager a reference to the device manager is needed 64 | * so that other similarly titled devices can be detected. 65 | */ 66 | virtual string display_name( 67 | const DeviceManager &device_manager) const = 0; 68 | 69 | virtual void open() = 0; 70 | 71 | virtual void close() = 0; 72 | 73 | virtual void start(); 74 | 75 | virtual void run(); 76 | 77 | virtual void stop(); 78 | 79 | protected: 80 | shared_ptr session_; 81 | shared_ptr device_; 82 | }; 83 | 84 | } // namespace devices 85 | } // namespace pv 86 | 87 | #endif // PULSEVIEW_PV_DEVICES_DEVICE_HPP 88 | -------------------------------------------------------------------------------- /pv/devices/file.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include "file.hpp" 23 | 24 | using std::string; 25 | 26 | namespace pv { 27 | namespace devices { 28 | 29 | File::File(const string &file_name) : 30 | file_name_(file_name) 31 | { 32 | } 33 | 34 | string File::full_name() const 35 | { 36 | return file_name_; 37 | } 38 | 39 | string File::display_name(const DeviceManager&) const 40 | { 41 | return boost::filesystem::path(file_name_).filename().string(); 42 | } 43 | 44 | } // namespace devices 45 | } // namespace pv 46 | -------------------------------------------------------------------------------- /pv/devices/file.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DEVICES_FILE_HPP 21 | #define PULSEVIEW_PV_DEVICES_FILE_HPP 22 | 23 | #include 24 | 25 | #include "device.hpp" 26 | 27 | using std::string; 28 | 29 | namespace pv { 30 | namespace devices { 31 | 32 | class File : public Device 33 | { 34 | protected: 35 | File(const string &file_name); 36 | 37 | public: 38 | /** 39 | * Builds the full name. It contains all the fields. 40 | */ 41 | string full_name() const; 42 | 43 | /** 44 | * Builds the display name. It only contains fields as required. 45 | */ 46 | string display_name(const DeviceManager&) const; 47 | 48 | protected: 49 | string file_name_; 50 | }; 51 | 52 | } // namespace devices 53 | } // namespace pv 54 | 55 | #endif // PULSEVIEW_PV_DEVICES_FILE_HPP 56 | -------------------------------------------------------------------------------- /pv/devices/hardwaredevice.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DEVICES_HARDWAREDEVICE_HPP 21 | #define PULSEVIEW_PV_DEVICES_HARDWAREDEVICE_HPP 22 | 23 | #include "device.hpp" 24 | 25 | using std::shared_ptr; 26 | using std::string; 27 | 28 | namespace sigrok { 29 | class Context; 30 | class HardwareDevice; 31 | } // sigrok 32 | 33 | namespace pv { 34 | namespace devices { 35 | 36 | class HardwareDevice final : public Device 37 | { 38 | public: 39 | HardwareDevice(const shared_ptr &context, 40 | shared_ptr device); 41 | 42 | ~HardwareDevice(); 43 | 44 | shared_ptr hardware_device() const; 45 | 46 | /** 47 | * Builds the full name. It only contains all the fields. 48 | */ 49 | string full_name() const; 50 | 51 | /** 52 | * Builds the display name. It only contains fields as required. 53 | * @param device_manager a reference to the device manager is needed 54 | * so that other similarly titled devices can be detected. 55 | */ 56 | string display_name(const DeviceManager &device_manager) const; 57 | 58 | void open(); 59 | 60 | void close(); 61 | 62 | private: 63 | const shared_ptr context_; 64 | bool device_open_; 65 | }; 66 | 67 | } // namespace devices 68 | } // namespace pv 69 | 70 | #endif // PULSEVIEW_PV_DEVICES_HARDWAREDEVICE_HPP 71 | -------------------------------------------------------------------------------- /pv/devices/inputfile.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DEVICES_INPUTFILE_HPP 21 | #define PULSEVIEW_PV_DEVICES_INPUTFILE_HPP 22 | 23 | #include 24 | 25 | #include 26 | 27 | #include "file.hpp" 28 | 29 | #include 30 | 31 | using std::atomic; 32 | using std::ifstream; 33 | using std::map; 34 | using std::shared_ptr; 35 | using std::streamsize; 36 | using std::string; 37 | 38 | namespace pv { 39 | namespace devices { 40 | 41 | class InputFile final : public File 42 | { 43 | private: 44 | static const streamsize BufferSize; 45 | 46 | public: 47 | InputFile(const shared_ptr &context, 48 | const string &file_name, 49 | shared_ptr format, 50 | const map &options); 51 | 52 | /** 53 | * Constructor that loads a file using the metadata saved by 54 | * save_meta_to_settings() before. 55 | */ 56 | InputFile(const shared_ptr &context, 57 | QSettings &settings); 58 | 59 | void save_meta_to_settings(QSettings &settings); 60 | 61 | void open(); 62 | 63 | void close(); 64 | 65 | void start(); 66 | 67 | void run(); 68 | 69 | void stop(); 70 | 71 | private: 72 | const shared_ptr context_; 73 | shared_ptr format_; 74 | map options_; 75 | shared_ptr input_; 76 | 77 | ifstream *f; 78 | atomic interrupt_; 79 | }; 80 | 81 | } // namespace devices 82 | } // namespace pv 83 | 84 | #endif // PULSEVIEW_PV_DEVICES_INPUTFILE_HPP 85 | 86 | -------------------------------------------------------------------------------- /pv/devices/sessionfile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include "sessionfile.hpp" 25 | 26 | using std::shared_ptr; 27 | using std::string; 28 | 29 | namespace pv { 30 | namespace devices { 31 | 32 | SessionFile::SessionFile(const shared_ptr context, 33 | const string &file_name) : 34 | File(file_name), 35 | context_(context) 36 | { 37 | } 38 | 39 | void SessionFile::open() 40 | { 41 | if (session_) 42 | close(); 43 | 44 | session_ = context_->load_session(file_name_); 45 | device_ = session_->devices()[0]; 46 | } 47 | 48 | void SessionFile::close() 49 | { 50 | if (session_) 51 | session_->remove_devices(); 52 | } 53 | 54 | } // namespace devices 55 | } // namespace pv 56 | -------------------------------------------------------------------------------- /pv/devices/sessionfile.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DEVICES_SESSIONFILE_HPP 21 | #define PULSEVIEW_PV_DEVICES_SESSIONFILE_HPP 22 | 23 | #include 24 | 25 | #include "file.hpp" 26 | 27 | using std::shared_ptr; 28 | using std::string; 29 | 30 | namespace sigrok { 31 | class Context; 32 | } // sigrok 33 | 34 | namespace pv { 35 | namespace devices { 36 | 37 | class SessionFile final : public File 38 | { 39 | public: 40 | SessionFile(const shared_ptr context, 41 | const string &file_name); 42 | 43 | void open(); 44 | 45 | void close(); 46 | 47 | private: 48 | const shared_ptr context_; 49 | }; 50 | 51 | } // namespace devices 52 | } // namespace pv 53 | 54 | #endif // PULSEVIEW_PV_DEVICES_SESSIONFILE_HPP 55 | -------------------------------------------------------------------------------- /pv/dialogs/inputoutputoptions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "inputoutputoptions.hpp" 21 | 22 | #include 23 | 24 | using std::map; 25 | using std::shared_ptr; 26 | using std::string; 27 | 28 | using Glib::VariantBase; 29 | 30 | using sigrok::Option; 31 | 32 | namespace pv { 33 | namespace dialogs { 34 | 35 | InputOutputOptions::InputOutputOptions(const QString &title, 36 | const map> &options, QWidget *parent) : 37 | QDialog(parent), 38 | layout_(this), 39 | button_box_(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, 40 | Qt::Horizontal, this), 41 | binding_(options) 42 | { 43 | setWindowTitle(title); 44 | 45 | connect(&button_box_, SIGNAL(accepted()), this, SLOT(accept())); 46 | connect(&button_box_, SIGNAL(rejected()), this, SLOT(reject())); 47 | 48 | setLayout(&layout_); 49 | 50 | layout_.addWidget(binding_.get_property_form(this)); 51 | layout_.addWidget(&button_box_); 52 | } 53 | 54 | const map& InputOutputOptions::options() const 55 | { 56 | return binding_.options(); 57 | } 58 | 59 | void InputOutputOptions::accept() 60 | { 61 | QDialog::accept(); 62 | 63 | // Commit the properties 64 | binding_.commit(); 65 | } 66 | 67 | } // namespace dialogs 68 | } // namespace pv 69 | -------------------------------------------------------------------------------- /pv/dialogs/inputoutputoptions.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DIALOGS_INPUTOUTPUTOPTIONS_HPP 21 | #define PULSEVIEW_PV_DIALOGS_INPUTOUTPUTOPTIONS_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | using std::map; 31 | using std::shared_ptr; 32 | using std::string; 33 | 34 | namespace pv { 35 | namespace dialogs { 36 | 37 | /** 38 | * Presents the selection of inpout/output options to the user. 39 | */ 40 | class InputOutputOptions : public QDialog 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | /** 46 | * Constructor. 47 | * @param title the title of the dialog. 48 | * @param options the map of options to use as a template. 49 | * @param parent the parent widget of the dialog. 50 | */ 51 | InputOutputOptions(const QString &title, 52 | const map> &options, 53 | QWidget *parent); 54 | 55 | /** 56 | * Gets the map of selected options. 57 | * @return the options. 58 | */ 59 | const map& options() const; 60 | 61 | protected: 62 | void accept(); 63 | 64 | private: 65 | QVBoxLayout layout_; 66 | QDialogButtonBox button_box_; 67 | pv::binding::InputOutput binding_; 68 | }; 69 | 70 | } // namespace dialogs 71 | } // namespace pv 72 | 73 | #endif // PULSEVIEW_PV_DIALOGS_INPUTOUTPUTOPTIONS_HPP 74 | -------------------------------------------------------------------------------- /pv/dialogs/storeprogress.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_DIALOGS_STOREPROGRESS_HPP 21 | #define PULSEVIEW_PV_DIALOGS_STOREPROGRESS_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | using std::atomic; 32 | using std::map; 33 | using std::pair; 34 | using std::shared_ptr; 35 | using std::string; 36 | 37 | namespace pv { 38 | 39 | class Session; 40 | 41 | namespace dialogs { 42 | 43 | class StoreProgress : public QProgressDialog 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | StoreProgress(const QString &file_name, 49 | const shared_ptr output_format, 50 | const map &options, 51 | const pair sample_range, 52 | const Session &session, QWidget *parent = nullptr); 53 | 54 | virtual ~StoreProgress(); 55 | 56 | void run(); 57 | 58 | private: 59 | void show_error(); 60 | 61 | void closeEvent(QCloseEvent*); 62 | 63 | private Q_SLOTS: 64 | void on_progress_updated(); 65 | void on_cancel(); 66 | 67 | private: 68 | pv::StoreSession session_; 69 | atomic showing_error_; 70 | }; 71 | 72 | } // namespace dialogs 73 | } // namespace pv 74 | 75 | #endif // PULSEVIEW_PV_DIALOGS_STOREPROGRESS_HPP 76 | -------------------------------------------------------------------------------- /pv/logging.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2018 Soeren Apel 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_LOGGING_HPP 21 | #define PULSEVIEW_PV_LOGGING_HPP 22 | 23 | #include "globalsettings.hpp" 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | using std::mutex; 33 | 34 | namespace pv { 35 | 36 | class Logging : public QObject, public GlobalSettingsInterface 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | enum LogSource { 42 | LogSource_pv, 43 | LogSource_sr, 44 | LogSource_srd 45 | }; 46 | 47 | static const int MIN_BUFFER_SIZE; 48 | static const int MAX_BUFFER_SIZE; 49 | 50 | public: 51 | ~Logging(); 52 | void init(); 53 | 54 | int get_log_level() const; 55 | void set_log_level(int level); 56 | 57 | QString get_log() const; 58 | 59 | void log(const QString &text, int source); 60 | 61 | static void log_pv(QtMsgType type, const QMessageLogContext &context, const QString &msg); 62 | 63 | static int log_sr(void *cb_data, int loglevel, const char *format, va_list args); 64 | 65 | #ifdef ENABLE_DECODE 66 | static int log_srd(void *cb_data, int loglevel, const char *format, va_list args); 67 | #endif 68 | 69 | private: 70 | void on_setting_changed(const QString &key, const QVariant &value); 71 | 72 | Q_SIGNALS: 73 | void logged_text(QString s); 74 | 75 | private: 76 | int buffer_size_; 77 | QStringList buffer_; 78 | mutable mutex log_mutex_; 79 | }; 80 | 81 | extern Logging logging; 82 | 83 | } // namespace pv 84 | 85 | #endif // PULSEVIEW_PV_LOGGING_HPP 86 | -------------------------------------------------------------------------------- /pv/popups/deviceoptions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "deviceoptions.hpp" 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | #include 28 | 29 | using std::shared_ptr; 30 | 31 | using sigrok::Device; 32 | 33 | namespace pv { 34 | namespace popups { 35 | 36 | DeviceOptions::DeviceOptions(shared_ptr device, QWidget *parent) : 37 | Popup(parent), 38 | device_(device), 39 | layout_(this), 40 | binding_(device) 41 | { 42 | setLayout(&layout_); 43 | 44 | layout_.addWidget(binding_.get_property_form(this, true)); 45 | } 46 | 47 | pv::binding::Device& DeviceOptions::binding() 48 | { 49 | return binding_; 50 | } 51 | 52 | void DeviceOptions::show() 53 | { 54 | // Update device config widgets with the current values supplied by the 55 | // driver before actually showing the popup dialog 56 | binding_.update_property_widgets(); 57 | 58 | Popup::show(); 59 | } 60 | 61 | } // namespace popups 62 | } // namespace pv 63 | -------------------------------------------------------------------------------- /pv/popups/deviceoptions.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_HPP 21 | #define PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_HPP 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | using std::shared_ptr; 30 | 31 | namespace sigrok { 32 | class Device; 33 | } 34 | 35 | namespace pv { 36 | namespace popups { 37 | 38 | class DeviceOptions : public pv::widgets::Popup 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | DeviceOptions(shared_ptr device, QWidget *parent); 44 | 45 | pv::binding::Device& binding(); 46 | 47 | virtual void show(); 48 | 49 | private: 50 | shared_ptr device_; 51 | 52 | QVBoxLayout layout_; 53 | 54 | pv::binding::Device binding_; 55 | }; 56 | 57 | } // namespace popups 58 | } // namespace pv 59 | 60 | #endif // PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_HPP 61 | -------------------------------------------------------------------------------- /pv/prop/bool.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_PROP_BOOL_HPP 21 | #define PULSEVIEW_PV_PROP_BOOL_HPP 22 | 23 | #include "property.hpp" 24 | 25 | class QCheckBox; 26 | 27 | namespace pv { 28 | namespace prop { 29 | 30 | class Bool : public Property 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | Bool(QString name, QString desc, Getter getter, Setter setter); 36 | 37 | virtual ~Bool() = default; 38 | 39 | QWidget* get_widget(QWidget *parent, bool auto_commit); 40 | bool labeled_widget() const; 41 | void update_widget(); 42 | 43 | void commit(); 44 | 45 | private Q_SLOTS: 46 | void on_state_changed(int); 47 | 48 | private: 49 | QCheckBox *check_box_; 50 | }; 51 | 52 | } // namespace prop 53 | } // namespace pv 54 | 55 | #endif // PULSEVIEW_PV_PROP_BOOL_HPP 56 | -------------------------------------------------------------------------------- /pv/prop/double.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_PROP_DOUBLE_HPP 21 | #define PULSEVIEW_PV_PROP_DOUBLE_HPP 22 | 23 | #include 24 | 25 | #include 26 | 27 | #include "property.hpp" 28 | 29 | using std::pair; 30 | 31 | class QDoubleSpinBox; 32 | 33 | namespace pv { 34 | namespace prop { 35 | 36 | class Double : public Property 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | Double(QString name, QString desc, int decimals, QString suffix, 42 | boost::optional< pair > range, 43 | boost::optional step, 44 | Getter getter, 45 | Setter setter); 46 | 47 | virtual ~Double() = default; 48 | 49 | QWidget* get_widget(QWidget *parent, bool auto_commit); 50 | void update_widget(); 51 | 52 | void commit(); 53 | 54 | private Q_SLOTS: 55 | void on_value_changed(double); 56 | 57 | private: 58 | const int decimals_; 59 | const QString suffix_; 60 | const boost::optional< pair > range_; 61 | const boost::optional step_; 62 | 63 | QDoubleSpinBox *spin_box_; 64 | }; 65 | 66 | } // namespace prop 67 | } // namespace pv 68 | 69 | #endif // PULSEVIEW_PV_PROP_DOUBLE_HPP 70 | -------------------------------------------------------------------------------- /pv/prop/enum.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_PROP_ENUM_HPP 21 | #define PULSEVIEW_PV_PROP_ENUM_HPP 22 | 23 | #include 24 | #include 25 | 26 | #include "property.hpp" 27 | 28 | #include 29 | 30 | using std::pair; 31 | using std::vector; 32 | 33 | Q_DECLARE_METATYPE(Glib::VariantBase); 34 | 35 | class QComboBox; 36 | class QLabel; 37 | class QSlider; 38 | 39 | namespace pv { 40 | namespace prop { 41 | 42 | class Enum : public Property 43 | { 44 | Q_OBJECT 45 | 46 | public: 47 | Enum(QString name, QString desc, 48 | vector > values, 49 | Getter getter, Setter setter); 50 | 51 | virtual ~Enum() = default; 52 | 53 | QWidget* get_widget(QWidget *parent, bool auto_commit); 54 | void update_widget(); 55 | 56 | void commit(); 57 | 58 | private Q_SLOTS: 59 | void on_current_index_changed(int); 60 | void on_value_changed(int); 61 | 62 | private: 63 | const vector< pair > values_; 64 | bool is_range_; 65 | 66 | QComboBox *selector_; 67 | 68 | QWidget *slider_layout_widget_; 69 | QSlider *slider_; 70 | QLabel *slider_label_; 71 | }; 72 | 73 | } // namespace prop 74 | } // namespace pv 75 | 76 | #endif // PULSEVIEW_PV_PROP_ENUM_HPP 77 | -------------------------------------------------------------------------------- /pv/prop/int.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_PROP_INT_HPP 21 | #define PULSEVIEW_PV_PROP_INT_HPP 22 | 23 | #include 24 | 25 | #include 26 | 27 | #include "property.hpp" 28 | 29 | using std::pair; 30 | 31 | class QSpinBox; 32 | 33 | namespace pv { 34 | namespace prop { 35 | 36 | class Int : public Property 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | Int(QString name, QString desc, QString suffix, 42 | boost::optional< pair > range, 43 | Getter getter, Setter setter, QString special_value_text = ""); 44 | 45 | virtual ~Int() = default; 46 | 47 | QWidget* get_widget(QWidget *parent, bool auto_commit); 48 | void update_widget(); 49 | 50 | void commit(); 51 | 52 | private Q_SLOTS: 53 | void on_value_changed(int); 54 | 55 | private: 56 | const QString suffix_, special_value_text_; 57 | const boost::optional< pair > range_; 58 | 59 | Glib::VariantBase value_; 60 | QSpinBox *spin_box_; 61 | }; 62 | 63 | } // namespace prop 64 | } // namespace pv 65 | 66 | #endif // PULSEVIEW_PV_PROP_INT_HPP 67 | -------------------------------------------------------------------------------- /pv/prop/property.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "property.hpp" 21 | 22 | namespace pv { 23 | namespace prop { 24 | 25 | Property::Property(QString name, QString desc, Getter getter, Setter setter) : 26 | getter_(getter), 27 | setter_(setter), 28 | name_(name), 29 | desc_(desc) 30 | { 31 | } 32 | 33 | const QString& Property::name() const 34 | { 35 | return name_; 36 | } 37 | 38 | const QString& Property::desc() const 39 | { 40 | return desc_; 41 | } 42 | 43 | bool Property::labeled_widget() const 44 | { 45 | return false; 46 | } 47 | 48 | } // namespace prop 49 | } // namespace pv 50 | -------------------------------------------------------------------------------- /pv/prop/property.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_PROP_PROPERTY_HPP 21 | #define PULSEVIEW_PV_PROP_PROPERTY_HPP 22 | 23 | #include 24 | // Suppress warnings due to use of deprecated std::auto_ptr<> by glibmm. 25 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS 26 | #include 27 | G_GNUC_END_IGNORE_DEPRECATIONS 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | using std::function; 35 | 36 | class QWidget; 37 | 38 | namespace pv { 39 | namespace prop { 40 | 41 | class Property : public QObject 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | typedef function Getter; 47 | typedef function Setter; 48 | 49 | protected: 50 | Property(QString name, QString desc, Getter getter, Setter setter); 51 | 52 | public: 53 | const QString& name() const; 54 | const QString& desc() const; 55 | 56 | virtual QWidget* get_widget(QWidget *parent, bool auto_commit = false) = 0; 57 | virtual bool labeled_widget() const; 58 | virtual void update_widget() = 0; 59 | 60 | virtual void commit() = 0; 61 | 62 | protected: 63 | const Getter getter_; 64 | const Setter setter_; 65 | 66 | protected: 67 | QString name_; 68 | QString desc_; 69 | }; 70 | 71 | } // namespace prop 72 | } // namespace pv 73 | 74 | #endif // PULSEVIEW_PV_PROP_PROPERTY_HPP 75 | -------------------------------------------------------------------------------- /pv/prop/string.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_PROP_STRING_HPP 21 | #define PULSEVIEW_PV_PROP_STRING_HPP 22 | 23 | #include "property.hpp" 24 | 25 | class QLineEdit; 26 | 27 | namespace pv { 28 | namespace prop { 29 | 30 | class String : public Property 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | String(QString name, QString desc, Getter getter, Setter setter); 36 | 37 | QWidget* get_widget(QWidget *parent, bool auto_commit); 38 | void update_widget(); 39 | 40 | void commit(); 41 | 42 | private Q_SLOTS: 43 | void on_text_edited(const QString&); 44 | 45 | private: 46 | QLineEdit *line_edit_; 47 | }; 48 | 49 | } // namespace prop 50 | } // namespace pv 51 | 52 | #endif // PULSEVIEW_PV_PROP_STRING_HPP 53 | -------------------------------------------------------------------------------- /pv/subwindows/decoder_selector/item.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2018 Soeren Apel 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "subwindow.hpp" 21 | 22 | using std::out_of_range; 23 | 24 | namespace pv { 25 | namespace subwindows { 26 | namespace decoder_selector { 27 | 28 | DecoderCollectionItem::DecoderCollectionItem(const vector& data, 29 | shared_ptr parent) : 30 | data_(data), 31 | parent_(parent) 32 | { 33 | } 34 | 35 | void DecoderCollectionItem::appendSubItem(shared_ptr item) 36 | { 37 | subItems_.push_back(item); 38 | } 39 | 40 | shared_ptr DecoderCollectionItem::subItem(int row) const 41 | { 42 | try { 43 | return subItems_.at(row); 44 | } catch (out_of_range&) { 45 | return nullptr; 46 | } 47 | } 48 | 49 | shared_ptr DecoderCollectionItem::parent() const 50 | { 51 | return parent_; 52 | } 53 | 54 | shared_ptr DecoderCollectionItem::findSubItem( 55 | const QVariant& value, int column) 56 | { 57 | for (shared_ptr item : subItems_) 58 | if (item->data(column) == value) 59 | return item; 60 | 61 | return nullptr; 62 | } 63 | 64 | int DecoderCollectionItem::subItemCount() const 65 | { 66 | return subItems_.size(); 67 | } 68 | 69 | int DecoderCollectionItem::columnCount() const 70 | { 71 | return data_.size(); 72 | } 73 | 74 | int DecoderCollectionItem::row() const 75 | { 76 | if (parent_) 77 | for (size_t i = 0; i < parent_->subItems_.size(); i++) 78 | if (parent_->subItems_.at(i).get() == const_cast(this)) 79 | return i; 80 | 81 | return 0; 82 | } 83 | 84 | QVariant DecoderCollectionItem::data(int column) const 85 | { 86 | try { 87 | return data_.at(column); 88 | } catch (out_of_range&) { 89 | return QVariant(); 90 | } 91 | } 92 | 93 | } // namespace decoder_selector 94 | } // namespace subwindows 95 | } // namespace pv 96 | -------------------------------------------------------------------------------- /pv/subwindows/subwindowbase.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2018 Soeren Apel 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_SUBWINDOWS_SUBWINDOWBASE_HPP 21 | #define PULSEVIEW_PV_SUBWINDOWS_SUBWINDOWBASE_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | #ifdef ENABLE_DECODE 33 | #include 34 | #endif 35 | 36 | using std::shared_ptr; 37 | using std::unordered_set; 38 | 39 | namespace pv { 40 | 41 | class Session; 42 | 43 | namespace subwindows { 44 | 45 | enum SubWindowType { 46 | SubWindowTypeDecoderSelector, 47 | }; 48 | 49 | class SubWindowBase : public QWidget 50 | { 51 | Q_OBJECT 52 | 53 | public: 54 | explicit SubWindowBase(Session &session, QWidget *parent = nullptr); 55 | 56 | virtual bool has_toolbar() const; 57 | virtual QToolBar* create_toolbar(QWidget *parent) const; 58 | 59 | Session& session(); 60 | const Session& session() const; 61 | 62 | /** 63 | * Returns the signal bases contained in this view. 64 | */ 65 | unordered_set< shared_ptr > signalbases() const; 66 | 67 | virtual void clear_signalbases(); 68 | 69 | virtual void add_signalbase(const shared_ptr signalbase); 70 | 71 | #ifdef ENABLE_DECODE 72 | virtual void clear_decode_signals(); 73 | 74 | virtual void add_decode_signal(shared_ptr signal); 75 | 76 | virtual void remove_decode_signal(shared_ptr signal); 77 | #endif 78 | 79 | virtual int minimum_width() const; 80 | 81 | public Q_SLOTS: 82 | virtual void on_signals_changed(); 83 | 84 | protected: 85 | Session &session_; 86 | 87 | unordered_set< shared_ptr > signalbases_; 88 | }; 89 | 90 | } // namespace subwindows 91 | } // namespace pv 92 | 93 | #endif // PULSEVIEW_PV_SUBWINDOWS_SUBWINDOWBASE_HPP 94 | -------------------------------------------------------------------------------- /pv/views/trace/cursor.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_VIEWS_TRACE_CURSOR_HPP 21 | #define PULSEVIEW_PV_VIEWS_TRACE_CURSOR_HPP 22 | 23 | #include "timemarker.hpp" 24 | 25 | #include 26 | 27 | #include 28 | 29 | using std::shared_ptr; 30 | 31 | class QPainter; 32 | 33 | namespace pv { 34 | namespace views { 35 | namespace trace { 36 | 37 | class Cursor : public TimeMarker 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | static const QColor FillColor; 43 | 44 | public: 45 | /** 46 | * Constructor. 47 | * @param view A reference to the view that owns this cursor pair. 48 | * @param time The time to set the flag to. 49 | */ 50 | Cursor(View &view, double time); 51 | 52 | public: 53 | /** 54 | * Returns true if the item is visible and enabled. 55 | */ 56 | virtual bool enabled() const override; 57 | 58 | /** 59 | * Gets the text to show in the marker. 60 | */ 61 | virtual QString get_text() const override; 62 | 63 | /** 64 | * Gets the marker label rectangle. 65 | * @param rect The rectangle of the ruler client area. 66 | * @return Returns the label rectangle. 67 | */ 68 | virtual QRectF label_rect(const QRectF &rect) const override; 69 | 70 | virtual QMenu* create_header_context_menu(QWidget *parent) override; 71 | 72 | private: 73 | shared_ptr get_other_cursor() const; 74 | }; 75 | 76 | } // namespace trace 77 | } // namespace views 78 | } // namespace pv 79 | 80 | #endif // PULSEVIEW_PV_VIEWS_TRACE_CURSOR_HPP 81 | -------------------------------------------------------------------------------- /pv/views/trace/header.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_VIEWS_TRACE_HEADER_HPP 21 | #define PULSEVIEW_PV_VIEWS_TRACE_HEADER_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "marginwidget.hpp" 28 | 29 | using std::shared_ptr; 30 | using std::vector; 31 | 32 | namespace pv { 33 | namespace views { 34 | namespace trace { 35 | 36 | class TraceTreeItem; 37 | class View; 38 | class ViewItem; 39 | 40 | /** 41 | * The Header class provides an area for @ref Trace labels to be shown, 42 | * trace-related settings to be edited, trace groups to be shown and similar. 43 | * Essentially, it is the main management area of the @ref View itself and 44 | * shown on the left-hand side of the trace area. 45 | */ 46 | class Header : public MarginWidget 47 | { 48 | Q_OBJECT 49 | 50 | private: 51 | static const int Padding; 52 | 53 | public: 54 | Header(View &parent); 55 | 56 | QSize sizeHint() const; 57 | 58 | /** 59 | * The extended area that the header widget would like to be sized to. 60 | * @remarks This area is the area specified by sizeHint, extended by 61 | * the area to overlap the viewport. 62 | */ 63 | QSize extended_size_hint() const; 64 | 65 | private: 66 | /** 67 | * Gets the row items. 68 | */ 69 | vector< shared_ptr > items(); 70 | 71 | /** 72 | * Gets the first view item which has a label that contains @c pt . 73 | * @param pt the point to search with. 74 | * @return the view item that has been found, or and empty 75 | * @c shared_ptr if no item was found. 76 | */ 77 | shared_ptr get_mouse_over_item(const QPoint &pt); 78 | 79 | private: 80 | void paintEvent(QPaintEvent *event); 81 | 82 | private: 83 | void contextMenuEvent(QContextMenuEvent *event); 84 | 85 | void keyPressEvent(QKeyEvent *event); 86 | 87 | private Q_SLOTS: 88 | void on_group(); 89 | 90 | void on_ungroup(); 91 | }; 92 | 93 | } // namespace trace 94 | } // namespace views 95 | } // namespace pv 96 | 97 | #endif // PULSEVIEW_PV_VIEWS_TRACE_HEADER_HPP 98 | -------------------------------------------------------------------------------- /pv/views/trace/marginwidget.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "view.hpp" 24 | 25 | #include "marginwidget.hpp" 26 | 27 | #include 28 | 29 | using std::shared_ptr; 30 | 31 | namespace pv { 32 | namespace views { 33 | namespace trace { 34 | 35 | MarginWidget::MarginWidget(View &parent) : 36 | ViewWidget(parent) 37 | { 38 | setAttribute(Qt::WA_NoSystemBackground, true); 39 | } 40 | 41 | void MarginWidget::item_clicked(const shared_ptr &item) 42 | { 43 | if (item && item->enabled()) 44 | show_popup(item); 45 | } 46 | 47 | void MarginWidget::show_popup(const shared_ptr &item) 48 | { 49 | pv::widgets::Popup *const p = item->create_popup(this); 50 | 51 | if (p) { 52 | connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed())); 53 | p->show(); 54 | } 55 | } 56 | 57 | void MarginWidget::contextMenuEvent(QContextMenuEvent *event) 58 | { 59 | event->setAccepted(false); 60 | 61 | const shared_ptr r = get_mouse_over_item(mouse_point_); 62 | if (!r) 63 | return; 64 | 65 | QMenu *menu = r->create_header_context_menu(this); 66 | if (menu) { 67 | event->setAccepted(true); 68 | menu->popup(event->globalPos()); 69 | } 70 | } 71 | 72 | void MarginWidget::keyPressEvent(QKeyEvent *event) 73 | { 74 | assert(event); 75 | 76 | if (event->key() == Qt::Key_Delete) { 77 | const auto items = this->items(); 78 | for (auto &i : items) 79 | if (i->selected()) 80 | i->delete_pressed(); 81 | } 82 | 83 | ViewWidget::keyPressEvent(event); 84 | } 85 | 86 | void MarginWidget::on_popup_closed() 87 | { 88 | bool cursor_above_widget = rect().contains(mapFromGlobal(QCursor::pos())); 89 | 90 | if (!cursor_above_widget) 91 | mouse_point_ = QPoint(INT_MIN, INT_MIN); 92 | 93 | update(); 94 | } 95 | 96 | 97 | } // namespace trace 98 | } // namespace views 99 | } // namespace pv 100 | -------------------------------------------------------------------------------- /pv/views/trace/marginwidget.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_VIEWS_TRACE_MARGINWIDGET_HPP 21 | #define PULSEVIEW_PV_VIEWS_TRACE_MARGINWIDGET_HPP 22 | 23 | #include 24 | 25 | #include 26 | 27 | #include "viewwidget.hpp" 28 | 29 | using std::shared_ptr; 30 | 31 | namespace pv { 32 | namespace views { 33 | namespace trace { 34 | 35 | class ViewItem; 36 | 37 | class MarginWidget : public ViewWidget 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | MarginWidget(View &parent); 43 | 44 | /** 45 | * The extended area that the margin widget would like to be sized to. 46 | * @remarks This area is the area specified by sizeHint, extended by 47 | * the area to overlap the viewport. 48 | */ 49 | virtual QSize extended_size_hint() const = 0; 50 | 51 | protected: 52 | /** 53 | * Indicates the event an a view item has been clicked. 54 | * @param item the view item that has been clicked. 55 | */ 56 | virtual void item_clicked(const shared_ptr &item); 57 | 58 | /** 59 | * Shows the popup of a the specified @c ViewItem . 60 | * @param item The item to show the popup for. 61 | */ 62 | void show_popup(const shared_ptr &item); 63 | 64 | protected Q_SLOTS: 65 | virtual void contextMenuEvent(QContextMenuEvent *event); 66 | 67 | virtual void keyPressEvent(QKeyEvent *event); 68 | 69 | virtual void on_popup_closed(); 70 | }; 71 | 72 | } // namespace trace 73 | } // namespace views 74 | } // namespace pv 75 | 76 | #endif // PULSEVIEW_PV_VIEWS_TRACE_MARGINWIDGET_HPP 77 | -------------------------------------------------------------------------------- /pv/views/trace/timeitem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "signal.hpp" 21 | #include "timeitem.hpp" 22 | #include "view.hpp" 23 | 24 | namespace pv { 25 | namespace views { 26 | namespace trace { 27 | 28 | TimeItem::TimeItem(View &view) : 29 | view_(view) { 30 | } 31 | 32 | void TimeItem::drag_by(const QPoint &delta) 33 | { 34 | if (snapping_disabled_) { 35 | set_time(view_.offset() + (drag_point_.x() + delta.x() - 0.5) * 36 | view_.scale()); 37 | } else { 38 | int64_t sample_num = view_.get_nearest_level_change(drag_point_ + delta); 39 | 40 | if (sample_num > -1) 41 | set_time(sample_num / view_.get_signal_under_mouse_cursor()->base()->get_samplerate()); 42 | else 43 | set_time(view_.offset() + (drag_point_.x() + delta.x() - 0.5) * view_.scale()); 44 | } 45 | } 46 | 47 | const pv::util::Timestamp TimeItem::delta(const pv::util::Timestamp& other) const 48 | { 49 | return other - time(); 50 | } 51 | 52 | 53 | bool TimeItem::is_snapping_disabled() const 54 | { 55 | return snapping_disabled_; 56 | } 57 | 58 | } // namespace trace 59 | } // namespace views 60 | } // namespace pv 61 | -------------------------------------------------------------------------------- /pv/views/trace/timeitem.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_VIEWS_TRACE_TIMEITEM_HPP 21 | #define PULSEVIEW_PV_VIEWS_TRACE_TIMEITEM_HPP 22 | 23 | #include "viewitem.hpp" 24 | 25 | namespace pv { 26 | namespace views { 27 | namespace trace { 28 | 29 | class View; 30 | 31 | /** 32 | * The TimeItem class represents items on the @ref Ruler. It is generic in 33 | * nature, not making assumptions about the kind of item shown. 34 | */ 35 | class TimeItem : public ViewItem 36 | { 37 | Q_OBJECT 38 | 39 | protected: 40 | /** 41 | * Constructor. 42 | * @param view A reference to the view that owns this marker. 43 | */ 44 | TimeItem(View &view); 45 | 46 | bool snapping_disabled_ = false; 47 | 48 | public: 49 | /** 50 | * Sets the time of the marker. 51 | */ 52 | virtual void set_time(const pv::util::Timestamp& time) = 0; 53 | 54 | /** 55 | * Returns the time this time item is set to. 56 | * @return 0 in case there is no valid time (e.g. for a cursor pair) 57 | */ 58 | virtual const pv::util::Timestamp time() const = 0; 59 | 60 | virtual float get_x() const = 0; 61 | 62 | virtual const pv::util::Timestamp delta(const pv::util::Timestamp& other) const; 63 | 64 | /** 65 | * Drags the item to a delta relative to the drag point. 66 | * @param delta the offset from the drag point. 67 | */ 68 | void drag_by(const QPoint &delta); 69 | 70 | bool is_snapping_disabled() const; 71 | 72 | protected: 73 | View &view_; 74 | }; 75 | 76 | } // namespace trace 77 | } // namespace views 78 | } // namespace pv 79 | 80 | #endif // PULSEVIEW_PV_VIEWS_TRACE_TIMEITEM_HPP 81 | -------------------------------------------------------------------------------- /pv/views/trace/tracepalette.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "tracepalette.hpp" 21 | 22 | namespace pv { 23 | namespace views { 24 | namespace trace { 25 | 26 | const QColor TracePalette::Colors[Cols * Rows] = { 27 | 28 | // Light Colors 29 | QColor(0xFC, 0xE9, 0x4F), // Butter 30 | QColor(0xFC, 0xAF, 0x3E), // Orange 31 | QColor(0xE9, 0xB9, 0x6E), // Chocolate 32 | QColor(0x8A, 0xE2, 0x34), // Chameleon 33 | QColor(0x72, 0x9F, 0xCF), // Sky Blue 34 | QColor(0xAD, 0x7F, 0xA8), // Plum 35 | QColor(0xCF, 0x72, 0xC3), // Magenta 36 | QColor(0xEF, 0x29, 0x29), // Scarlet Red 37 | 38 | // Mid Colors 39 | QColor(0xED, 0xD4, 0x00), // Butter 40 | QColor(0xF5, 0x79, 0x00), // Orange 41 | QColor(0xC1, 0x7D, 0x11), // Chocolate 42 | QColor(0x73, 0xD2, 0x16), // Chameleon 43 | QColor(0x34, 0x65, 0xA4), // Sky Blue 44 | QColor(0x75, 0x50, 0x7B), // Plum 45 | QColor(0xA3, 0x34, 0x96), // Magenta 46 | QColor(0xCC, 0x00, 0x00), // Scarlet Red 47 | 48 | // Dark Colors 49 | QColor(0xC4, 0xA0, 0x00), // Butter 50 | QColor(0xCE, 0x5C, 0x00), // Orange 51 | QColor(0x8F, 0x59, 0x02), // Chocolate 52 | QColor(0x4E, 0x9A, 0x06), // Chameleon 53 | QColor(0x20, 0x4A, 0x87), // Sky Blue 54 | QColor(0x5C, 0x35, 0x66), // Plum 55 | QColor(0x87, 0x20, 0x7A), // Magenta 56 | QColor(0xA4, 0x00, 0x00), // Scarlet Red 57 | 58 | // Greys 59 | QColor(0x16, 0x19, 0x1A), // Black 60 | QColor(0x2E, 0x34, 0x36), // Grey 1 61 | QColor(0x55, 0x57, 0x53), // Grey 2 62 | QColor(0x88, 0x8A, 0x8F), // Grey 3 63 | QColor(0xBA, 0xBD, 0xB6), // Grey 4 64 | QColor(0xD3, 0xD7, 0xCF), // Grey 5 65 | QColor(0xEE, 0xEE, 0xEC), // Grey 6 66 | QColor(0xFF, 0xFF, 0xFF), // White 67 | }; 68 | 69 | } // namespace trace 70 | } // namespace views 71 | } // namespace pv 72 | -------------------------------------------------------------------------------- /pv/views/trace/tracepalette.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_VIEWS_TRACE_TRACEPALETTE_HPP 21 | #define PULSEVIEW_PV_VIEWS_TRACE_TRACEPALETTE_HPP 22 | 23 | #include 24 | 25 | namespace pv { 26 | namespace views { 27 | namespace trace { 28 | 29 | class TracePalette 30 | { 31 | public: 32 | static const unsigned int Cols = 8; 33 | static const unsigned int Rows = 4; 34 | static const QColor Colors[Cols * Rows]; 35 | }; 36 | 37 | } // namespace trace 38 | } // namespace views 39 | } // namespace pv 40 | 41 | #endif // PULSEVIEW_PV_VIEWS_TRACE_TRACEPALETTE_HPP 42 | -------------------------------------------------------------------------------- /pv/views/trace/triggermarker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "triggermarker.hpp" 21 | #include "view.hpp" 22 | 23 | namespace pv { 24 | namespace views { 25 | namespace trace { 26 | 27 | const QColor TriggerMarker::Color(0x00, 0x00, 0xB0); 28 | 29 | TriggerMarker::TriggerMarker(View &view, const pv::util::Timestamp& time) : 30 | TimeItem(view), 31 | time_(time) 32 | { 33 | } 34 | 35 | TriggerMarker::TriggerMarker(const TriggerMarker &marker) : 36 | TimeItem(marker.view_), 37 | time_(marker.time_) 38 | { 39 | } 40 | 41 | bool TriggerMarker::enabled() const 42 | { 43 | return true; 44 | } 45 | 46 | bool TriggerMarker::is_draggable(QPoint pos) const 47 | { 48 | (void)pos; 49 | return false; 50 | } 51 | 52 | void TriggerMarker::set_time(const pv::util::Timestamp& time) 53 | { 54 | time_ = time; 55 | 56 | view_.time_item_appearance_changed(true, true); 57 | } 58 | 59 | const pv::util::Timestamp TriggerMarker::time() const 60 | { 61 | return time_; 62 | } 63 | 64 | float TriggerMarker::get_x() const 65 | { 66 | return ((time_ - view_.offset()) / view_.scale()).convert_to(); 67 | } 68 | 69 | QPoint TriggerMarker::drag_point(const QRect &rect) const 70 | { 71 | (void)rect; 72 | 73 | // The trigger marker cannot be moved, so there is no drag point 74 | return QPoint(INT_MIN, INT_MIN); 75 | } 76 | 77 | void TriggerMarker::paint_fore(QPainter &p, ViewItemPaintParams &pp) 78 | { 79 | if (!enabled()) 80 | return; 81 | 82 | QPen pen(Color); 83 | pen.setStyle(Qt::DashLine); 84 | 85 | const float x = get_x(); 86 | p.setPen(pen); 87 | p.drawLine(QPointF(x, pp.top()), QPointF(x, pp.bottom())); 88 | } 89 | 90 | } // namespace trace 91 | } // namespace views 92 | } // namespace pv 93 | -------------------------------------------------------------------------------- /pv/views/trace/viewitemowner.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include "tracetreeitem.hpp" 23 | #include "trace.hpp" 24 | #include "tracetreeitemowner.hpp" 25 | 26 | namespace pv { 27 | namespace views { 28 | namespace trace { 29 | 30 | const ViewItemOwner::item_list& ViewItemOwner::child_items() const 31 | { 32 | return items_; 33 | } 34 | 35 | ViewItemOwner::iterator ViewItemOwner::begin() 36 | { 37 | return iterator(this, items_.begin()); 38 | } 39 | 40 | ViewItemOwner::iterator ViewItemOwner::end() 41 | { 42 | return iterator(this); 43 | } 44 | 45 | ViewItemOwner::const_iterator ViewItemOwner::begin() const 46 | { 47 | return const_iterator(this, items_.cbegin()); 48 | } 49 | 50 | ViewItemOwner::const_iterator ViewItemOwner::end() const 51 | { 52 | return const_iterator(this); 53 | } 54 | 55 | } // namespace trace 56 | } // namespace views 57 | } // namespace pv 58 | -------------------------------------------------------------------------------- /pv/views/trace/viewitempaintparams.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include "viewitempaintparams.hpp" 26 | 27 | namespace pv { 28 | namespace views { 29 | namespace trace { 30 | 31 | ViewItemPaintParams::ViewItemPaintParams( 32 | const QRect &rect, double scale, const pv::util::Timestamp& offset) : 33 | rect_(rect), 34 | scale_(scale), 35 | offset_(offset), 36 | bg_color_state_(false) 37 | { 38 | assert(scale > 0.0); 39 | } 40 | 41 | QFont ViewItemPaintParams::font() 42 | { 43 | return QApplication::font(); 44 | } 45 | 46 | int ViewItemPaintParams::text_height() 47 | { 48 | return QFontMetrics(font()).height(); 49 | } 50 | 51 | } // namespace trace 52 | } // namespace views 53 | } // namespace pv 54 | -------------------------------------------------------------------------------- /pv/views/trace/viewitempaintparams.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2014 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_VIEWS_TRACE_VIEWITEMPAINTPARAMS_HPP 21 | #define PULSEVIEW_PV_VIEWS_TRACE_VIEWITEMPAINTPARAMS_HPP 22 | 23 | #include "pv/util.hpp" 24 | 25 | #include 26 | #include 27 | 28 | namespace pv { 29 | namespace views { 30 | namespace trace { 31 | 32 | class ViewItemPaintParams 33 | { 34 | public: 35 | ViewItemPaintParams( 36 | const QRect &rect, double scale, const pv::util::Timestamp& offset); 37 | 38 | QRect rect() const { 39 | return rect_; 40 | } 41 | 42 | double scale() const { 43 | return scale_; 44 | } 45 | 46 | const pv::util::Timestamp& offset() const { 47 | return offset_; 48 | } 49 | 50 | int left() const { 51 | return rect_.left(); 52 | } 53 | 54 | int right() const { 55 | return rect_.right(); 56 | } 57 | 58 | int top() const { 59 | return rect_.top(); 60 | } 61 | 62 | int bottom() const { 63 | return rect_.bottom(); 64 | } 65 | 66 | int width() const { 67 | return rect_.width(); 68 | } 69 | 70 | int height() const { 71 | return rect_.height(); 72 | } 73 | 74 | double pixels_offset() const { 75 | return (offset_ / scale_).convert_to(); 76 | } 77 | 78 | bool next_bg_color_state() { 79 | const bool state = bg_color_state_; 80 | bg_color_state_ = !bg_color_state_; 81 | return state; 82 | } 83 | 84 | public: 85 | static QFont font(); 86 | 87 | static int text_height(); 88 | 89 | private: 90 | QRect rect_; 91 | double scale_; 92 | pv::util::Timestamp offset_; 93 | bool bg_color_state_; 94 | }; 95 | 96 | } // namespace trace 97 | } // namespace views 98 | } // namespace pv 99 | 100 | #endif // PULSEVIEW_PV_VIEWS_TRACE_VIEWITEMPAINTPARAMS_HPP 101 | -------------------------------------------------------------------------------- /pv/widgets/colorbutton.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP 21 | #define PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP 22 | 23 | #include 24 | 25 | #include "colorpopup.hpp" 26 | 27 | namespace pv { 28 | namespace widgets { 29 | 30 | class ColorButton : public QPushButton 31 | { 32 | Q_OBJECT; 33 | 34 | private: 35 | static const int SwatchMargin; 36 | 37 | public: 38 | /** 39 | * Construct a ColorButton instance that uses a QColorDialog 40 | */ 41 | ColorButton(QWidget *parent); 42 | 43 | /** 44 | * Construct a ColorButton instance that uses a ColorPopup 45 | */ 46 | ColorButton(int rows, int cols, QWidget *parent); 47 | 48 | ColorPopup* popup(); 49 | 50 | const QColor& color() const; 51 | 52 | void set_color(QColor color); 53 | 54 | void set_palette(const QColor *const palette); 55 | 56 | private: 57 | void paintEvent(QPaintEvent *event); 58 | 59 | private Q_SLOTS: 60 | void on_clicked(bool); 61 | void on_selected(int row, int col); 62 | void on_color_selected(const QColor& color); 63 | 64 | Q_SIGNALS: 65 | void selected(const QColor &color); 66 | 67 | private: 68 | ColorPopup* popup_; 69 | QColor cur_color_; 70 | }; 71 | 72 | } // namespace widgets 73 | } // namespace pv 74 | 75 | #endif // PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP 76 | -------------------------------------------------------------------------------- /pv/widgets/colorpopup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "colorpopup.hpp" 21 | 22 | namespace pv { 23 | namespace widgets { 24 | 25 | ColorPopup::ColorPopup(int rows, int cols, QWidget *parent) : 26 | Popup(parent), 27 | well_array_(rows, cols, this), 28 | layout_(this) 29 | { 30 | layout_.addWidget(&well_array_); 31 | setLayout(&layout_); 32 | 33 | connect(&well_array_, SIGNAL(selected(int, int)), 34 | this, SIGNAL(selected(int, int))); 35 | connect(&well_array_, SIGNAL(selected(int, int)), 36 | this, SLOT(color_selected(int, int))); 37 | } 38 | 39 | WellArray& ColorPopup::well_array() 40 | { 41 | return well_array_; 42 | } 43 | 44 | void ColorPopup::color_selected(int, int) 45 | { 46 | close(); 47 | } 48 | 49 | } // namespace widgets 50 | } // namespace pv 51 | -------------------------------------------------------------------------------- /pv/widgets/colorpopup.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP 21 | #define PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP 22 | 23 | #include "popup.hpp" 24 | #include "wellarray.hpp" 25 | 26 | #include 27 | 28 | namespace pv { 29 | namespace widgets { 30 | 31 | class ColorPopup : public Popup 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | ColorPopup(int rows, int cols, QWidget *parent); 37 | 38 | WellArray& well_array(); 39 | 40 | Q_SIGNALS: 41 | void selected(int row, int col); 42 | 43 | private Q_SLOTS: 44 | void color_selected(int, int); 45 | 46 | private: 47 | WellArray well_array_; 48 | QVBoxLayout layout_; 49 | }; 50 | 51 | } // namespace widgets 52 | } // namespace pv 53 | 54 | #endif // PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP 55 | -------------------------------------------------------------------------------- /pv/widgets/decodergroupbox.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "decodergroupbox.hpp" 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace pv { 30 | namespace widgets { 31 | 32 | DecoderGroupBox::DecoderGroupBox(QString title, QString tooltip, QWidget *parent, bool isDeletable) : 33 | QWidget(parent), 34 | layout_(new QGridLayout), 35 | show_hide_button_(QIcon(":/icons/decoder-shown.svg"), QString(), this) 36 | { 37 | layout_->setContentsMargins(0, 0, 0, 0); 38 | setLayout(layout_); 39 | 40 | auto *lbl = new QLabel(QString("

%1

").arg(title)); 41 | lbl->setToolTip(tooltip); 42 | layout_->addWidget(lbl, 0, 0); 43 | layout_->setColumnStretch(0, 1); 44 | 45 | QHBoxLayout *const toolbar = new QHBoxLayout; 46 | layout_->addLayout(toolbar, 0, 1); 47 | 48 | show_hide_button_.setToolTip(tr("Show/hide this decoder trace")); 49 | show_hide_button_.setFlat(true); 50 | show_hide_button_.setIconSize(QSize(16, 16)); 51 | connect(&show_hide_button_, SIGNAL(clicked()), 52 | this, SIGNAL(show_hide_decoder())); 53 | toolbar->addWidget(&show_hide_button_); 54 | 55 | if (isDeletable) { 56 | QPushButton *const delete_button = new QPushButton( 57 | QIcon(":/icons/decoder-delete.svg"), QString(), this); 58 | delete_button->setToolTip(tr("Delete this decoder trace")); 59 | delete_button->setFlat(true); 60 | delete_button->setIconSize(QSize(16, 16)); 61 | connect(delete_button, SIGNAL(clicked()), 62 | this, SIGNAL(delete_decoder())); 63 | toolbar->addWidget(delete_button); 64 | } 65 | } 66 | 67 | void DecoderGroupBox::add_layout(QLayout *layout) 68 | { 69 | assert(layout); 70 | layout_->addLayout(layout, 1, 0, 1, 2); 71 | } 72 | 73 | void DecoderGroupBox::set_decoder_visible(bool visible) 74 | { 75 | show_hide_button_.setIcon(QIcon(visible ? 76 | ":/icons/decoder-shown.svg" : 77 | ":/icons/decoder-hidden.svg")); 78 | } 79 | 80 | } // namespace widgets 81 | } // namespace pv 82 | -------------------------------------------------------------------------------- /pv/widgets/decodergroupbox.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_HPP 21 | #define PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_HPP 22 | 23 | #include 24 | 25 | class QGridLayout; 26 | class QToolBar; 27 | 28 | namespace pv { 29 | namespace widgets { 30 | 31 | class DecoderGroupBox : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | DecoderGroupBox(QString title, QString tooltip, 37 | QWidget *parent = nullptr, bool isDeletable = true); 38 | 39 | void add_layout(QLayout *layout); 40 | 41 | void set_decoder_visible(bool visible); 42 | 43 | Q_SIGNALS: 44 | void delete_decoder(); 45 | 46 | void show_hide_decoder(); 47 | 48 | private: 49 | QGridLayout *const layout_; 50 | QPushButton show_hide_button_; 51 | }; 52 | 53 | } // namespace widgets 54 | } // namespace pv 55 | 56 | #endif // PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_HPP 57 | -------------------------------------------------------------------------------- /pv/widgets/decodermenu.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include "decodermenu.hpp" 25 | 26 | namespace pv { 27 | namespace widgets { 28 | 29 | DecoderMenu::DecoderMenu(QWidget *parent, const char* input, bool first_level_decoder) : 30 | QMenu(parent), 31 | mapper_(this) 32 | { 33 | GSList *li = g_slist_sort(g_slist_copy((GSList*)srd_decoder_list()), decoder_name_cmp); 34 | 35 | for (GSList *l = li; l; l = l->next) { 36 | const srd_decoder *const d = (srd_decoder*)l->data; 37 | assert(d); 38 | 39 | const bool have_channels = (d->channels || d->opt_channels) != 0; 40 | if (first_level_decoder != have_channels) 41 | continue; 42 | 43 | if (!first_level_decoder) { 44 | // Dismiss all non-stacked decoders unless we're looking for first-level decoders 45 | if (!d->inputs) 46 | continue; 47 | 48 | // TODO For now we ignore that d->inputs is actually a list 49 | if (strncmp((char*)(d->inputs->data), input, 1024) != 0) 50 | continue; 51 | } 52 | 53 | QAction *const action = addAction(QString::fromUtf8(d->name)); 54 | action->setData(QVariant::fromValue(l->data)); 55 | mapper_.setMapping(action, action); 56 | connect(action, SIGNAL(triggered()), &mapper_, SLOT(map())); 57 | } 58 | g_slist_free(li); 59 | 60 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 61 | connect(&mapper_, SIGNAL(mappedObject(QObject*)), this, SLOT(on_action(QObject*))); 62 | #else 63 | connect(&mapper_, SIGNAL(mapped(QObject*)), this, SLOT(on_action(QObject*))); 64 | #endif 65 | } 66 | 67 | int DecoderMenu::decoder_name_cmp(const void *a, const void *b) 68 | { 69 | return strcmp(((const srd_decoder*)a)->name, ((const srd_decoder*)b)->name); 70 | } 71 | 72 | void DecoderMenu::on_action(QObject *action) 73 | { 74 | assert(action); 75 | 76 | srd_decoder *const dec = (srd_decoder*)((QAction*)action)->data().value(); 77 | assert(dec); 78 | 79 | decoder_selected(dec); 80 | } 81 | 82 | } // namespace widgets 83 | } // namespace pv 84 | -------------------------------------------------------------------------------- /pv/widgets/decodermenu.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_DECODERMENU_HPP 21 | #define PULSEVIEW_PV_WIDGETS_DECODERMENU_HPP 22 | 23 | #include 24 | #include 25 | 26 | struct srd_decoder; 27 | 28 | namespace pv { 29 | namespace widgets { 30 | 31 | class DecoderMenu : public QMenu 32 | { 33 | Q_OBJECT; 34 | 35 | public: 36 | DecoderMenu(QWidget *parent, const char* input, bool first_level_decoder = false); 37 | 38 | private: 39 | static int decoder_name_cmp(const void *a, const void *b); 40 | 41 | private Q_SLOTS: 42 | void on_action(QObject *action); 43 | 44 | Q_SIGNALS: 45 | void decoder_selected(srd_decoder *decoder); 46 | 47 | private: 48 | QSignalMapper mapper_; 49 | }; 50 | 51 | } // namespace widgets 52 | } // namespace pv 53 | 54 | #endif // PULSEVIEW_PV_WIDGETS_DECODERMENU_HPP 55 | -------------------------------------------------------------------------------- /pv/widgets/exportmenu.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_EXPORTMENU_HPP 21 | #define PULSEVIEW_PV_WIDGETS_EXPORTMENU_HPP 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | using std::shared_ptr; 29 | using std::vector; 30 | 31 | namespace sigrok { 32 | class Context; 33 | class OutputFormat; 34 | } 35 | 36 | namespace pv { 37 | namespace widgets { 38 | 39 | class ExportMenu : public QMenu 40 | { 41 | Q_OBJECT; 42 | 43 | public: 44 | ExportMenu(QWidget *parent, shared_ptr context, 45 | vectoropen_actions = vector()); 46 | 47 | private Q_SLOTS: 48 | void on_action(QObject *action); 49 | 50 | Q_SIGNALS: 51 | void format_selected(shared_ptr format); 52 | 53 | private: 54 | shared_ptr context_; 55 | QSignalMapper mapper_; 56 | }; 57 | 58 | } // namespace widgets 59 | } // namespace pv 60 | 61 | #endif // PULSEVIEW_PV_WIDGETS_EXPORTMENU_HPP 62 | -------------------------------------------------------------------------------- /pv/widgets/importmenu.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_IMPORTMENU_HPP 21 | #define PULSEVIEW_PV_WIDGETS_IMPORTMENU_HPP 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | using std::shared_ptr; 29 | using std::vector; 30 | 31 | namespace sigrok { 32 | class Context; 33 | class InputFormat; 34 | } 35 | 36 | namespace pv { 37 | namespace widgets { 38 | 39 | class ImportMenu : public QMenu 40 | { 41 | Q_OBJECT; 42 | 43 | public: 44 | ImportMenu(QWidget *parent, shared_ptr context, 45 | vectoropen_actions = vector()); 46 | 47 | private Q_SLOTS: 48 | void on_action(QObject *action); 49 | 50 | Q_SIGNALS: 51 | void format_selected(shared_ptr format); 52 | 53 | private: 54 | shared_ptr context_; 55 | QSignalMapper mapper_; 56 | }; 57 | 58 | } // namespace widgets 59 | } // namespace pv 60 | 61 | #endif // PULSEVIEW_PV_WIDGETS_IMPORTMENU_HPP 62 | -------------------------------------------------------------------------------- /pv/widgets/popuptoolbutton.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include "popuptoolbutton.hpp" 23 | 24 | namespace pv { 25 | namespace widgets { 26 | 27 | PopupToolButton::PopupToolButton(QWidget *parent) : 28 | QToolButton(parent), 29 | popup_(nullptr) 30 | { 31 | connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool))); 32 | } 33 | 34 | Popup* PopupToolButton::popup() const 35 | { 36 | return popup_; 37 | } 38 | 39 | void PopupToolButton::set_popup(Popup *popup) 40 | { 41 | assert(popup); 42 | popup_ = popup; 43 | } 44 | 45 | void PopupToolButton::on_clicked(bool) 46 | { 47 | if (!popup_) 48 | return; 49 | 50 | const QRect r = rect(); 51 | popup_->set_position(mapToGlobal(QPoint((r.left() + r.right()) / 2, 52 | ((r.top() + r.bottom() * 3) / 4))), Popup::Bottom); 53 | popup_->show(); 54 | } 55 | 56 | } // namespace widgets 57 | } // namespace pv 58 | -------------------------------------------------------------------------------- /pv/widgets/popuptoolbutton.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_HPP 21 | #define PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_HPP 22 | 23 | #include "popup.hpp" 24 | 25 | #include 26 | 27 | namespace pv { 28 | namespace widgets { 29 | 30 | class PopupToolButton : public QToolButton 31 | { 32 | Q_OBJECT; 33 | 34 | public: 35 | PopupToolButton(QWidget *parent); 36 | 37 | Popup* popup() const; 38 | 39 | void set_popup(Popup *popup); 40 | 41 | private Q_SLOTS: 42 | void on_clicked(bool); 43 | 44 | private: 45 | Popup *popup_; 46 | }; 47 | 48 | } // namespace widgets 49 | } // namespace pv 50 | 51 | #endif // PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_HPP 52 | -------------------------------------------------------------------------------- /pv/widgets/sweeptimingwidget.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_HPP 21 | #define PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_HPP 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace pv { 32 | namespace widgets { 33 | 34 | class SweepTimingWidget : public QWidget 35 | { 36 | Q_OBJECT 37 | 38 | private: 39 | enum ValueType 40 | { 41 | None, 42 | MinMaxStep, 43 | List 44 | }; 45 | 46 | public: 47 | SweepTimingWidget(const char *suffix, QWidget *parent = nullptr); 48 | 49 | void allow_user_entered_values(bool value); 50 | 51 | void show_none(); 52 | void show_min_max_step(uint64_t min, uint64_t max, uint64_t step); 53 | void show_list(const uint64_t *vals, size_t count); 54 | void show_125_list(uint64_t min, uint64_t max); 55 | 56 | uint64_t value() const; 57 | void set_value(uint64_t value); 58 | 59 | Q_SIGNALS: 60 | void value_changed(); 61 | 62 | private: 63 | const char *const suffix_; 64 | 65 | QHBoxLayout layout_; 66 | 67 | QDoubleSpinBox value_; 68 | QComboBox list_; 69 | 70 | ValueType value_type_; 71 | }; 72 | 73 | } // namespace widgets 74 | } // namespace pv 75 | 76 | #endif // PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_HPP 77 | -------------------------------------------------------------------------------- /signalhandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Adam Reichold 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include "signalhandler.hpp" 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | int SignalHandler::sockets_[2]; 33 | 34 | bool SignalHandler::prepare_signals() 35 | { 36 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets_) != 0) 37 | return false; 38 | 39 | struct sigaction sig_action; 40 | 41 | sig_action.sa_handler = SignalHandler::handle_signals; 42 | sigemptyset(&sig_action.sa_mask); 43 | sig_action.sa_flags = SA_RESTART; 44 | 45 | if (sigaction(SIGINT, &sig_action, nullptr) != 0 || 46 | sigaction(SIGTERM, &sig_action, nullptr) != 0 || 47 | sigaction(SIGUSR1, &sig_action, nullptr) != 0) { 48 | close(sockets_[0]); 49 | close(sockets_[1]); 50 | return false; 51 | } 52 | 53 | return true; 54 | } 55 | 56 | SignalHandler::SignalHandler(QObject* parent) : QObject(parent), 57 | socket_notifier_(nullptr) 58 | { 59 | socket_notifier_ = new QSocketNotifier(sockets_[1], 60 | QSocketNotifier::Read, this); 61 | connect(socket_notifier_, SIGNAL(activated(int)), 62 | SLOT(on_socket_notifier_activated())); 63 | } 64 | 65 | void SignalHandler::on_socket_notifier_activated() 66 | { 67 | socket_notifier_->setEnabled(false); 68 | 69 | int sig_number; 70 | if (read(sockets_[1], &sig_number, sizeof(int)) != sizeof(int)) { 71 | qDebug() << "Failed to catch signal"; 72 | abort(); 73 | } 74 | 75 | switch (sig_number) { 76 | case SIGINT: 77 | Q_EMIT int_received(); 78 | break; 79 | case SIGTERM: 80 | Q_EMIT term_received(); 81 | break; 82 | case SIGUSR1: 83 | Q_EMIT usr1_received(); 84 | break; 85 | } 86 | 87 | socket_notifier_->setEnabled(true); 88 | } 89 | 90 | void SignalHandler::handle_signals(int sig_number) 91 | { 92 | if (write(sockets_[0], &sig_number, sizeof(int)) != sizeof(int)) { 93 | // Failed to handle signal 94 | abort(); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /signalhandler.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Adam Reichold 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_SIGNALHANDLER_HPP 21 | #define PULSEVIEW_SIGNALHANDLER_HPP 22 | 23 | #include 24 | 25 | class QSocketNotifier; 26 | 27 | class SignalHandler : public QObject 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | static bool prepare_signals(); 33 | 34 | public: 35 | explicit SignalHandler(QObject* parent = nullptr); 36 | 37 | Q_SIGNALS: 38 | void int_received(); 39 | void term_received(); 40 | void usr1_received(); 41 | 42 | private Q_SLOTS: 43 | void on_socket_notifier_activated(); 44 | 45 | private: 46 | static void handle_signals(int sig_number); 47 | 48 | private: 49 | QSocketNotifier* socket_notifier_; 50 | 51 | private: 52 | static int sockets_[2]; 53 | }; 54 | 55 | #endif // PULSEVIEW_SIGNALHANDLER_HPP 56 | -------------------------------------------------------------------------------- /test/data/decoderstack.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2013 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #if 0 21 | 22 | #include /* First, so we avoid a _POSIX_C_SOURCE warning. */ 23 | #include 24 | 25 | #include 26 | 27 | #include "../../pv/data/decoderstack.hpp" 28 | #include "../../pv/devicemanager.hpp" 29 | #include "../../pv/session.hpp" 30 | #include "../../pv/view/decodetrace.hpp" 31 | 32 | using pv::data::DecoderStack; 33 | using pv::data::decode::Decoder; 34 | using pv::view::DecodeTrace; 35 | using std::shared_ptr; 36 | using std::vector; 37 | 38 | BOOST_AUTO_TEST_SUITE(DecoderStackTest) 39 | 40 | BOOST_AUTO_TEST_CASE(TwoDecoderStack) 41 | { 42 | sr_context *ctx = nullptr; 43 | 44 | BOOST_REQUIRE(sr_init(&ctx) == SR_OK); 45 | BOOST_REQUIRE(ctx); 46 | 47 | BOOST_REQUIRE(srd_init(nullptr) == SRD_OK); 48 | 49 | srd_decoder_load_all(); 50 | 51 | { 52 | pv::DeviceManager dm(ctx); 53 | pv::Session ss(dm); 54 | 55 | const GSList *l = srd_decoder_list(); 56 | BOOST_REQUIRE(l); 57 | srd_decoder *const dec = (struct srd_decoder*)l->data; 58 | BOOST_REQUIRE(dec); 59 | 60 | ss.add_decoder(dec); 61 | ss.add_decoder(dec); 62 | 63 | // Check the signals were created 64 | const vector< shared_ptr > sigs = 65 | ss.get_decode_signals(); 66 | 67 | shared_ptr dec0 = sigs[0]->decoder(); 68 | BOOST_REQUIRE(dec0); 69 | 70 | shared_ptr dec1 = sigs[0]->decoder(); 71 | BOOST_REQUIRE(dec1); 72 | 73 | // Wait for the decode threads to complete 74 | dec0->decode_thread_.join(); 75 | dec1->decode_thread_.join(); 76 | 77 | // Check there were no errors 78 | BOOST_CHECK_EQUAL(dec0->error_message().isEmpty(), true); 79 | BOOST_CHECK_EQUAL(dec1->error_message().isEmpty(), true); 80 | } 81 | 82 | 83 | srd_exit(); 84 | sr_exit(ctx); 85 | } 86 | 87 | BOOST_AUTO_TEST_SUITE_END() 88 | #endif 89 | -------------------------------------------------------------------------------- /test/test.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2012 Joel Holdsworth 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #define BOOST_TEST_MAIN 21 | #include "test/test.hpp" 22 | #include 23 | 24 | using std::ostream; 25 | 26 | ostream& operator<<(ostream& stream, const QString& str) 27 | { 28 | return stream << str.toUtf8().data(); 29 | } 30 | -------------------------------------------------------------------------------- /test/test.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the PulseView project. 3 | * 4 | * Copyright (C) 2015 Jens Steinhauser 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef PULSEVIEW_TEST_TEST_HPP 21 | #define PULSEVIEW_TEST_TEST_HPP 22 | 23 | #include 24 | 25 | using std::ostream; 26 | 27 | ostream& operator<<(ostream& stream, const QString& str); 28 | 29 | #endif // PULSEVIEW_TEST_TEST_HPP 30 | -------------------------------------------------------------------------------- /themes/darkstyle/icon_branch_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_branch_closed.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_branch_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_branch_end.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_branch_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_branch_more.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_branch_open.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_checked.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_checked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_checked_disabled.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_checked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_checked_pressed.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_indeterminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_indeterminate.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_indeterminate_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_indeterminate_disabled.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_indeterminate_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_indeterminate_pressed.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_unchecked.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_unchecked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_unchecked_disabled.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_checkbox_unchecked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_checkbox_unchecked_pressed.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_close.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_radiobutton_checked.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_radiobutton_checked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_radiobutton_checked_disabled.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_radiobutton_checked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_radiobutton_checked_pressed.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_radiobutton_unchecked.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_radiobutton_unchecked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_radiobutton_unchecked_disabled.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_radiobutton_unchecked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_radiobutton_unchecked_pressed.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_restore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_restore.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_undock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_undock.png -------------------------------------------------------------------------------- /themes/darkstyle/icon_vline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/darkstyle/icon_vline.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/Hmovetoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/Hmovetoolbar.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/Hsepartoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/Hsepartoolbar.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/Vmovetoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/Vmovetoolbar.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/Vsepartoolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/Vsepartoolbar.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/branch_closed-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/branch_closed-on.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/branch_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/branch_closed.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/branch_open-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/branch_open-on.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/branch_open.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_checked.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_checked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_checked_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_checked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_checked_focus.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_indeterminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_indeterminate.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_indeterminate_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_indeterminate_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_indeterminate_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_indeterminate_focus.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_unchecked.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_unchecked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_unchecked_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/checkbox_unchecked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/checkbox_unchecked_focus.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/close-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/close-hover.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/close-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/close-pressed.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/close.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/down_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/down_arrow.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/down_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/down_arrow_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/left_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/left_arrow.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/left_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/left_arrow_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/radio_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/radio_checked.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/radio_checked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/radio_checked_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/radio_checked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/radio_checked_focus.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/radio_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/radio_unchecked.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/radio_unchecked_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/radio_unchecked_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/radio_unchecked_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/radio_unchecked_focus.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/right_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/right_arrow.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/right_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/right_arrow_disabled.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/sizegrip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/sizegrip.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/stylesheet-branch-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/stylesheet-branch-end.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/stylesheet-branch-more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/stylesheet-branch-more.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/stylesheet-vline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/stylesheet-vline.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/transparent.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/undock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/undock.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/up_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/up_arrow.png -------------------------------------------------------------------------------- /themes/qdarkstyle/rc/up_arrow_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigrokproject/pulseview/e2fe9dfb91c7de85c410922ee9268c3f526bcc54/themes/qdarkstyle/rc/up_arrow_disabled.png -------------------------------------------------------------------------------- /translations.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | l10n/de.qm 4 | l10n/es_MX.qm 5 | l10n/ja_jp.qm 6 | l10n/zh_cn.qm 7 | 8 | 9 | --------------------------------------------------------------------------------