pulseview-0.4.0/CMakeLists.txt000600 001750 001750 00000036175 13117760425 015752 0ustar00uweuwe000000 000000 ## ## This file is part of the PulseView project. ## ## Copyright (C) 2012 Joel Holdsworth ## Copyright (C) 2012-2013 Alexandru Gagniuc ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . ## cmake_minimum_required(VERSION 2.8.12) include(GNUInstallDirs) project(pulseview) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") #=============================================================================== #= User Options #------------------------------------------------------------------------------- option(DISABLE_WERROR "Build without -Werror" FALSE) option(ENABLE_SIGNALS "Build with UNIX signals" TRUE) option(ENABLE_DECODE "Build with libsigrokdecode" TRUE) option(ENABLE_TESTS "Enable unit tests" TRUE) option(STATIC_PKGDEPS_LIBS "Statically link to (pkg-config) libraries" FALSE) if(WIN32) # On Windows/MinGW we need to statically link to libraries. # This option is user configurable, but enable it by default on win32. set(STATIC_PKGDEPS_LIBS TRUE) # Windows does not support UNIX signals. set(ENABLE_SIGNALS FALSE) endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build (None, Debug, Release, RelWithDebInfo, MinSizeRel)." FORCE) endif() #=============================================================================== #= Dependencies #------------------------------------------------------------------------------- list(APPEND PKGDEPS glib-2.0>=2.28.0) list(APPEND PKGDEPS glibmm-2.4>=2.28.0) list(APPEND PKGDEPS libsigrokcxx>=0.5.0) if(ENABLE_DECODE) list(APPEND PKGDEPS libsigrokdecode>=0.5.0) endif() if(ANDROID) list(APPEND PKGDEPS libsigrokandroidutils>=0.1.0) endif() find_package(PkgConfig) pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS}) set(CMAKE_AUTOMOC TRUE) find_package(Qt5 COMPONENTS Core Gui Widgets Svg REQUIRED) if(WIN32) # MXE workaround: Use pkg-config to find Qt5 libs. # https://github.com/mxe/mxe/issues/1642 pkg_check_modules(QT5ALL REQUIRED Qt5Widgets Qt5Gui Qt5Svg) endif() set(QT_LIBRARIES Qt5::Gui Qt5::Widgets Qt5::Svg) set(BOOSTCOMPS filesystem serialization system) if(ENABLE_TESTS) list(APPEND BOOSTCOMPS unit_test_framework) endif() find_package(Boost 1.55 COMPONENTS ${BOOSTCOMPS} REQUIRED) # Find the platform's thread library (needed for C++11 threads). # This will set ${CMAKE_THREAD_LIBS_INIT} to the correct, OS-specific value. find_package(Threads REQUIRED) # Check for explicit link against libatomic # # Depending on the toolchain, linking a program using atomic functions may need # "-latomic" explicitly passed to the linker # # This check first tests if atomics are available in the C-library, if not and # libatomic exists, then it runs the same test with -latomic added to the # linker flags. # Helper for checking for atomics function(check_working_cxx_atomics varname additional_lib) include(CheckCXXSourceCompiles) include(CMakePushCheckState) cmake_push_check_state() set(CMAKE_REQUIRED_FLAGS "-std=c++11") set(CMAKE_REQUIRED_LIBRARIES "${additional_lib}") set(CMAKE_REQUIRED_QUIET 1) CHECK_CXX_SOURCE_COMPILES(" #include std::atomic x; int main() { return std::atomic_fetch_add_explicit(&x, 1, std::memory_order_seq_cst); } " ${varname}) cmake_pop_check_state() endfunction(check_working_cxx_atomics) # First check if atomics work without the library. # If not, check if the library exists, and atomics work with it. check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB "") if(HAVE_CXX_ATOMICS_WITHOUT_LIB) message(STATUS "Atomics provided by the C-library - yes") else() message(STATUS "Atomics provided by the C-library - no") find_library(LIBATOMIC_LIBRARY NAMES atomic PATH_SUFFIXES lib) if(LIBATOMIC_LIBRARY) check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB "${LIBATOMIC_LIBRARY}") if (HAVE_CXX_ATOMICS_WITH_LIB) message(STATUS "Atomics provided by libatomic - yes") else() message(STATUS "Atomics provided by libatomic - no") message(FATAL_ERROR "Compiler must support std::atomic!") endif() else() message(FATAL_ERROR "Compiler appears to require libatomic, but cannot find it.") endif() endif() #=============================================================================== #= System Introspection #------------------------------------------------------------------------------- include(memaccess) memaccess_check_unaligned_le(HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS) #=============================================================================== #= Config Header #------------------------------------------------------------------------------- set(PV_TITLE PulseView) set(PV_VERSION_STRING "0.4.0") set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.4_VERSION}) include(GetGitRevisionDescription) # Append the revision hash unless we are exactly on a tagged release. git_describe(PV_TAG_VERSION_STRING --match "pulseview-${PV_VERSION_STRING}" --exact-match) if(NOT PV_TAG_VERSION_STRING) get_git_head_revision(PV_REVSPEC PV_HASH) if(PV_HASH) string(SUBSTRING "${PV_HASH}" 0 7 PV_SHORTHASH) set(PV_VERSION_STRING "${PV_VERSION_STRING}-git-${PV_SHORTHASH}") endif() endif() if(PV_VERSION_STRING MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-[-0-9a-z]*)?$") set(PV_VERSION_MAJOR ${CMAKE_MATCH_1}) set(PV_VERSION_MINOR ${CMAKE_MATCH_2}) set(PV_VERSION_MICRO ${CMAKE_MATCH_3}) set(PV_VERSION_SUFFIX ${CMAKE_MATCH_4}) endif() message("-- ${PV_TITLE} version: ${PV_VERSION_STRING}") configure_file ( ${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h ) #=============================================================================== #= Sources #------------------------------------------------------------------------------- set(pulseview_SOURCES main.cpp pv/application.cpp pv/devicemanager.cpp pv/globalsettings.cpp pv/mainwindow.cpp pv/session.cpp pv/storesession.cpp pv/util.cpp pv/binding/binding.cpp pv/binding/inputoutput.cpp pv/binding/device.cpp pv/data/analog.cpp pv/data/analogsegment.cpp pv/data/logic.cpp pv/data/logicsegment.cpp pv/data/signalbase.cpp pv/data/signaldata.cpp pv/data/segment.cpp pv/devices/device.cpp pv/devices/file.cpp pv/devices/hardwaredevice.cpp pv/devices/inputfile.cpp pv/devices/sessionfile.cpp pv/dialogs/connect.cpp pv/dialogs/inputoutputoptions.cpp pv/dialogs/settings.cpp pv/dialogs/storeprogress.cpp pv/popups/deviceoptions.cpp pv/popups/channels.cpp pv/prop/bool.cpp pv/prop/double.cpp pv/prop/enum.cpp pv/prop/int.cpp pv/prop/property.cpp pv/prop/string.cpp pv/toolbars/mainbar.cpp pv/views/trace/analogsignal.cpp pv/views/trace/cursor.cpp pv/views/trace/cursorpair.cpp pv/views/trace/flag.cpp pv/views/trace/header.cpp pv/views/trace/marginwidget.cpp pv/views/trace/logicsignal.cpp pv/views/trace/rowitem.cpp pv/views/trace/ruler.cpp pv/views/trace/signal.cpp pv/views/trace/signalscalehandle.cpp pv/views/trace/timeitem.cpp pv/views/trace/timemarker.cpp pv/views/trace/trace.cpp pv/views/trace/tracegroup.cpp pv/views/trace/tracepalette.cpp pv/views/trace/tracetreeitem.cpp pv/views/trace/tracetreeitemowner.cpp pv/views/trace/triggermarker.cpp pv/views/trace/view.cpp pv/views/trace/viewitem.cpp pv/views/trace/viewitemowner.cpp pv/views/trace/viewitempaintparams.cpp pv/views/trace/viewport.cpp pv/views/trace/viewwidget.cpp pv/views/viewbase.cpp pv/views/trace/standardbar.cpp pv/widgets/colourbutton.cpp pv/widgets/colourpopup.cpp pv/widgets/devicetoolbutton.cpp pv/widgets/exportmenu.cpp pv/widgets/importmenu.cpp pv/widgets/popup.cpp pv/widgets/popuptoolbutton.cpp pv/widgets/sweeptimingwidget.cpp pv/widgets/timestampspinbox.cpp pv/widgets/wellarray.cpp ) # This list includes only QObject derived class headers. set(pulseview_HEADERS pv/globalsettings.hpp pv/mainwindow.hpp pv/session.hpp pv/storesession.hpp pv/binding/device.hpp pv/data/analog.hpp pv/data/analogsegment.hpp pv/data/logic.hpp pv/data/logicsegment.hpp pv/data/signalbase.hpp pv/dialogs/connect.hpp pv/dialogs/inputoutputoptions.hpp pv/dialogs/settings.hpp pv/dialogs/storeprogress.hpp pv/popups/channels.hpp pv/popups/deviceoptions.hpp pv/prop/bool.hpp pv/prop/double.hpp pv/prop/enum.hpp pv/prop/int.hpp pv/prop/property.hpp pv/prop/string.hpp pv/toolbars/mainbar.hpp pv/views/trace/analogsignal.hpp pv/views/trace/cursor.hpp pv/views/trace/flag.hpp pv/views/trace/header.hpp pv/views/trace/logicsignal.hpp pv/views/trace/marginwidget.hpp pv/views/trace/rowitem.hpp pv/views/trace/ruler.hpp pv/views/trace/signal.hpp pv/views/trace/signalscalehandle.hpp pv/views/trace/timeitem.hpp pv/views/trace/timemarker.hpp pv/views/trace/trace.hpp pv/views/trace/tracegroup.hpp pv/views/trace/tracetreeitem.hpp pv/views/trace/triggermarker.hpp pv/views/trace/view.hpp pv/views/trace/viewitem.hpp pv/views/trace/viewport.hpp pv/views/trace/viewwidget.hpp pv/views/viewbase.hpp pv/views/trace/standardbar.hpp pv/widgets/colourbutton.hpp pv/widgets/colourpopup.hpp pv/widgets/devicetoolbutton.hpp pv/widgets/exportmenu.hpp pv/widgets/importmenu.hpp pv/widgets/popup.hpp pv/widgets/popuptoolbutton.hpp pv/widgets/sweeptimingwidget.hpp pv/widgets/timestampspinbox.hpp pv/widgets/wellarray.hpp ) set(pulseview_RESOURCES pulseview.qrc ) if(ENABLE_SIGNALS) list(APPEND pulseview_SOURCES signalhandler.cpp) list(APPEND pulseview_HEADERS signalhandler.hpp) endif() if(ENABLE_DECODE) list(APPEND pulseview_SOURCES pv/binding/decoder.cpp pv/data/decoderstack.cpp pv/data/decode/annotation.cpp pv/data/decode/decoder.cpp pv/data/decode/row.cpp pv/data/decode/rowdata.cpp pv/views/trace/decodetrace.cpp pv/widgets/decodergroupbox.cpp pv/widgets/decodermenu.cpp ) list(APPEND pulseview_HEADERS pv/data/decoderstack.hpp pv/views/trace/decodetrace.hpp pv/widgets/decodergroupbox.hpp pv/widgets/decodermenu.hpp ) endif() if(WIN32) # Use the sigrok icon for the pulseview.exe executable. set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} ") enable_language(RC) list(APPEND pulseview_SOURCES pulseviewico.rc) endif() if(ANDROID) list(APPEND pulseview_SOURCES android/assetreader.cpp android/loghandler.cpp ) endif() qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES}) #=============================================================================== #= Global Definitions #------------------------------------------------------------------------------- add_definitions(-DQT_NO_KEYWORDS) add_definitions(-D__STDC_LIMIT_MACROS) add_definitions(-Wall -Wextra) add_definitions(-std=c++11) add_definitions(-DBOOST_MATH_DISABLE_FLOAT128=1) if(ENABLE_DECODE) add_definitions(-DENABLE_DECODE) endif() if(NOT DISABLE_WERROR) add_definitions(-Werror) endif() if(ENABLE_SIGNALS) add_definitions(-DENABLE_SIGNALS) endif() #=============================================================================== #= Global Include Directories #------------------------------------------------------------------------------- include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ) if(STATIC_PKGDEPS_LIBS) include_directories(${PKGDEPS_STATIC_INCLUDE_DIRS}) else() include_directories(${PKGDEPS_INCLUDE_DIRS}) endif() #=============================================================================== #= Linker Configuration #------------------------------------------------------------------------------- link_directories(${Boost_LIBRARY_DIRS}) set(PULSEVIEW_LINK_LIBS ${Boost_LIBRARIES} ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LIBATOMIC_LIBRARY} ) if(STATIC_PKGDEPS_LIBS) link_directories(${PKGDEPS_STATIC_LIBRARY_DIRS}) list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_STATIC_LDFLAGS}) else() link_directories(${PKGDEPS_LIBRARY_DIRS}) list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES}) endif() if(WIN32) # On Windows we need to statically link the libqsvg imageformat # plugin (and the QtSvg component) for SVG graphics/icons to work. # We also need QWindowsIntegrationPlugin, Qt5PlatformSupport, and all # Qt libs and their dependencies. add_definitions(-DQT_STATICPLUGIN) list(APPEND PULSEVIEW_LINK_LIBS Qt5::QSvgPlugin) list(APPEND PULSEVIEW_LINK_LIBS Qt5::QWindowsIntegrationPlugin) list(APPEND PULSEVIEW_LINK_LIBS -lQt5PlatformSupport ${QT5ALL_LDFLAGS}) endif() if(ANDROID) list(APPEND PULSEVIEW_LINK_LIBS "-llog") endif() if(ANDROID) add_library(${PROJECT_NAME} SHARED ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC}) else() add_executable(${PROJECT_NAME} ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC}) endif() target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS}) if(WIN32) # Pass -mwindows so that no "DOS box" opens when PulseView is started. set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-mwindows") endif() #=============================================================================== #= Installation #------------------------------------------------------------------------------- # Install the executable. install(TARGETS ${PROJECT_NAME} DESTINATION bin/) # Install the manpage. install(FILES doc/pulseview.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) # Install the desktop file. install(FILES contrib/org.sigrok.PulseView.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) # Install the AppData/AppStream file. install(FILES contrib/org.sigrok.PulseView.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo) # Install the PulseView icons. install(FILES icons/pulseview.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps) install(FILES icons/pulseview.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) # Generate Windows installer script. configure_file(contrib/pulseview_cross.nsi.in contrib/pulseview_cross.nsi @ONLY) #=============================================================================== #= Packaging (handled by CPack) #------------------------------------------------------------------------------- set(CPACK_PACKAGE_VERSION_MAJOR ${PV_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PV_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PV_VERSION_MICRO}) set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README) set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING) set(CPACK_SOURCE_IGNORE_FILES ${CMAKE_CURRENT_BINARY_DIR} ".gitignore" ".git") set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${PV_VERSION_STRING}") set(CPACK_SOURCE_GENERATOR "TGZ") include(CPack) #=============================================================================== #= Tests #------------------------------------------------------------------------------- if(ENABLE_TESTS) add_subdirectory(test) enable_testing() add_test(test ${CMAKE_CURRENT_BINARY_DIR}/test/pulseview-test) endif() pulseview-0.4.0/extdef.h000600 001750 001750 00000001720 13117760425 014626 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_EXTDEF_H #define PULSEVIEW_EXTDEF_H #define countof(x) (sizeof(x) / sizeof(x[0])) #define begin_element(x) (&x[0]) #define end_element(x) (&x[countof(x)]) #endif // PULSEVIEW_EXTDEF_H pulseview-0.4.0/signalhandler.cpp000600 001750 001750 00000004307 13117760426 016522 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Adam Reichold * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include "signalhandler.hpp" #include #include #include #include #include #include #include int SignalHandler::sockets_[2]; bool SignalHandler::prepare_signals() { if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets_) != 0) return false; struct sigaction sig_action; sig_action.sa_handler = SignalHandler::handle_signals; sigemptyset(&sig_action.sa_mask); sig_action.sa_flags = SA_RESTART; if (sigaction(SIGINT, &sig_action, nullptr) != 0 || sigaction(SIGTERM, &sig_action, nullptr) != 0) { close(sockets_[0]); close(sockets_[1]); return false; } return true; } SignalHandler::SignalHandler(QObject* parent) : QObject(parent), socket_notifier_(nullptr) { socket_notifier_ = new QSocketNotifier(sockets_[1], QSocketNotifier::Read, this); connect(socket_notifier_, SIGNAL(activated(int)), SLOT(on_socket_notifier_activated())); } void SignalHandler::on_socket_notifier_activated() { socket_notifier_->setEnabled(false); int sig_number; if (read(sockets_[1], &sig_number, sizeof(int)) != sizeof(int)) { qDebug() << "Failed to catch signal"; abort(); } switch (sig_number) { case SIGINT: Q_EMIT int_received(); break; case SIGTERM: Q_EMIT term_received(); break; } socket_notifier_->setEnabled(true); } void SignalHandler::handle_signals(int sig_number) { if (write(sockets_[0], &sig_number, sizeof(int)) != sizeof(int)) { // Failed to handle signal abort(); } } pulseview-0.4.0/test/000700 001750 001750 00000000000 13117760503 014150 5ustar00uweuwe000000 000000 pulseview-0.4.0/test/CMakeLists.txt000600 001750 001750 00000017671 13117760426 016732 0ustar00uweuwe000000 000000 ## ## This file is part of the PulseView project. ## ## Copyright (C) 2012 Joel Holdsworth ## Copyright (C) 2012 Alexandru Gagniuc ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . ## set(pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/devicemanager.cpp ${PROJECT_SOURCE_DIR}/pv/globalsettings.cpp ${PROJECT_SOURCE_DIR}/pv/session.cpp ${PROJECT_SOURCE_DIR}/pv/storesession.cpp ${PROJECT_SOURCE_DIR}/pv/util.cpp ${PROJECT_SOURCE_DIR}/pv/binding/binding.cpp ${PROJECT_SOURCE_DIR}/pv/binding/device.cpp ${PROJECT_SOURCE_DIR}/pv/binding/inputoutput.cpp ${PROJECT_SOURCE_DIR}/pv/data/analog.cpp ${PROJECT_SOURCE_DIR}/pv/data/analogsegment.cpp ${PROJECT_SOURCE_DIR}/pv/data/logic.cpp ${PROJECT_SOURCE_DIR}/pv/data/logicsegment.cpp ${PROJECT_SOURCE_DIR}/pv/data/segment.cpp ${PROJECT_SOURCE_DIR}/pv/data/signalbase.cpp ${PROJECT_SOURCE_DIR}/pv/data/signaldata.cpp ${PROJECT_SOURCE_DIR}/pv/devices/device.cpp ${PROJECT_SOURCE_DIR}/pv/devices/file.cpp ${PROJECT_SOURCE_DIR}/pv/devices/hardwaredevice.cpp ${PROJECT_SOURCE_DIR}/pv/devices/inputfile.cpp ${PROJECT_SOURCE_DIR}/pv/devices/sessionfile.cpp ${PROJECT_SOURCE_DIR}/pv/dialogs/connect.cpp ${PROJECT_SOURCE_DIR}/pv/dialogs/inputoutputoptions.cpp ${PROJECT_SOURCE_DIR}/pv/dialogs/storeprogress.cpp ${PROJECT_SOURCE_DIR}/pv/prop/bool.cpp ${PROJECT_SOURCE_DIR}/pv/prop/double.cpp ${PROJECT_SOURCE_DIR}/pv/prop/enum.cpp ${PROJECT_SOURCE_DIR}/pv/prop/int.cpp ${PROJECT_SOURCE_DIR}/pv/prop/property.cpp ${PROJECT_SOURCE_DIR}/pv/prop/string.cpp ${PROJECT_SOURCE_DIR}/pv/popups/channels.cpp ${PROJECT_SOURCE_DIR}/pv/popups/deviceoptions.cpp ${PROJECT_SOURCE_DIR}/pv/toolbars/mainbar.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/analogsignal.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/cursor.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/cursorpair.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/flag.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/header.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/marginwidget.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/logicsignal.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/rowitem.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/ruler.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/signal.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/signalscalehandle.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/timeitem.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/timemarker.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/trace.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/tracegroup.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/tracepalette.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/tracetreeitem.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/tracetreeitemowner.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/triggermarker.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/view.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewitem.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewitemowner.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewitempaintparams.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewport.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewwidget.cpp ${PROJECT_SOURCE_DIR}/pv/views/viewbase.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/standardbar.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/devicetoolbutton.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/exportmenu.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/importmenu.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/popup.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/popuptoolbutton.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/sweeptimingwidget.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/timestampspinbox.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.cpp data/analogsegment.cpp data/logicsegment.cpp data/segment.cpp view/ruler.cpp test.cpp util.cpp ) # This list includes only QObject derived class headers. set(pulseview_TEST_HEADERS ${PROJECT_SOURCE_DIR}/pv/globalsettings.hpp ${PROJECT_SOURCE_DIR}/pv/session.hpp ${PROJECT_SOURCE_DIR}/pv/storesession.hpp ${PROJECT_SOURCE_DIR}/pv/binding/device.hpp ${PROJECT_SOURCE_DIR}/pv/data/analog.hpp ${PROJECT_SOURCE_DIR}/pv/data/analogsegment.hpp ${PROJECT_SOURCE_DIR}/pv/data/logic.hpp ${PROJECT_SOURCE_DIR}/pv/data/logicsegment.hpp ${PROJECT_SOURCE_DIR}/pv/data/signalbase.hpp ${PROJECT_SOURCE_DIR}/pv/devices/device.hpp ${PROJECT_SOURCE_DIR}/pv/dialogs/connect.hpp ${PROJECT_SOURCE_DIR}/pv/dialogs/inputoutputoptions.hpp ${PROJECT_SOURCE_DIR}/pv/dialogs/storeprogress.hpp ${PROJECT_SOURCE_DIR}/pv/popups/channels.hpp ${PROJECT_SOURCE_DIR}/pv/popups/deviceoptions.hpp ${PROJECT_SOURCE_DIR}/pv/prop/bool.hpp ${PROJECT_SOURCE_DIR}/pv/prop/double.hpp ${PROJECT_SOURCE_DIR}/pv/prop/enum.hpp ${PROJECT_SOURCE_DIR}/pv/prop/int.hpp ${PROJECT_SOURCE_DIR}/pv/prop/property.hpp ${PROJECT_SOURCE_DIR}/pv/prop/string.hpp ${PROJECT_SOURCE_DIR}/pv/toolbars/mainbar.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/analogsignal.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/cursor.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/flag.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/header.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/logicsignal.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/marginwidget.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/rowitem.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/ruler.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/signal.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/signalscalehandle.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/timeitem.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/timemarker.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/trace.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/tracegroup.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/tracetreeitem.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/triggermarker.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/view.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewitem.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewport.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/viewwidget.hpp ${PROJECT_SOURCE_DIR}/pv/views/viewbase.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/standardbar.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/devicetoolbutton.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/exportmenu.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/importmenu.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/popup.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/popuptoolbutton.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/sweeptimingwidget.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/timestampspinbox.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.hpp ) if(ENABLE_DECODE) list(APPEND pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/binding/decoder.cpp ${PROJECT_SOURCE_DIR}/pv/data/decoderstack.cpp ${PROJECT_SOURCE_DIR}/pv/data/decode/annotation.cpp ${PROJECT_SOURCE_DIR}/pv/data/decode/decoder.cpp ${PROJECT_SOURCE_DIR}/pv/data/decode/row.cpp ${PROJECT_SOURCE_DIR}/pv/data/decode/rowdata.cpp ${PROJECT_SOURCE_DIR}/pv/views/trace/decodetrace.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.cpp ${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.cpp data/decoderstack.cpp ) list(APPEND pulseview_TEST_HEADERS ${PROJECT_SOURCE_DIR}/pv/data/decoderstack.hpp ${PROJECT_SOURCE_DIR}/pv/views/trace/decodetrace.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.hpp ${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.hpp ) endif() # On MinGW we need to use static linking. if(NOT WIN32) add_definitions(-DBOOST_TEST_DYN_LINK) endif() add_executable(pulseview-test ${pulseview_TEST_SOURCES} ${pulseview_TEST_HEADERS_MOC} ) target_link_libraries(pulseview-test ${PULSEVIEW_LINK_LIBS}) pulseview-0.4.0/test/view/000700 001750 001750 00000000000 13117760503 015122 5ustar00uweuwe000000 000000 pulseview-0.4.0/test/view/ruler.cpp000600 001750 001750 00000014111 13117760426 016763 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Jens Steinhauser * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "pv/views/trace/ruler.hpp" #include "test/test.hpp" using namespace pv::views::trace; namespace { QString format(const pv::util::Timestamp& t) { return pv::util::format_time_si(t, pv::util::SIPrefix::none, 6); } const double e = 0.0001; }; BOOST_AUTO_TEST_SUITE(RulerTest) BOOST_AUTO_TEST_CASE(tick_position_test_0) { const pv::util::Timestamp major_period("0.1"); const pv::util::Timestamp offset("0"); const double scale(0.001); const int width(500); const Ruler::TickPositions ts = Ruler::calculate_tick_positions( major_period, offset, scale, width, format); BOOST_REQUIRE_EQUAL(ts.major.size(), 6); BOOST_CHECK_CLOSE(ts.major[0].first, 0, e); BOOST_CHECK_CLOSE(ts.major[1].first, 100, e); BOOST_CHECK_CLOSE(ts.major[2].first, 200, e); BOOST_CHECK_CLOSE(ts.major[3].first, 300, e); BOOST_CHECK_CLOSE(ts.major[4].first, 400, e); BOOST_CHECK_CLOSE(ts.major[5].first, 500, e); BOOST_CHECK_EQUAL(ts.major[0].second, "0.000000 s"); BOOST_CHECK_EQUAL(ts.major[1].second, "+0.100000 s"); BOOST_CHECK_EQUAL(ts.major[2].second, "+0.200000 s"); BOOST_CHECK_EQUAL(ts.major[3].second, "+0.300000 s"); BOOST_CHECK_EQUAL(ts.major[4].second, "+0.400000 s"); BOOST_CHECK_EQUAL(ts.major[5].second, "+0.500000 s"); BOOST_REQUIRE_EQUAL(ts.minor.size(), 16); BOOST_CHECK_CLOSE(ts.minor[ 0], -25, e); BOOST_CHECK_CLOSE(ts.minor[ 1], 25, e); BOOST_CHECK_CLOSE(ts.minor[ 2], 50, e); BOOST_CHECK_CLOSE(ts.minor[ 3], 75, e); BOOST_CHECK_CLOSE(ts.minor[ 4], 125, e); BOOST_CHECK_CLOSE(ts.minor[ 5], 150, e); BOOST_CHECK_CLOSE(ts.minor[ 6], 175, e); BOOST_CHECK_CLOSE(ts.minor[ 7], 225, e); BOOST_CHECK_CLOSE(ts.minor[ 8], 250, e); BOOST_CHECK_CLOSE(ts.minor[ 9], 275, e); BOOST_CHECK_CLOSE(ts.minor[10], 325, e); BOOST_CHECK_CLOSE(ts.minor[11], 350, e); BOOST_CHECK_CLOSE(ts.minor[12], 375, e); BOOST_CHECK_CLOSE(ts.minor[13], 425, e); BOOST_CHECK_CLOSE(ts.minor[14], 450, e); BOOST_CHECK_CLOSE(ts.minor[15], 475, e); } BOOST_AUTO_TEST_CASE(tick_position_test_1) { const pv::util::Timestamp major_period("0.1"); const pv::util::Timestamp offset("-0.463"); const double scale(0.001); const int width(500); const Ruler::TickPositions ts = Ruler::calculate_tick_positions( major_period, offset, scale, width, format); BOOST_REQUIRE_EQUAL(ts.major.size(), 5); BOOST_CHECK_CLOSE(ts.major[0].first, 63, e); BOOST_CHECK_CLOSE(ts.major[1].first, 163, e); BOOST_CHECK_CLOSE(ts.major[2].first, 263, e); BOOST_CHECK_CLOSE(ts.major[3].first, 363, e); BOOST_CHECK_CLOSE(ts.major[4].first, 463, e); BOOST_CHECK_EQUAL(ts.major[0].second, "-0.400000 s"); BOOST_CHECK_EQUAL(ts.major[1].second, "-0.300000 s"); BOOST_CHECK_EQUAL(ts.major[2].second, "-0.200000 s"); BOOST_CHECK_EQUAL(ts.major[3].second, "-0.100000 s"); BOOST_CHECK_EQUAL(ts.major[4].second, "0.000000 s"); BOOST_REQUIRE_EQUAL(ts.minor.size(), 17); BOOST_CHECK_CLOSE(ts.minor[ 0], -12, e); BOOST_CHECK_CLOSE(ts.minor[ 1], 13, e); BOOST_CHECK_CLOSE(ts.minor[ 2], 38, e); BOOST_CHECK_CLOSE(ts.minor[ 3], 88, e); BOOST_CHECK_CLOSE(ts.minor[ 4], 113, e); BOOST_CHECK_CLOSE(ts.minor[ 5], 138, e); BOOST_CHECK_CLOSE(ts.minor[ 6], 188, e); BOOST_CHECK_CLOSE(ts.minor[ 7], 213, e); BOOST_CHECK_CLOSE(ts.minor[ 8], 238, e); BOOST_CHECK_CLOSE(ts.minor[ 9], 288, e); BOOST_CHECK_CLOSE(ts.minor[10], 313, e); BOOST_CHECK_CLOSE(ts.minor[11], 338, e); BOOST_CHECK_CLOSE(ts.minor[12], 388, e); BOOST_CHECK_CLOSE(ts.minor[13], 413, e); BOOST_CHECK_CLOSE(ts.minor[14], 438, e); BOOST_CHECK_CLOSE(ts.minor[15], 488, e); BOOST_CHECK_CLOSE(ts.minor[16], 513, e); } BOOST_AUTO_TEST_CASE(tick_position_test_2) { const pv::util::Timestamp major_period("20"); const pv::util::Timestamp offset("8"); const double scale(0.129746); const int width(580); const Ruler::TickPositions ts = Ruler::calculate_tick_positions( major_period, offset, scale, width, format); const double mp = 5; const int off = 8; BOOST_REQUIRE_EQUAL(ts.major.size(), 4); BOOST_CHECK_CLOSE(ts.major[0].first, ( 4 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.major[1].first, ( 8 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.major[2].first, (12 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.major[3].first, (16 * mp - off) / scale, e); BOOST_CHECK_EQUAL(ts.major[0].second, "+20.000000 s"); BOOST_CHECK_EQUAL(ts.major[1].second, "+40.000000 s"); BOOST_CHECK_EQUAL(ts.major[2].second, "+60.000000 s"); BOOST_CHECK_EQUAL(ts.major[3].second, "+80.000000 s"); BOOST_REQUIRE_EQUAL(ts.minor.size(), 13); BOOST_CHECK_CLOSE(ts.minor[ 0], ( 1 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 1], ( 2 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 2], ( 3 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 3], ( 5 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 4], ( 6 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 5], ( 7 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 6], ( 9 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 7], (10 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 8], (11 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[ 9], (13 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[10], (14 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[11], (15 * mp - off) / scale, e); BOOST_CHECK_CLOSE(ts.minor[12], (17 * mp - off) / scale, e); } BOOST_AUTO_TEST_SUITE_END() pulseview-0.4.0/test/test.hpp000600 001750 001750 00000001662 13117760426 015653 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Jens Steinhauser * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_TEST_TEST_HPP #define PULSEVIEW_TEST_TEST_HPP #include using std::ostream; ostream& operator<<(ostream& stream, const QString& str); #endif pulseview-0.4.0/test/data/000700 001750 001750 00000000000 13117760503 015061 5ustar00uweuwe000000 000000 pulseview-0.4.0/test/data/decoderstack.cpp000600 001750 001750 00000004432 13117760426 020231 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #if 0 #include /* First, so we avoid a _POSIX_C_SOURCE warning. */ #include #include #include "../../pv/data/decoderstack.hpp" #include "../../pv/devicemanager.hpp" #include "../../pv/session.hpp" #include "../../pv/view/decodetrace.hpp" using pv::data::DecoderStack; using pv::data::decode::Decoder; using pv::view::DecodeTrace; using std::shared_ptr; using std::vector; BOOST_AUTO_TEST_SUITE(DecoderStackTest) BOOST_AUTO_TEST_CASE(TwoDecoderStack) { sr_context *ctx = nullptr; BOOST_REQUIRE(sr_init(&ctx) == SR_OK); BOOST_REQUIRE(ctx); BOOST_REQUIRE(srd_init(nullptr) == SRD_OK); srd_decoder_load_all(); { pv::DeviceManager dm(ctx); pv::Session ss(dm); const GSList *l = srd_decoder_list(); BOOST_REQUIRE(l); srd_decoder *const dec = (struct srd_decoder*)l->data; BOOST_REQUIRE(dec); ss.add_decoder(dec); ss.add_decoder(dec); // Check the signals were created const vector< shared_ptr > sigs = ss.get_decode_signals(); shared_ptr dec0 = sigs[0]->decoder(); BOOST_REQUIRE(dec0); shared_ptr dec1 = sigs[0]->decoder(); BOOST_REQUIRE(dec1); // Wait for the decode threads to complete dec0->decode_thread_.join(); dec1->decode_thread_.join(); // Check there were no errors BOOST_CHECK_EQUAL(dec0->error_message().isEmpty(), true); BOOST_CHECK_EQUAL(dec1->error_message().isEmpty(), true); } srd_exit(); sr_exit(ctx); } BOOST_AUTO_TEST_SUITE_END() #endif pulseview-0.4.0/test/data/analogsegment.cpp000600 001750 001750 00000006674 13117760426 020434 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #if 0 #include #include #include #include using pv::data::AnalogSegment; BOOST_AUTO_TEST_SUITE(AnalogSegmentTest) void push_analog(AnalogSegment &s, unsigned int num_samples, float value) { float *const data = new float[num_samples]; for (unsigned int i = 0; i < num_samples; i++) data[i] = value; s.append_interleaved_samples(data, num_samples, 1); delete[] data; } BOOST_AUTO_TEST_CASE(Basic) { // Create an empty AnalogSegment object AnalogSegment s; //----- Test AnalogSegment::push_analog -----// BOOST_CHECK(s.get_sample_count() == 0); for (unsigned int i = 0; i < AnalogSegment::ScaleStepCount; i++) { const AnalogSegment::Envelope &m = s.envelope_levels_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.samples == nullptr); } // Push 8 samples of all zeros push_analog(s, 8, 0.0f); BOOST_CHECK(s.get_sample_count() == 8); // There should not be enough samples to have a single mip map sample for (unsigned int i = 0; i < AnalogSegment::ScaleStepCount; i++) { const AnalogSegment::Envelope &m = s.envelope_levels_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.samples == nullptr); } // Push 8 samples of 1.0s to bring the total up to 16 push_analog(s, 8, 1.0f); // There should now be enough data for exactly one sample // in mip map level 0, and that sample should be 0 const AnalogSegment::Envelope &e0 = s.envelope_levels_[0]; BOOST_CHECK_EQUAL(e0.length, 1); BOOST_CHECK_EQUAL(e0.data_length, AnalogSegment::EnvelopeDataUnit); BOOST_REQUIRE(e0.samples != nullptr); BOOST_CHECK_EQUAL(e0.samples[0].min, 0.0f); BOOST_CHECK_EQUAL(e0.samples[0].max, 1.0f); // The higher levels should still be empty for (unsigned int i = 1; i < AnalogSegment::ScaleStepCount; i++) { const AnalogSegment::Envelope &m = s.envelope_levels_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.samples == nullptr); } // Push 240 samples of all zeros to bring the total up to 256 push_analog(s, 240, -1.0f); BOOST_CHECK_EQUAL(e0.length, 16); BOOST_CHECK_EQUAL(e0.data_length, AnalogSegment::EnvelopeDataUnit); for (unsigned int i = 1; i < e0.length; i++) { BOOST_CHECK_EQUAL(e0.samples[i].min, -1.0f); BOOST_CHECK_EQUAL(e0.samples[i].max, -1.0f); } const AnalogSegment::Envelope &e1 = s.envelope_levels_[1]; BOOST_CHECK_EQUAL(e1.length, 1); BOOST_CHECK_EQUAL(e1.data_length, AnalogSegment::EnvelopeDataUnit); BOOST_REQUIRE(e1.samples != nullptr); BOOST_CHECK_EQUAL(e1.samples[0].min, -1.0f); BOOST_CHECK_EQUAL(e1.samples[0].max, 1.0f); } BOOST_AUTO_TEST_SUITE_END() #endif pulseview-0.4.0/test/data/segment.cpp000600 001750 001750 00000021235 13117760426 017240 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2016 Soeren Apel * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include using pv::data::Segment; BOOST_AUTO_TEST_SUITE(SegmentTest) /* --- For debugging only BOOST_AUTO_TEST_CASE(SmallSize8Single) { Segment s(1, sizeof(uint8_t)); uint32_t num_samples = 10; //----- Chunk size << pv::data::Segment::MaxChunkSize @ 8bit, added in 1 call ----// uint8_t* const data = new uint8_t[num_samples]; for (uint32_t i = 0; i < num_samples; i++) data[i] = i; s.append_samples(data, num_samples); delete[] data; BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*sample_data, i); delete[] sample_data; } } */ /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize8Single) { Segment s(1, sizeof(uint8_t)); uint32_t num_samples = pv::data::Segment::MaxChunkSize; //----- Chunk size == pv::data::Segment::MaxChunkSize @ 8bit, added in 1 call ----// uint8_t* const data = new uint8_t[num_samples]; for (uint32_t i = 0; i < num_samples; i++) data[i] = i; s.append_samples(data, num_samples); delete[] data; BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*sample_data, i % 256); delete[] sample_data; } } */ /* --- For debugging only BOOST_AUTO_TEST_CASE(MaxSize8Single) { Segment s(1, sizeof(uint8_t)); // We want to see proper behavior across chunk boundaries uint32_t num_samples = 2*pv::data::Segment::MaxChunkSize; //----- Chunk size >> pv::data::Segment::MaxChunkSize @ 8bit, added in 1 call ----// uint8_t* const data = new uint8_t[num_samples]; for (uint32_t i = 0; i < num_samples; i++) data[i] = i; s.append_samples(data, num_samples); delete[] data; BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*sample_data, i % 256); delete[] sample_data; } } */ /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize24Single) { Segment s(1, 3); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = pv::data::Segment::MaxChunkSize / 3; //----- Chunk size == pv::data::Segment::MaxChunkSize @ 24bit, added in 1 call ----// uint8_t* const data = new uint8_t[num_samples * 3]; for (uint32_t i = 0; i < num_samples * 3; i++) data[i] = i % 256; s.append_samples(data, num_samples); delete[] data; BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*((uint8_t*)sample_data), 3*i % 256); BOOST_CHECK_EQUAL(*((uint8_t*)(sample_data+1)), (3*i+1) % 256); BOOST_CHECK_EQUAL(*((uint8_t*)(sample_data+2)), (3*i+2) % 256); delete[] sample_data; } } */ /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize32Single) { Segment s(1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = pv::data::Segment::MaxChunkSize / sizeof(uint32_t); //----- Chunk size == pv::data::Segment::MaxChunkSize @ 32bit, added in 1 call ----// uint32_t* const data = new uint32_t[num_samples]; for (uint32_t i = 0; i < num_samples; i++) data[i] = i; s.append_samples(data, num_samples); delete[] data; BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*((uint32_t*)sample_data), i); delete[] sample_data; } } */ /* --- For debugging only BOOST_AUTO_TEST_CASE(MaxSize32Single) { Segment s(1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size // Also, we want to see proper behavior across chunk boundaries uint32_t num_samples = 2*(pv::data::Segment::MaxChunkSize / sizeof(uint32_t)); //----- Chunk size >> pv::data::Segment::MaxChunkSize @ 32bit, added in 1 call ----// uint32_t* const data = new uint32_t[num_samples]; for (uint32_t i = 0; i < num_samples; i++) data[i] = i; s.append_samples(data, num_samples); delete[] data; BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*((uint32_t*)sample_data), i); delete[] sample_data; } } */ /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize32Multi) { Segment s(1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = pv::data::Segment::MaxChunkSize / sizeof(uint32_t); //----- Chunk size == pv::data::Segment::MaxChunkSize @ 32bit, added in num_samples calls ----// uint32_t data; for (uint32_t i = 0; i < num_samples; i++) { data = i; s.append_samples(&data, 1); } BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*((uint32_t*)sample_data), i); delete[] sample_data; } } */ BOOST_AUTO_TEST_CASE(MaxSize32Multi) { Segment s(1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = 2*(pv::data::Segment::MaxChunkSize / sizeof(uint32_t)); //----- Chunk size == pv::data::Segment::MaxChunkSize @ 32bit, added in num_samples calls ----// uint32_t data; for (uint32_t i = 0; i < num_samples; i++) { data = i; s.append_samples(&data, 1); } BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*((uint32_t*)sample_data), i); delete[] sample_data; } uint8_t* sample_data = s.get_raw_samples(0, num_samples); for (uint32_t i = 0; i < num_samples; i++) { BOOST_CHECK_EQUAL(*((uint32_t*)(sample_data + i * sizeof(uint32_t))), i); } delete[] sample_data; } BOOST_AUTO_TEST_CASE(MaxSize32MultiAtOnce) { Segment s(1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = 3*(pv::data::Segment::MaxChunkSize / sizeof(uint32_t)); //----- Add all samples, requiring multiple chunks, in one call ----// uint32_t *data = new uint32_t[num_samples]; for (uint32_t i = 0; i < num_samples; i++) data[i] = i; s.append_samples(data, num_samples); delete[] data; BOOST_CHECK(s.get_sample_count() == num_samples); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = s.get_raw_samples(i, 1); BOOST_CHECK_EQUAL(*((uint32_t*)sample_data), i); delete[] sample_data; } uint8_t* sample_data = s.get_raw_samples(0, num_samples); for (uint32_t i = 0; i < num_samples; i++) { BOOST_CHECK_EQUAL(*((uint32_t*)(sample_data + i * sizeof(uint32_t))), i); } delete[] sample_data; } BOOST_AUTO_TEST_CASE(MaxSize32MultiIterated) { Segment s(1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = 2*(pv::data::Segment::MaxChunkSize / sizeof(uint32_t)); //----- Chunk size == pv::data::Segment::MaxChunkSize @ 32bit, added in num_samples calls ----// uint32_t data; for (uint32_t i = 0; i < num_samples; i++) { data = i; s.append_samples(&data, 1); } BOOST_CHECK(s.get_sample_count() == num_samples); pv::data::SegmentRawDataIterator* it = s.begin_raw_sample_iteration(0); for (uint32_t i = 0; i < num_samples; i++) { uint8_t* sample_data = it->value; BOOST_CHECK_EQUAL(*((uint32_t*)sample_data), i); s.continue_raw_sample_iteration(it, 1); } s.end_raw_sample_iteration(it); } BOOST_AUTO_TEST_SUITE_END() pulseview-0.4.0/test/data/logicsegment.cpp000600 001750 001750 00000035520 13117760426 020260 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #if 0 using pv::data::LogicSegment; using std::vector; #endif // Dummy, remove again when unit tests are fixed. BOOST_AUTO_TEST_SUITE(DummyTestSuite) BOOST_AUTO_TEST_CASE(DummyTestCase) { BOOST_CHECK_EQUAL(1, 1); } BOOST_AUTO_TEST_SUITE_END() #if 0 BOOST_AUTO_TEST_SUITE(LogicSegmentTest) void push_logic(LogicSegment &s, unsigned int length, uint8_t value) { sr_datafeed_logic logic; logic.unitsize = 1; logic.length = length; logic.data = new uint8_t[length]; memset(logic.data, value, length * logic.unitsize); s.append_payload(logic); delete[] (uint8_t*)logic.data; } BOOST_AUTO_TEST_CASE(Pow2) { BOOST_CHECK_EQUAL(LogicSegment::pow2_ceil(0, 0), 0); BOOST_CHECK_EQUAL(LogicSegment::pow2_ceil(1, 0), 1); BOOST_CHECK_EQUAL(LogicSegment::pow2_ceil(2, 0), 2); BOOST_CHECK_EQUAL( LogicSegment::pow2_ceil(INT64_MIN, 0), INT64_MIN); BOOST_CHECK_EQUAL( LogicSegment::pow2_ceil(INT64_MAX, 0), INT64_MAX); BOOST_CHECK_EQUAL(LogicSegment::pow2_ceil(0, 1), 0); BOOST_CHECK_EQUAL(LogicSegment::pow2_ceil(1, 1), 2); BOOST_CHECK_EQUAL(LogicSegment::pow2_ceil(2, 1), 2); BOOST_CHECK_EQUAL(LogicSegment::pow2_ceil(3, 1), 4); } BOOST_AUTO_TEST_CASE(Basic) { // Create an empty LogicSegment object sr_datafeed_logic logic; logic.length = 0; logic.unitsize = 1; logic.data = nullptr; LogicSegment s(logic); //----- Test LogicSegment::push_logic -----// BOOST_CHECK(s.get_sample_count() == 0); for (unsigned int i = 0; i < LogicSegment::ScaleStepCount; i++) { const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.data == nullptr); } // Push 8 samples of all zeros push_logic(s, 8, 0); BOOST_CHECK(s.get_sample_count() == 8); // There should not be enough samples to have a single mip map sample for (unsigned int i = 0; i < LogicSegment::ScaleStepCount; i++) { const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.data == nullptr); } // Push 8 samples of 0x11s to bring the total up to 16 push_logic(s, 8, 0x11); // There should now be enough data for exactly one sample // in mip map level 0, and that sample should be 0 const LogicSegment::MipMapLevel &m0 = s.mip_map_[0]; BOOST_CHECK_EQUAL(m0.length, 1); BOOST_CHECK_EQUAL(m0.data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(m0.data != nullptr); BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[0], 0x11); // The higher levels should still be empty for (unsigned int i = 1; i < LogicSegment::ScaleStepCount; i++) { const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.data == nullptr); } // Push 240 samples of all zeros to bring the total up to 256 push_logic(s, 240, 0); BOOST_CHECK_EQUAL(m0.length, 16); BOOST_CHECK_EQUAL(m0.data_length, LogicSegment::MipMapDataUnit); BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[1], 0x11); for (unsigned int i = 2; i < m0.length; i++) BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[i], 0); const LogicSegment::MipMapLevel &m1 = s.mip_map_[1]; BOOST_CHECK_EQUAL(m1.length, 1); BOOST_CHECK_EQUAL(m1.data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(m1.data != nullptr); BOOST_CHECK_EQUAL(((uint8_t*)m1.data)[0], 0x11); //----- Test LogicSegment::get_subsampled_edges -----// // Test a full view at full zoom. vector edges; s.get_subsampled_edges(edges, 0, 255, 1, 0); BOOST_REQUIRE_EQUAL(edges.size(), 4); BOOST_CHECK_EQUAL(edges[0].first, 0); BOOST_CHECK_EQUAL(edges[1].first, 8); BOOST_CHECK_EQUAL(edges[2].first, 16); BOOST_CHECK_EQUAL(edges[3].first, 256); // Test a subset at high zoom edges.clear(); s.get_subsampled_edges(edges, 6, 17, 0.05f, 0); BOOST_REQUIRE_EQUAL(edges.size(), 4); BOOST_CHECK_EQUAL(edges[0].first, 6); BOOST_CHECK_EQUAL(edges[1].first, 8); BOOST_CHECK_EQUAL(edges[2].first, 16); BOOST_CHECK_EQUAL(edges[3].first, 18); } BOOST_AUTO_TEST_CASE(LargeData) { uint8_t prev_sample; const unsigned int Length = 1000000; sr_datafeed_logic logic; logic.unitsize = 1; logic.length = Length; logic.data = new uint8_t[Length]; uint8_t *data = (uint8_t*)logic.data; for (unsigned int i = 0; i < Length; i++) *data++ = (uint8_t)(i >> 8); LogicSegment s(logic); delete[] (uint8_t*)logic.data; BOOST_CHECK(s.get_sample_count() == Length); // Check mip map level 0 BOOST_CHECK_EQUAL(s.mip_map_[0].length, 62500); BOOST_CHECK_EQUAL(s.mip_map_[0].data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(s.mip_map_[0].data != nullptr); prev_sample = 0; for (unsigned int i = 0; i < s.mip_map_[0].length;) { BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]"); const uint8_t sample = (uint8_t)((i*16) >> 8); BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, prev_sample ^ sample); prev_sample = sample; for (int j = 1; i < s.mip_map_[0].length && j < 16; j++) { BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]"); BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0); } } // Check mip map level 1 BOOST_CHECK_EQUAL(s.mip_map_[1].length, 3906); BOOST_CHECK_EQUAL(s.mip_map_[1].data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(s.mip_map_[1].data != nullptr); prev_sample = 0; for (unsigned int i = 0; i < s.mip_map_[1].length; i++) { BOOST_TEST_MESSAGE("Testing mip_map[1].data[" << i << "]"); const uint8_t sample = i; const uint8_t expected = sample ^ prev_sample; prev_sample = i; BOOST_CHECK_EQUAL(s.get_subsample(1, i) & 0xFF, expected); } // Check mip map level 2 BOOST_CHECK_EQUAL(s.mip_map_[2].length, 244); BOOST_CHECK_EQUAL(s.mip_map_[2].data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(s.mip_map_[2].data != nullptr); prev_sample = 0; for (unsigned int i = 0; i < s.mip_map_[2].length; i++) { BOOST_TEST_MESSAGE("Testing mip_map[2].data[" << i << "]"); const uint8_t sample = i << 4; const uint8_t expected = (sample ^ prev_sample) | 0x0F; prev_sample = sample; BOOST_CHECK_EQUAL(s.get_subsample(2, i) & 0xFF, expected); } // Check mip map level 3 BOOST_CHECK_EQUAL(s.mip_map_[3].length, 15); BOOST_CHECK_EQUAL(s.mip_map_[3].data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(s.mip_map_[3].data != nullptr); for (unsigned int i = 0; i < s.mip_map_[3].length; i++) BOOST_CHECK_EQUAL(*((uint8_t*)s.mip_map_[3].data + i), 0xFF); // Check the higher levels for (unsigned int i = 4; i < LogicSegment::ScaleStepCount; i++) { const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.data == nullptr); } //----- Test LogicSegment::get_subsampled_edges -----// // Check in normal case vector edges; s.get_subsampled_edges(edges, 0, Length-1, 1, 7); BOOST_CHECK_EQUAL(edges.size(), 32); for (unsigned int i = 0; i < edges.size() - 1; i++) { BOOST_CHECK_EQUAL(edges[i].first, i * 32768); BOOST_CHECK_EQUAL(edges[i].second, i & 1); } BOOST_CHECK_EQUAL(edges[31].first, 1000000); // Check in very low zoom case edges.clear(); s.get_subsampled_edges(edges, 0, Length-1, 50e6f, 7); BOOST_CHECK_EQUAL(edges.size(), 2); } BOOST_AUTO_TEST_CASE(Pulses) { const int Cycles = 3; const int Period = 64; const int Length = Cycles * Period; vector edges; //----- Create a LogicSegment -----// sr_datafeed_logic logic; logic.unitsize = 1; logic.length = Length; logic.data = (uint64_t*)new uint8_t[Length]; uint8_t *p = (uint8_t*)logic.data; for (int i = 0; i < Cycles; i++) { *p++ = 0xFF; for (int j = 1; j < Period; j++) *p++ = 0x00; } LogicSegment s(logic); delete[] (uint8_t*)logic.data; //----- Check the mip-map -----// // Check mip map level 0 BOOST_CHECK_EQUAL(s.mip_map_[0].length, 12); BOOST_CHECK_EQUAL(s.mip_map_[0].data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(s.mip_map_[0].data != nullptr); for (unsigned int i = 0; i < s.mip_map_[0].length;) { BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]"); BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0xFF); for (int j = 1; i < s.mip_map_[0].length && j < Period/LogicSegment::MipMapScaleFactor; j++) { BOOST_TEST_MESSAGE( "Testing mip_map[0].data[" << i << "]"); BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0x00); } } // Check the higher levels are all inactive for (unsigned int i = 1; i < LogicSegment::ScaleStepCount; i++) { const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.data == nullptr); } //----- Test get_subsampled_edges at reduced scale -----// s.get_subsampled_edges(edges, 0, Length-1, 16.0f, 2); BOOST_REQUIRE_EQUAL(edges.size(), Cycles + 2); BOOST_CHECK_EQUAL(0, false); for (unsigned int i = 1; i < edges.size(); i++) BOOST_CHECK_EQUAL(edges[i].second, false); } BOOST_AUTO_TEST_CASE(LongPulses) { const int Cycles = 3; const int Period = 64; const int PulseWidth = 16; const int Length = Cycles * Period; int j; vector edges; //----- Create a LogicSegment -----// sr_datafeed_logic logic; logic.unitsize = 8; logic.length = Length * 8; logic.data = (uint64_t*)new uint64_t[Length]; uint64_t *p = (uint64_t*)logic.data; for (int i = 0; i < Cycles; i++) { for (j = 0; j < PulseWidth; j++) *p++ = ~0; for (; j < Period; j++) *p++ = 0; } LogicSegment s(logic); delete[] (uint64_t*)logic.data; //----- Check the mip-map -----// // Check mip map level 0 BOOST_CHECK_EQUAL(s.mip_map_[0].length, 12); BOOST_CHECK_EQUAL(s.mip_map_[0].data_length, LogicSegment::MipMapDataUnit); BOOST_REQUIRE(s.mip_map_[0].data != nullptr); for (unsigned int i = 0; i < s.mip_map_[0].length;) { for (j = 0; i < s.mip_map_[0].length && j < 2; j++) { BOOST_TEST_MESSAGE( "Testing mip_map[0].data[" << i << "]"); BOOST_CHECK_EQUAL(s.get_subsample(0, i++), ~0); } for (; i < s.mip_map_[0].length && j < Period/LogicSegment::MipMapScaleFactor; j++) { BOOST_TEST_MESSAGE( "Testing mip_map[0].data[" << i << "]"); BOOST_CHECK_EQUAL(s.get_subsample(0, i++), 0); } } // Check the higher levels are all inactive for (unsigned int i = 1; i < LogicSegment::ScaleStepCount; i++) { const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); BOOST_CHECK(m.data == nullptr); } //----- Test get_subsampled_edges at a full scale -----// s.get_subsampled_edges(edges, 0, Length-1, 16.0f, 2); BOOST_REQUIRE_EQUAL(edges.size(), Cycles * 2 + 1); for (int i = 0; i < Cycles; i++) { BOOST_CHECK_EQUAL(edges[i*2].first, i * Period); BOOST_CHECK_EQUAL(edges[i*2].second, true); BOOST_CHECK_EQUAL(edges[i*2+1].first, i * Period + PulseWidth); BOOST_CHECK_EQUAL(edges[i*2+1].second, false); } BOOST_CHECK_EQUAL(edges.back().first, Length); BOOST_CHECK_EQUAL(edges.back().second, false); //----- Test get_subsampled_edges at a simplified scale -----// edges.clear(); s.get_subsampled_edges(edges, 0, Length-1, 17.0f, 2); BOOST_CHECK_EQUAL(edges[0].first, 0); BOOST_CHECK_EQUAL(edges[0].second, true); BOOST_CHECK_EQUAL(edges[1].first, 16); BOOST_CHECK_EQUAL(edges[1].second, false); for (int i = 1; i < Cycles; i++) { BOOST_CHECK_EQUAL(edges[i+1].first, i * Period); BOOST_CHECK_EQUAL(edges[i+1].second, false); } BOOST_CHECK_EQUAL(edges.back().first, Length); BOOST_CHECK_EQUAL(edges.back().second, false); } BOOST_AUTO_TEST_CASE(LisaMUsbHid) { /* This test was created from the beginning of the USB_DM signal in * sigrok-dumps-usb/lisa_m_usbhid/lisa_m_usbhid.sr */ const int Edges[] = { 7028, 7033, 7036, 7041, 7044, 7049, 7053, 7066, 7073, 7079, 7086, 7095, 7103, 7108, 7111, 7116, 7119, 7124, 7136, 7141, 7148, 7162, 7500 }; const int Length = Edges[countof(Edges) - 1]; bool state = false; int lastEdgePos = 0; //----- Create a LogicSegment -----// sr_datafeed_logic logic; logic.unitsize = 1; logic.length = Length; logic.data = new uint8_t[Length]; uint8_t *data = (uint8_t*)logic.data; for (unsigned int i = 0; i < countof(Edges); i++) { const int edgePos = Edges[i]; memset(&data[lastEdgePos], state ? 0x02 : 0, edgePos - lastEdgePos - 1); lastEdgePos = edgePos; state = !state; } LogicSegment s(logic); delete[] (uint64_t*)logic.data; vector edges; /* The trailing edge of the pulse train is falling in the source data. * Check this is always true at different scales */ edges.clear(); s.get_subsampled_edges(edges, 0, Length-1, 33.333332f, 1); BOOST_CHECK_EQUAL(edges[edges.size() - 2].second, false); } /* * This test checks the rendering of wide data (more than 8 channels) * Probe signals are either all-high, or all-low, but are interleaved such that * they would toggle during every sample if treated like 8 channels. * The packet contains a large number of samples, so the mipmap generation kicks * in. * * The signals should not toggle (have exactly two edges: the start and end) */ BOOST_AUTO_TEST_CASE(WideData) { const int Length = 512<<10; uint16_t *data = new uint16_t[Length]; sr_datafeed_logic logic; logic.unitsize = sizeof(data[0]); logic.length = Length * sizeof(data[0]); logic.data = data; for (int i = 0; i < Length; i++) data[i] = 0x0FF0; LogicSegment s(logic); vector edges; edges.clear(); s.get_subsampled_edges(edges, 0, Length-1, 1, 0); BOOST_CHECK_EQUAL(edges.size(), 2); edges.clear(); s.get_subsampled_edges(edges, 0, Length-1, 1, 8); BOOST_CHECK_EQUAL(edges.size(), 2); // Cleanup delete [] data; } /* * This test is a replica of sixteen.sr attached to Bug #33. */ BOOST_AUTO_TEST_CASE(Sixteen) { const int Length = 8; uint16_t data[Length]; sr_datafeed_logic logic; logic.unitsize = sizeof(data[0]); logic.length = Length * sizeof(data[0]); logic.data = data; for (int i = 0; i < Length; i++) data[i] = 0xFFFE; LogicSegment s(logic); vector edges; s.get_subsampled_edges(edges, 0, 2, 0.0004, 1); BOOST_CHECK_EQUAL(edges.size(), 2); } BOOST_AUTO_TEST_SUITE_END() #endif pulseview-0.4.0/test/util.cpp000600 001750 001750 00000030012 13117760426 015633 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Jens Steinhauser * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include "pv/util.hpp" #include "test/test.hpp" using namespace pv::util; using ts = pv::util::Timestamp; using std::bind; namespace { QChar mu = QChar(0x03BC); pv::util::SIPrefix unspecified = pv::util::SIPrefix::unspecified; pv::util::SIPrefix yocto = pv::util::SIPrefix::yocto; pv::util::SIPrefix nano = pv::util::SIPrefix::nano; /* pv::util::SIPrefix micro = pv::util::SIPrefix::micro; // Not currently used */ pv::util::SIPrefix milli = pv::util::SIPrefix::milli; pv::util::SIPrefix none = pv::util::SIPrefix::none; pv::util::SIPrefix kilo = pv::util::SIPrefix::kilo; pv::util::SIPrefix yotta = pv::util::SIPrefix::yotta; /* pv::util::TimeUnit Time = pv::util::TimeUnit::Time; // Not currently used */ } // namespace BOOST_AUTO_TEST_SUITE(UtilTest) BOOST_AUTO_TEST_CASE(exponent_test) { BOOST_CHECK_EQUAL(exponent(SIPrefix::yocto), -24); BOOST_CHECK_EQUAL(exponent(SIPrefix::zepto), -21); BOOST_CHECK_EQUAL(exponent(SIPrefix::atto), -18); BOOST_CHECK_EQUAL(exponent(SIPrefix::femto), -15); BOOST_CHECK_EQUAL(exponent(SIPrefix::pico), -12); BOOST_CHECK_EQUAL(exponent(SIPrefix::nano), -9); BOOST_CHECK_EQUAL(exponent(SIPrefix::micro), -6); BOOST_CHECK_EQUAL(exponent(SIPrefix::milli), -3); BOOST_CHECK_EQUAL(exponent(SIPrefix::none), 0); BOOST_CHECK_EQUAL(exponent(SIPrefix::kilo), 3); BOOST_CHECK_EQUAL(exponent(SIPrefix::mega), 6); BOOST_CHECK_EQUAL(exponent(SIPrefix::giga), 9); BOOST_CHECK_EQUAL(exponent(SIPrefix::tera), 12); BOOST_CHECK_EQUAL(exponent(SIPrefix::peta), 15); BOOST_CHECK_EQUAL(exponent(SIPrefix::exa), 18); BOOST_CHECK_EQUAL(exponent(SIPrefix::zetta), 21); BOOST_CHECK_EQUAL(exponent(SIPrefix::yotta), 24); } BOOST_AUTO_TEST_CASE(format_time_si_test) { // check prefix calculation BOOST_CHECK_EQUAL(format_time_si(ts("0")), "0 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-24")), "+1 ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-23")), "+10 ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-22")), "+100 ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-21")), "+1 zs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-20")), "+10 zs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-19")), "+100 zs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-18")), "+1 as"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-17")), "+10 as"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-16")), "+100 as"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-15")), "+1 fs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-14")), "+10 fs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-13")), "+100 fs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-12")), "+1 ps"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-11")), "+10 ps"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-10")), "+100 ps"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-9")), "+1 ns"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-8")), "+10 ns"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-7")), "+100 ns"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-6")), QString("+1 ") + mu + "s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-5")), QString("+10 ") + mu + "s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-4")), QString("+100 ") + mu + "s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-3")), "+1 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-2")), "+10 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-1")), "+100 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e0")), "+1 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e1")), "+10 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e2")), "+100 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e3")), "+1 ks"); BOOST_CHECK_EQUAL(format_time_si(ts("1e4")), "+10 ks"); BOOST_CHECK_EQUAL(format_time_si(ts("1e5")), "+100 ks"); BOOST_CHECK_EQUAL(format_time_si(ts("1e6")), "+1 Ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e7")), "+10 Ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e8")), "+100 Ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e9")), "+1 Gs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e10")), "+10 Gs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e11")), "+100 Gs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e12")), "+1 Ts"); BOOST_CHECK_EQUAL(format_time_si(ts("1e13")), "+10 Ts"); BOOST_CHECK_EQUAL(format_time_si(ts("1e14")), "+100 Ts"); BOOST_CHECK_EQUAL(format_time_si(ts("1e15")), "+1 Ps"); BOOST_CHECK_EQUAL(format_time_si(ts("1e16")), "+10 Ps"); BOOST_CHECK_EQUAL(format_time_si(ts("1e17")), "+100 Ps"); BOOST_CHECK_EQUAL(format_time_si(ts("1e18")), "+1 Es"); BOOST_CHECK_EQUAL(format_time_si(ts("1e19")), "+10 Es"); BOOST_CHECK_EQUAL(format_time_si(ts("1e20")), "+100 Es"); BOOST_CHECK_EQUAL(format_time_si(ts("1e21")), "+1 Zs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e22")), "+10 Zs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e23")), "+100 Zs"); BOOST_CHECK_EQUAL(format_time_si(ts("1e24")), "+1 Ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e25")), "+10 Ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e26")), "+100 Ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e27")), "+1000 Ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1234")), "+1 ks"); BOOST_CHECK_EQUAL(format_time_si(ts("1234"), kilo, 3), "+1.234 ks"); BOOST_CHECK_EQUAL(format_time_si(ts("1234.5678")), "+1 ks"); // check prefix BOOST_CHECK_EQUAL(format_time_si(ts("1e-24"), yocto), "+1 ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-21"), yocto), "+1000 ys"); BOOST_CHECK_EQUAL(format_time_si(ts("0"), yocto), "0 ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-4"), milli), "+0 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-4"), milli, 1), "+0.1 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1000"), milli), "+1000000 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("0"), milli), "0 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-1"), none), "+0 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-1"), none, 1), "+0.1 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e-1"), none, 2), "+0.10 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1"), none), "+1 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e1"), none), "+10 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1e23"), yotta), "+0 Ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e23"), yotta, 1), "+0.1 Ys"); BOOST_CHECK_EQUAL(format_time_si(ts("1e27"), yotta), "+1000 Ys"); BOOST_CHECK_EQUAL(format_time_si(ts("0"), yotta), "0 Ys"); // check precision, rounding BOOST_CHECK_EQUAL(format_time_si(ts("1.2345678")), "+1 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1.4")), "+1 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1.5")), "+2 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1.9")), "+2 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1.2345678"), unspecified, 2), "+1.23 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1.2345678"), unspecified, 3), "+1.235 s"); BOOST_CHECK_EQUAL(format_time_si(ts("1.2345678"), milli, 3), "+1234.568 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1.2345678"), milli, 0), "+1235 ms"); BOOST_CHECK_EQUAL(format_time_si(ts("1.2"), unspecified, 3), "+1.200 s"); // check unit and sign BOOST_CHECK_EQUAL(format_time_si(ts("-1"), none, 0, "V", true), "-1 V"); BOOST_CHECK_EQUAL(format_time_si(ts("-1"), none, 0, "V", false), "-1 V"); BOOST_CHECK_EQUAL(format_time_si(ts("1"), none, 0, "V", true), "+1 V"); BOOST_CHECK_EQUAL(format_time_si(ts("1"), none, 0, "V", false), "1 V"); } BOOST_AUTO_TEST_CASE(format_time_si_adjusted_test) { BOOST_CHECK_EQUAL(format_time_si_adjusted(ts("-1.5"), milli), "-1500 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts("-1.0"), milli), "-1000 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts("-0.2"), milli), "-200 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts("-0.1"), milli), "-100 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.0"), milli), "0 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.1"), milli), "+100 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.2"), milli), "+200 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.3"), milli), "+300 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.4"), milli), "+400 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.5"), milli), "+500 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.6"), milli), "+600 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.7"), milli), "+700 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.8"), milli), "+800 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "0.9"), milli), "+900 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.0"), milli), "+1000 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.1"), milli), "+1100 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.2"), milli), "+1200 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.3"), milli), "+1300 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.4"), milli), "+1400 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.5"), milli), "+1500 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.5"), milli, 6), "+1500.000 ms"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.5"), nano, 6), "+1500000000 ns"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.5"), nano, 8), "+1500000000 ns"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.5"), nano, 9), "+1500000000 ns"); BOOST_CHECK_EQUAL(format_time_si_adjusted(ts( "1.5"), nano, 10), "+1500000000.0 ns"); } BOOST_AUTO_TEST_CASE(format_time_minutes_test) { using namespace std::placeholders; auto fmt = bind(format_time_minutes, _1, _2, true); BOOST_CHECK_EQUAL(fmt(ts( 0), 0), "+0:00"); BOOST_CHECK_EQUAL(fmt(ts( 1), 0), "+0:01"); BOOST_CHECK_EQUAL(fmt(ts( 59), 0), "+0:59"); BOOST_CHECK_EQUAL(fmt(ts( 60), 0), "+1:00"); BOOST_CHECK_EQUAL(fmt(ts( -1), 0), "-0:01"); BOOST_CHECK_EQUAL(fmt(ts( -59), 0), "-0:59"); BOOST_CHECK_EQUAL(fmt(ts( -60), 0), "-1:00"); BOOST_CHECK_EQUAL(fmt(ts( 100), 0), "+1:40"); BOOST_CHECK_EQUAL(fmt(ts( -100), 0), "-1:40"); BOOST_CHECK_EQUAL(fmt(ts( 4000), 0), "+1:06:40"); BOOST_CHECK_EQUAL(fmt(ts(-4000), 0), "-1:06:40"); BOOST_CHECK_EQUAL(fmt(ts(12000), 0), "+3:20:00"); BOOST_CHECK_EQUAL(fmt(ts(15000), 0), "+4:10:00"); BOOST_CHECK_EQUAL(fmt(ts(20000), 0), "+5:33:20"); BOOST_CHECK_EQUAL(fmt(ts(25000), 0), "+6:56:40"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 0), "+123:04:05:06"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 1), "+123:04:05:06.0"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 2), "+123:04:05:06.01"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 3), "+123:04:05:06.007"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 4), "+123:04:05:06.007 0"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 5), "+123:04:05:06.007 01"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 6), "+123:04:05:06.007 008"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 7), "+123:04:05:06.007 008 0"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 8), "+123:04:05:06.007 008 01"); BOOST_CHECK_EQUAL(fmt(ts("10641906.007008009"), 9), "+123:04:05:06.007 008 009"); BOOST_CHECK_EQUAL(format_time_minutes(ts( 0), 0, false), "0:00"); BOOST_CHECK_EQUAL(format_time_minutes(ts( 100), 0, false), "1:40"); BOOST_CHECK_EQUAL(format_time_minutes(ts(-100), 0, false), "-1:40"); } BOOST_AUTO_TEST_SUITE_END() pulseview-0.4.0/test/test.cpp000600 001750 001750 00000001722 13117760426 015643 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #define BOOST_TEST_MAIN #include "test/test.hpp" #include using std::ostream; ostream& operator<<(ostream& stream, const QString& str) { return stream << str.toUtf8().data(); } pulseview-0.4.0/android/000700 001750 001750 00000000000 13117760503 014611 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/custom_rules.xml000600 001750 001750 00000011315 13117760425 020065 0ustar00uweuwe000000 000000 pulseview-0.4.0/android/res/000700 001750 001750 00000000000 13117760503 015402 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/res/layout/000700 001750 001750 00000000000 13117760503 016717 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/res/layout/splash.xml000600 001750 001750 00000001546 13117760425 020746 0ustar00uweuwe000000 000000 pulseview-0.4.0/android/res/values/000700 001750 001750 00000000000 13117760503 016701 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/res/values/libs.xml000600 001750 001750 00000004374 13117760425 020371 0ustar00uweuwe000000 000000 https://download.qt-project.org/ministro/android/qt5/qt-5.3 gnustl_shared Qt5Core Qt5Gui Qt5Widgets Qt5Svg libplugins_platforms_android_libqtforandroid.so:plugins/platforms/android/libqtforandroid.so libplugins_platforms_libqeglfs.so:plugins/platforms/libqeglfs.so libplugins_platforms_libqminimal.so:plugins/platforms/libqminimal.so libplugins_platforms_libqminimalegl.so:plugins/platforms/libqminimalegl.so libplugins_platforms_libqoffscreen.so:plugins/platforms/libqoffscreen.so libplugins_generic_libqevdevkeyboardplugin.so:plugins/generic/libqevdevkeyboardplugin.so libplugins_generic_libqevdevmouseplugin.so:plugins/generic/libqevdevmouseplugin.so libplugins_generic_libqevdevtabletplugin.so:plugins/generic/libqevdevtabletplugin.so libplugins_generic_libqevdevtouchplugin.so:plugins/generic/libqevdevtouchplugin.so libplugins_imageformats_libqsvg.so:plugins/imageformats/libqsvg.so libplugins_iconengines_libqsvgicon.so:plugins/iconengines/libqsvgicon.so pulseview-0.4.0/android/res/values/strings-pv.xml000600 001750 001750 00000001543 13117760425 021547 0ustar00uweuwe000000 000000 PulseView pulseview-0.4.0/android/loghandler.cpp000600 001750 001750 00000005370 13117760425 017446 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2014 Marcus Comstedt * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifdef ENABLE_DECODE #include /* First, so we avoid a _POSIX_C_SOURCE warning. */ #endif #include #include #include #include "android/loghandler.hpp" namespace pv { int AndroidLogHandler::sr_callback(void *cb_data, int loglevel, const char *format, va_list args) { static const int prio[] = { [SR_LOG_NONE] = ANDROID_LOG_SILENT, [SR_LOG_ERR] = ANDROID_LOG_ERROR, [SR_LOG_WARN] = ANDROID_LOG_WARN, [SR_LOG_INFO] = ANDROID_LOG_INFO, [SR_LOG_DBG] = ANDROID_LOG_DEBUG, [SR_LOG_SPEW] = ANDROID_LOG_VERBOSE, }; int ret; /* This specific log callback doesn't need the void pointer data. */ (void)cb_data; /* Only output messages of at least the selected loglevel(s). */ if (loglevel > sr_log_loglevel_get()) return SR_OK; if (loglevel < SR_LOG_NONE) loglevel = SR_LOG_NONE; else if (loglevel > SR_LOG_SPEW) loglevel = SR_LOG_SPEW; ret = __android_log_vprint(prio[loglevel], "sr", format, args); return ret; } int AndroidLogHandler::srd_callback(void *cb_data, int loglevel, const char *format, va_list args) { #ifdef ENABLE_DECODE static const int prio[] = { [SRD_LOG_NONE] = ANDROID_LOG_SILENT, [SRD_LOG_ERR] = ANDROID_LOG_ERROR, [SRD_LOG_WARN] = ANDROID_LOG_WARN, [SRD_LOG_INFO] = ANDROID_LOG_INFO, [SRD_LOG_DBG] = ANDROID_LOG_DEBUG, [SRD_LOG_SPEW] = ANDROID_LOG_VERBOSE, }; int ret; /* This specific log callback doesn't need the void pointer data. */ (void)cb_data; /* Only output messages of at least the selected loglevel(s). */ if (loglevel > srd_log_loglevel_get()) return SRD_OK; if (loglevel < SRD_LOG_NONE) loglevel = SRD_LOG_NONE; else if (loglevel > SRD_LOG_SPEW) loglevel = SRD_LOG_SPEW; ret = __android_log_vprint(prio[loglevel], "srd", format, args); return ret; #else return 0; #endif } void AndroidLogHandler::install_callbacks() { sr_log_callback_set(sr_callback, nullptr); #ifdef ENABLE_DECODE srd_log_callback_set(srd_callback, nullptr); #endif } } // namespace pv pulseview-0.4.0/android/bundled_libs.xml.in000600 001750 001750 00000001554 13117760425 020400 0ustar00uweuwe000000 000000 @bundled_libs@ pulseview-0.4.0/android/loghandler.hpp000600 001750 001750 00000002263 13117760425 017451 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2014 Marcus Comstedt * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PULSEVIEW_ANDROID_LOGHANDLER_HPP #define PULSEVIEW_ANDROID_LOGHANDLER_HPP #include namespace pv { class AndroidLogHandler { private: static int sr_callback(void *cb_data, int loglevel, const char *format, va_list args); static int srd_callback(void *cb_data, int loglevel, const char *format, va_list args); public: static void install_callbacks(); }; } // namespace pv #endif // PULSEVIEW_ANDROID_LOGHANDLER_HPP pulseview-0.4.0/android/assetreader.cpp000600 001750 001750 00000004507 13117760425 017632 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Daniel Elstner * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "assetreader.hpp" #include #include #include #include #include using namespace pv; using std::string; using std::unique_ptr; void AndroidAssetReader::open(struct sr_resource *res, string name) { if (res->type == SR_RESOURCE_FIRMWARE) { auto path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString::fromStdString("sigrok-firmware/" + name)); if (path.isEmpty()) path = QString::fromStdString("assets:/sigrok-firmware/" + name); unique_ptr file {new QFile{path}}; if (!file->open(QIODevice::ReadOnly)) throw sigrok::Error{SR_ERR}; const auto size = file->size(); if (size < 0) throw sigrok::Error{SR_ERR}; res->size = size; res->handle = file.release(); } else { qWarning() << "AndroidAssetReader: Unknown resource type" << res->type; throw sigrok::Error{SR_ERR}; } } void AndroidAssetReader::close(struct sr_resource *res) { if (!res->handle) { qCritical("AndroidAssetReader: Invalid handle"); throw sigrok::Error{SR_ERR_ARG}; } const unique_ptr file {static_cast(res->handle)}; res->handle = nullptr; file->close(); } size_t AndroidAssetReader::read(const struct sr_resource *res, void *buf, size_t count) { if (!res->handle) { qCritical("AndroidAssetReader: Invalid handle"); throw sigrok::Error{SR_ERR_ARG}; } auto *const file = static_cast(res->handle); const auto n_read = file->read(static_cast(buf), count); if (n_read < 0) throw sigrok::Error{SR_ERR}; return n_read; } pulseview-0.4.0/android/assetreader.hpp000600 001750 001750 00000002471 13117760425 017635 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Daniel Elstner * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PULSEVIEW_ANDROID_ASSETREADER_HPP #define PULSEVIEW_ANDROID_ASSETREADER_HPP #include using std::string; namespace pv { class AndroidAssetReader : public sigrok::ResourceReader { public: AndroidAssetReader() = default; virtual ~AndroidAssetReader() = default; private: void open(struct sr_resource *res, string name) override; void close(struct sr_resource *res) override; size_t read(const struct sr_resource *res, void *buf, size_t count) override; }; } // namespace pv #endif // !PULSEVIEW_ANDROID_ASSETREADER_HPP pulseview-0.4.0/android/src/000700 001750 001750 00000000000 13117760503 015400 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/src/org/000700 001750 001750 00000000000 13117760503 016167 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/src/org/sigrok/000700 001750 001750 00000000000 13117760503 017465 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/src/org/sigrok/pulseview/000700 001750 001750 00000000000 13117760503 021510 5ustar00uweuwe000000 000000 pulseview-0.4.0/android/src/org/sigrok/pulseview/PulseViewActivity.java000600 001750 001750 00000002523 13117760425 026022 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2014 Marcus Comstedt * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package org.sigrok.pulseview; import org.qtproject.qt5.android.bindings.QtActivity; import org.sigrok.androidutils.UsbSupplicant; import android.os.Bundle; public class PulseViewActivity extends QtActivity { private UsbSupplicant supplicant; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); supplicant = new UsbSupplicant(getApplicationContext(), R.xml.device_filter); } @Override protected void onStart() { super.onStart(); supplicant.start(); } @Override protected void onStop() { supplicant.stop(); super.onStop(); } } pulseview-0.4.0/android/src/org/sigrok/pulseview/PulseViewApplication.java000600 001750 001750 00000002305 13117760425 026467 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2014 Marcus Comstedt * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package org.sigrok.pulseview; import org.qtproject.qt5.android.bindings.QtApplication; import org.sigrok.androidutils.Environment; import org.sigrok.androidutils.UsbHelper; import java.io.File; import java.io.IOException; public class PulseViewApplication extends QtApplication { @Override public void onCreate() { Environment.initEnvironment(getApplicationInfo().sourceDir); UsbHelper.setContext(getApplicationContext()); super.onCreate(); } } pulseview-0.4.0/android/AndroidManifest.xml000600 001750 001750 00000007526 13117760425 020421 0ustar00uweuwe000000 000000 pulseview-0.4.0/pulseviewico.rc000600 001750 001750 00000000061 13117760425 016237 0ustar00uweuwe000000 000000 IDI_ICON1 ICON DISCARDABLE "icons/pulseview.ico" pulseview-0.4.0/doc/000700 001750 001750 00000000000 13117760503 013736 5ustar00uweuwe000000 000000 pulseview-0.4.0/doc/pulseview.1000600 001750 001750 00000006223 13117760425 016053 0ustar00uweuwe000000 000000 .TH PULSEVIEW 1 "June 6, 2017" .SH "NAME" PulseView \- Qt-based LA/scope/MSO GUI for sigrok .SH "SYNOPSIS" .B pulseview \fR[\fBOPTIONS\fR] [\fBFILE\fR] .SH "DESCRIPTION" .B PulseView is a cross-platform Qt-based GUI for the .B sigrok software suite for test and measurement equipment such as logic analyzers, oscilloscopes, MSOs, and more. .SH "OPTIONS" .B PulseView has very few command line options, as most configuration elements are available from the GUI itself. .sp If the optional \fBFILE\fR argument is supplied, PulseView tries to open the specified file. It has to be in the "libsigrok session" format (.sr) unless -I is used to specify the input file format. .TP .B "\-l, \-\-loglevel" Set the libsigrok and libsigrokdecode loglevel. At the moment PulseView doesn't support setting the two loglevels independently. The higher the number, the more debug output will be printed. Valid loglevels are: .sp \fB0\fP None .br \fB1\fP Error .br \fB2\fP Warnings .br \fB3\fP Informational .br \fB4\fP Debug .br \fB5\fP Spew .TP .B "\-h, \-?, \-\-help" Show a help text and exit. .TP .B "\-V, \-\-version" Show version information and exit. .TP .BR "\-i, \-\-input\-file " Load input from a file. If the .B \-\-input\-format option is not supplied, PulseView attempts to load the file as a sigrok session file. .TP .BR "\-I, \-\-input\-format " Specifies the format of the input file to be loaded. .TP .BR "\-c, \-\-clean" Prevents the previously used sessions to be restored from settings storage. This is useful if you want only a single session with the file given on the command line instead of restoring all previously used sessions as well. .SH "KEYBOARD SHORTCUTS" .TP .B "f" Zoom-to-fit. .TP .B "o" Zoom 1:1. .TP .B "s" Enable / disable sticky scrolling. When enabled, the right edge of the screen always shows the most recently captured data. .TP .B "." Show / hide sampling points. .TP .B "g" Show / hide analog minor grid (in addition to the vdiv grid). .TP .B "c" Show / hide cursors. .TP .B "b" Toggle between coloured trace backgrounds and alternating light/dark gray trace backgrounds. .TP .B "SPACE" Start / stop an acquisition. .TP .B "Arrow keys" Scroll up/down/left/right. .TP .B "CTRL+o" Open file. .TP .B "CTRL+s" Save as... .TP .B "CTRL+r" Save selected range as... .TP .B "CTRL+g" Group all currently selected traces into a trace group. .TP .B "CTRL+u" Ungroup the traces in the currently selected trace group. .TP .B "CTRL++" Zoom in. .TP .B "CTRL+-" Zoom out. .TP .B "CTRL+q" Quit, i.e. shutdown PulseView (closing all session tabs). .TP .B "CTRL+w" Close the current session tab. .SH "EXIT STATUS" .B PulseView exits with 0 on success, 1 on most failures. .SH "SEE ALSO" \fBsigrok\-cli\fP(1) .SH "BUGS" Please report any bugs via Bugzilla .RB "(" http://sigrok.org/bugzilla ")" or on the sigrok\-devel mailing list .RB "(" sigrok\-devel@lists.souceforge.net ")." .SH "LICENSE" .B PulseView is covered by the GNU General Public License (GPL), version 3 or later. .SH "AUTHORS" Please see the individual source code files. .PP This manual page was written by Uwe Hermann . It is licensed under the terms of the GNU GPL (version 2 or later). pulseview-0.4.0/main.cpp000600 001750 001750 00000011663 13117760425 014635 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifdef ENABLE_DECODE #include /* First, so we avoid a _POSIX_C_SOURCE warning. */ #endif #include #include #include #include #include #ifdef ENABLE_SIGNALS #include "signalhandler.hpp" #endif #include "pv/application.hpp" #include "pv/devicemanager.hpp" #include "pv/mainwindow.hpp" #ifdef ANDROID #include #include "android/assetreader.hpp" #include "android/loghandler.hpp" #endif #include "config.h" #ifdef _WIN32 #include Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) Q_IMPORT_PLUGIN(QSvgPlugin) #endif using std::exception; using std::shared_ptr; using std::string; void usage() { fprintf(stdout, "Usage:\n" " %s [OPTIONS] [FILE]\n" "\n" "Help Options:\n" " -h, -?, --help Show help option\n" "\n" "Application Options:\n" " -V, --version Show release version\n" " -l, --loglevel Set libsigrok/libsigrokdecode loglevel\n" " -i, --input-file Load input from file\n" " -I, --input-format Input format\n" " -c, --clean Don't restore previous sessions on startup\n" "\n", PV_BIN_NAME); } int main(int argc, char *argv[]) { int ret = 0; shared_ptr context; string open_file, open_file_format; bool restore_sessions = true; Application a(argc, argv); #ifdef ANDROID srau_init_environment(); pv::AndroidLogHandler::install_callbacks(); pv::AndroidAssetReader asset_reader; #endif // Parse arguments while (true) { static const struct option long_options[] = { {"help", no_argument, nullptr, 'h'}, {"version", no_argument, nullptr, 'V'}, {"loglevel", required_argument, nullptr, 'l'}, {"input-file", required_argument, nullptr, 'i'}, {"input-format", required_argument, nullptr, 'I'}, {"clean", no_argument, nullptr, 'c'}, {nullptr, 0, nullptr, 0} }; const int c = getopt_long(argc, argv, "l:Vhc?i:I:", long_options, nullptr); if (c == -1) break; switch (c) { case 'h': case '?': usage(); return 0; case 'V': // Print version info fprintf(stdout, "%s %s\n", PV_TITLE, PV_VERSION_STRING); return 0; case 'l': { const int loglevel = atoi(optarg); context->set_log_level(sigrok::LogLevel::get(loglevel)); #ifdef ENABLE_DECODE srd_log_loglevel_set(loglevel); #endif if (loglevel >= 5) { const QSettings settings; qDebug() << "Settings:" << settings.fileName() << "format" << settings.format(); } break; } case 'i': open_file = optarg; break; case 'I': open_file_format = optarg; break; case 'c': restore_sessions = false; break; } } if (argc - optind > 1) { fprintf(stderr, "Only one file can be opened.\n"); return 1; } if (argc - optind == 1) open_file = argv[argc - 1]; // Initialise libsigrok context = sigrok::Context::create(); #ifdef ANDROID context->set_resource_reader(&asset_reader); #endif do { #ifdef ENABLE_DECODE // Initialise libsigrokdecode if (srd_init(nullptr) != SRD_OK) { qDebug() << "ERROR: libsigrokdecode init failed."; break; } // Load the protocol decoders srd_decoder_load_all(); #endif try { // Create the device manager, initialise the drivers pv::DeviceManager device_manager(context); // Initialise the main window pv::MainWindow w(device_manager); w.show(); if (restore_sessions) w.restore_sessions(); if (!open_file.empty()) w.add_session_with_file(open_file, open_file_format); else w.add_default_session(); #ifdef ENABLE_SIGNALS if (SignalHandler::prepare_signals()) { SignalHandler *const handler = new SignalHandler(&w); QObject::connect(handler, SIGNAL(int_received()), &w, SLOT(close())); QObject::connect(handler, SIGNAL(term_received()), &w, SLOT(close())); } else { qWarning() << "Could not prepare signal handler."; } #endif // Run the application ret = a.exec(); } catch (exception e) { qDebug() << e.what(); } #ifdef ENABLE_DECODE // Destroy libsigrokdecode srd_exit(); #endif } while (false); return ret; } pulseview-0.4.0/pulseview.qrc000600 001750 001750 00000002556 13117760425 015740 0ustar00uweuwe000000 000000 icons/add-decoder.svg icons/application-exit.png icons/channels.svg icons/decoder-delete.svg icons/decoder-hidden.svg icons/decoder-shown.svg icons/document-new.png icons/document-open.png icons/document-save-as.png icons/information.svg icons/menu.svg icons/preferences-system.png icons/settings-views.svg icons/pulseview.png icons/pulseview.svg icons/status-green.svg icons/status-grey.svg icons/status-red.svg icons/show-cursors.svg icons/trigger-change.svg icons/trigger-falling.svg icons/trigger-high.svg icons/trigger-low.svg icons/trigger-marker-change.svg icons/trigger-marker-falling.svg icons/trigger-marker-high.svg icons/trigger-marker-low.svg icons/trigger-marker-rising.svg icons/trigger-none.svg icons/trigger-rising.svg icons/window-new.png icons/zoom-fit-best.png icons/zoom-in.png icons/zoom-original.png icons/zoom-out.png pulseview-0.4.0/signalhandler.hpp000600 001750 001750 00000002367 13117760426 016533 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Adam Reichold * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef SIGNALHANDLER_HPP #define SIGNALHANDLER_HPP #include class QSocketNotifier; class SignalHandler : public QObject { Q_OBJECT public: static bool prepare_signals(); public: explicit SignalHandler(QObject* parent = nullptr); Q_SIGNALS: void int_received(); void term_received(); private Q_SLOTS: void on_socket_notifier_activated(); private: static void handle_signals(int sig_number); private: QSocketNotifier* socket_notifier_; private: static int sockets_[2]; }; #endif // SIGNALHANDLER_HPP pulseview-0.4.0/CMake/000700 001750 001750 00000000000 13117760503 014151 5ustar00uweuwe000000 000000 pulseview-0.4.0/CMake/GetGitRevisionDescription.cmake.in000600 001750 001750 00000002403 13117760425 022672 0ustar00uweuwe000000 000000 # # Internal file for GetGitRevisionDescription.cmake # # Requires CMake 2.6 or newer (uses the 'function' command) # # Original Author: # 2009-2010 Ryan Pavlik # http://academic.cleardefinition.com # Iowa State University HCI Graduate Program/VRAC # # Copyright Iowa State University 2009-2010. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) set(HEAD_HASH) file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) if(HEAD_CONTENTS MATCHES "ref") # named branch string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") if(EXISTS "@GIT_DIR@/${HEAD_REF}") configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) else() configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") set(HEAD_HASH "${CMAKE_MATCH_1}") endif() endif() else() # detached HEAD configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) endif() if(NOT HEAD_HASH) file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) string(STRIP "${HEAD_HASH}" HEAD_HASH) endif() pulseview-0.4.0/CMake/GetGitRevisionDescription.cmake000600 001750 001750 00000010026 13117760425 022265 0ustar00uweuwe000000 000000 # - Returns a version string from Git # # These functions force a re-configure on each git commit so that you can # trust the values of the variables in your build system. # # get_git_head_revision( [ ...]) # # Returns the refspec and sha hash of the current head revision # # git_describe( [ ...]) # # Returns the results of git describe on the source tree, and adjusting # the output so that it tests false if an error occurs. # # git_get_exact_tag( [ ...]) # # Returns the results of git describe --exact-match on the source tree, # and adjusting the output so that it tests false if there was no exact # matching tag. # # Requires CMake 2.6 or newer (uses the 'function' command) # # Original Author: # 2009-2010 Ryan Pavlik # http://academic.cleardefinition.com # Iowa State University HCI Graduate Program/VRAC # # Copyright Iowa State University 2009-2010. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) if(__get_git_revision_description) return() endif() set(__get_git_revision_description YES) # We must run the following at "include" time, not at function call time, # to find the path to this module rather than the path to a calling list file get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) function(get_git_head_revision _refspecvar _hashvar) set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(GIT_DIR "${GIT_PARENT_DIR}/.git") while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) # We have reached the root directory, we are not in git set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) return() endif() set(GIT_DIR "${GIT_PARENT_DIR}/.git") endwhile() # check if this is a submodule if(NOT IS_DIRECTORY ${GIT_DIR}) file(READ ${GIT_DIR} submodule) string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) endif() set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") if(NOT EXISTS "${GIT_DATA}") file(MAKE_DIRECTORY "${GIT_DATA}") endif() if(NOT EXISTS "${GIT_DIR}/HEAD") return() endif() set(HEAD_FILE "${GIT_DATA}/HEAD") configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" "${GIT_DATA}/grabRef.cmake" @ONLY) include("${GIT_DATA}/grabRef.cmake") set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) endfunction() function(git_describe _var) if(NOT GIT_FOUND) find_package(Git QUIET) endif() get_git_head_revision(refspec hash) if(NOT GIT_FOUND) set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) return() endif() if(NOT hash) set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) return() endif() # TODO sanitize #if((${ARGN}" MATCHES "&&") OR # (ARGN MATCHES "||") OR # (ARGN MATCHES "\\;")) # message("Please report the following error to the project!") # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") #endif() #message(STATUS "Arguments to execute_process: ${ARGN}") execute_process(COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT res EQUAL 0) set(out "${out}-${res}-NOTFOUND") endif() set(${_var} "${out}" PARENT_SCOPE) endfunction() function(git_get_exact_tag _var) git_describe(out --exact-match ${ARGN}) set(${_var} "${out}" PARENT_SCOPE) endfunction() pulseview-0.4.0/CMake/memaccess.cmake000600 001750 001750 00000002376 13117760425 017130 0ustar00uweuwe000000 000000 ## ## This file is part of the PulseView project. ## ## Copyright (C) 2014 Marcus Comstedt ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . ## include(CheckCSourceRuns) function(memaccess_check_unaligned_le _var) if(NOT CMAKE_CROSSCOMPILING) CHECK_C_SOURCE_RUNS(" #include int main() { int i; union { uint64_t u64; uint8_t u8[16]; } d; uint64_t v; for (i=0; i<16; i++) d.u8[i] = i; v = *(uint64_t *)(d.u8+1); if (v != 0x0807060504030201ULL) return 1; return 0; }" ${_var}) endif() if(CMAKE_CROSSCOMPILING) message(STATUS "Cross compiling - using portable code for memory access") endif() endfunction() pulseview-0.4.0/HACKING000600 001750 001750 00000006171 13117760425 014172 0ustar00uweuwe000000 000000 ------------------------------------------------------------------------------- HACKING ------------------------------------------------------------------------------- Coding style ------------ This project is programmed using the Linux kernel coding style, see http://lxr.linux.no/linux/Documentation/CodingStyle for details. Please use the same style for any code contributions, thanks! In some exceptional cases deviations from the above coding guidelines are OK (in order to meet Qt/C++ related guidelines, for example). Contributions ------------- - Patches should be sent to the development mailinglist at sigrok-devel@lists.sourceforge.net (please subscribe to the list first). https://lists.sourceforge.net/lists/listinfo/sigrok-devel - Alternatively, you can also clone the git repository and let us know from where to pull/review your changes. You can use gitorious.org, github.com, or any other public git hosting site. Random notes ------------ - Consistently use g_try_malloc() / g_try_malloc0(). Do not use standard malloc()/calloc() if it can be avoided (sometimes other libs such as libftdi can return malloc()'d memory, for example). - Always properly match allocations with the proper *free() functions. If glib's g_try_malloc()/g_try_malloc0() was used, use g_free() to free the memory. Otherwise use standard free(). Never use the wrong function! - Never use g_malloc() or g_malloc0(). These functions do not return nullptr if not enough memory is available but rather lead to an exit() or segfault instead. This behaviour is not acceptable. Use g_try_malloc()/g_try_malloc0() instead and check the return value. - Use glib's gboolean / TRUE / FALSE for boolean types consistently. Do not use and its true / false, and do not invent private definitions for this either. - Consistently use the same naming convention for #include guards in headers: __ This ensures that all #include guards are always unique and consistent. Example: PULSEVIEW_PV_VIEW_RULER_H - Consistently use the same naming convention for functions, if appropriate: Getter/setter function names should usually end with "_get" or "_set". Functions creating new "objects" should end with "_new". Functions destroying "objects" should end with "_destroy". Functions adding or removing items (e.g. from lists) should end with either "_add" or "_remove". Functions operating on all items from a list (not on only one of them), should end with "_all", e.g. "_remove_all", "_get_all", and so on. Use "_remove_all" in favor of "_clear" for consistency. - In Doxygen comments, put an empty line between the block of @param lines and the final @return line. The @param lines themselves (if there is more than one) are not separated by empty lines. - Use QIcon::fromTheme() for icons that are included in the freedesktop.org icon naming specification. Do NOT use it for all other icons. Release engineering ------------------- See http://sigrok.org/wiki/Developers/Release_process for a list of items that need to be done when releasing a new tarball. pulseview-0.4.0/Doxyfile000600 001750 001750 00000016271 13117760471 014714 0ustar00uweuwe000000 000000 # Doxyfile 1.8.6 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "PulseView" PROJECT_NUMBER = "0.4.0" PROJECT_BRIEF = "A Qt-based sigrok GUI" PROJECT_LOGO = icons/pulseview.png OUTPUT_DIRECTORY = doxy CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 ALIASES = MARKDOWN_SUPPORT = YES AUTOLINK_SUPPORT = YES BUILTIN_STL_SUPPORT = YES SUBGROUPING = YES INLINE_GROUPED_CLASSES = NO INLINE_SIMPLE_STRUCTS = YES TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_PACKAGE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = YES CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES SHOW_GROUPED_MEMB_INC = NO FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_MEMBERS_CTORS_1ST = YES SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO GENERATE_TODOLIST = NO GENERATE_TESTLIST = YES GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST= NO ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_FILES = YES SHOW_NAMESPACES = YES FILE_VERSION_FILTER = LAYOUT_FILE = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = . INPUT_ENCODING = UTF-8 FILE_PATTERNS = RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = moc_*.cxx* EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = YES SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html-api HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = YES HTML_DYNAMIC_SECTIONS = NO HTML_INDEX_NUM_ENTRIES = 100 DISABLE_INDEX = NO GENERATE_TREEVIEW = YES ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES SEARCHENGINE = YES SERVER_BASED_SEARCH = NO EXTERNAL_SEARCH = NO SEARCHENGINE_URL = SEARCHDATA_FILE = searchdata.xml EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the Latex output #--------------------------------------------------------------------------- GENERATE_LATEX = NO #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = DIA_PATH = HIDE_UNDOC_RELATIONS = NO HAVE_DOT = YES DOT_NUM_THREADS = 0 DOT_FONTNAME = Helvetica DOT_FONTSIZE = 10 DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = YES UML_LIMIT_NUM_FIELDS = 10 TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = YES CALLER_GRAPH = YES GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = svg INTERACTIVE_SVG = YES DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = DIAFILE_DIRS = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = YES DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES pulseview-0.4.0/icons/000700 001750 001750 00000000000 13117760503 014304 5ustar00uweuwe000000 000000 pulseview-0.4.0/icons/trigger-marker-high.svg000600 001750 001750 00000001614 13117760425 020673 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/trigger-low.svg000600 001750 001750 00000001371 13117760425 017276 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/menu.svg000600 001750 001750 00000002565 13117760425 016006 0ustar00uweuwe000000 000000 pulseview-0.4.0/icons/zoom-out.png000600 001750 001750 00000001213 13117760425 016605 0ustar00uweuwe000000 000000 ‰PNG  IHDRójœ PLTExxx¿¿³>>6992¼¿¹¾Á»pqnMNKLMJ¾À»hifwyt½À¸½À¹gheZ]X¹º¸¼½»çèæéêèêëé²³±XZVwytz}w{}xƒ…€‹ŽˆŽ‹”—‘›ž˜œŸ™Ÿ™¥¨¢®±ª¶¹²º½¶ÙÚØÝÞÜÞÞÜââàããáæçåèèæèèèééèêêéêëêëìëííëîîîïïïððïòòñòòòóóñóóòóôóôôóõõôõõõöööö÷ö÷÷÷ùùùúúùúúúûüûüüûüüüýýýþþþÿÿÿޏ—D+tRNS !$$%()FV¨¨©ÔÖìîîîîðøúúûûüý²çõIDATxÚ•Ì][A€á™Ùv}¨PBJ‰ùZ µ!²Zµ»óÿÿF®··¹v»Ÿƒ‡ü[(–Ö¥t,„5™³…ôKþöøëØ’ã^Ç!gœÕ§ÇÊÉ@ÖÅÜGè˜ß|07ÅÈ|•Ì‘hBnˆÁ¤p‡ “h@®»½±&6î¹uÈ5»c–¿PÙìØ5È•eÛªÞ£ªÕ^V —­wÖ¢Y›=øÌ4ÈEëÑÇ*BN½]ÃH­#¥‰«é°/ §— J \äŸ?þÌŸòç{œ‘`øä,{+eOw7Âxp'r=BÑýðö–ÊÖs¦¨œçªÂ(ùNðU;A¯‹IEND®B`‚pulseview-0.4.0/icons/zoom-in.png000600 001750 001750 00000001327 13117760425 016412 0ustar00uweuwe000000 000000 ‰PNG  IHDRójœ 5PLTExxx¿¿³>>6992¼¿¹¾Á»pqnMNKLMJ¾À»hifwyt½À¸½À¹gheZ]X¹º¸º¼ºçèæéêèéêè²³±UWSXZVac^lniwytz}w{}xƒ…€‹ŽˆŽ‹”—‘™œ–›ž˜œŸ™Ÿ™¤§¡¥¨¢®±ª°³¬¶¹²º½¶¼¿¸¾Á¹ÙÚØÝÞÜÞÞÜââàããáæçåèèæèèèééèêêéëìëííëîîîïïïððïòòñòòòóóñóóòóóóóôóôôóõõôõõõöööö÷ö÷÷÷øø÷ùùùúúùúúúûüûüüûüüüýýýþþþÿÿÿ_¸%†+tRNS !$$%()FV¨¨©ÔÖìîîîîðøúúûûüý²ç&IDATxÚ•ÌY[‚@†aK+Û¬Ôr˲,7\pGÍÔ"·DC¬„€ïÿÿ„†‘¸:í>øæ½žƒ¡þÍãò¶¨ßcÕPBÛw"´é;C×lºq 9¦+_(zŒddÓ=FðV~Ãæ)€ÔÜ\VnÂDÇi€4~Ä 4I®Ãp–ÉårødfC¨“\3S,ìt`ÔH®h=± ª*>±§UH.®»R™ãJ%Ž+KÝu‘äüªóŽUªæÛYåIf—ز¡(ÍbIÎJO˜Üj·[²¹¤,ÉAè÷ûŸ‚Á‘¦ƒ7‹Ñ«m´¸Ò4…\ÇWÉ—_òs2|È jËí=¿Œ?ØâgûÛ 1ß©ÅwäÝÝq"ü9r8Æea§ÑÔf;]à‚@bIEND®B`‚pulseview-0.4.0/icons/document-save-as.png000600 001750 001750 00000001511 13117760425 020170 0ustar00uweuwe000000 000000 ‰PNG  IHDRójœ ŒPLTEtƒM™£lnpk•¡qUWSnƒTnpkx‹\lWUWSnpkzdjZnpkxˆew‹lnpknpk|mnpkfhdl…w`}npŠ‚gid[zrnpk^|ymŽWx}Tw€[~ˆMr‚QyŠSyŠIn‚My‘?l†Bnˆb–»AlŠ­Ñ?j‰Bp’g¢ÎDxœJ€¦t¨Ó?r–G}¢ÈÈÈËËËàààççç8g‹;l‘í_?ßH‚SlØ ÃH°‘*3<Ëh’’"úO¹ÉЈì=XôIEND®B`‚pulseview-0.4.0/icons/trigger-rising.svg000600 001750 001750 00000001365 13117760425 017773 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/decoder-delete.svg000600 001750 001750 00000001651 13117760425 017702 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/status-red.svg000600 001750 001750 00000002516 13117760425 017131 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/add-decoder.svg000600 001750 001750 00000001257 13117760425 017172 0ustar00uweuwe000000 000000 pulseview-0.4.0/icons/status-green.svg000600 001750 001750 00000002521 13117760425 017453 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/information.svg000600 001750 001750 00000023766 13117760425 017375 0ustar00uweuwe000000 000000 pulseview-0.4.0/icons/document-new.png000600 001750 001750 00000001264 13117760425 017427 0ustar00uweuwe000000 000000 ‰PNG  IHDRÄ´l;bKGDüéO4×± pHYs × ×B(›xtIMEÕ%0ÊC& AIDAT8Ë­•Íka‡Ÿ™ÝTšâM›5ž<ˆxÄVððÒƒ'oâÕ³b/¢âÇ?áÁ‹xÜE5¥ z²¹Ô("1¦ÙdÇÃ~fSíj}!dwØ÷yg~¿™]aŸkÔY ø®W·8.ñÅý‡wo«U ¨P[ìᨱ3ÔÇ/4¯¹^½ïfž[½qýfa¨™þG‚þK|«`”ÙþúéŠá¼uVžºù ÍfÇq03D‘°¨ì5%iQÖ8¥YlæâÌshá5<»,öm]óàCÌ Ì03,0ÌÆ¨ôÙÁdtPà0.‡÷#@SAD9HÀ"2Úÿ †ƒb?6€íß‚U5üADÓÃDQq8Ê€e†v†k¸þs6?o!O€–»XUS¬Æ*3˜ç˜SÌΕhl|çÌÉÖàçTÆkëI³2Ù'?â*Lç0ç82sš^¿„ëÕû®W·)ð¹³KÔjµœ¦¤r¨D÷Qu¢aU“cÁ®R´Ûíp“i(CR>I‘§DL-÷O]abIvù^NA)N6™j ¢Ñ}’ ã¹qÏÞ½;•‘H(E Íj,± {——ÎS­VÓÖÈD42NÕl—h1»ÝîD»1ñžä€le…4NOÑŒyxÄIô/ N²ÑÔ¸ˆ[™N£I¦ fœ¸6“Æ…UP,cÏóø+ApçÁ£{·öû²Õº:õÍË«ðìäcú #û“£M˜¶àIEND®B`‚pulseview-0.4.0/icons/settings-views.svg000600 001750 001750 00000126451 13117760425 020036 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/trigger-marker-change.svg000600 001750 001750 00000002250 13117760425 021176 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/pulseview.png000600 001750 001750 00000006651 13117760425 017052 0ustar00uweuwe000000 000000 ‰PNG  IHDR00Wù‡sBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î< &IDAThÅZi\ÕuþνïõÞ3Ó³O÷ôhFŠ ³HØ2 H $ Ë‚ÂI¬à…!!1‹S”)$0K쪨b›¥À˜%&‡B ˜‚”—T… P4šÍô2«¦÷~Ýï½{O~¨GÕŒH­Á9¿úÜ{Ïù¾ïÝ¥Oß×ÄÌø¼,‰™)™LþúóÂK™,‹Ý^ïk­›™¹£¾­··÷{K‰Ù€ŽŽŽpWWW×qºzë"2ëÛ´Ö±ÅA]]]]áF¸4$@J© øeq»Ïçk#"Zð™ùcˆHøýþ–Åq†aÜ"¥ÔpiHÀÔÔT @ÇÀÀ€¯¾ˆG£ÑUu¾uº»»WÑL}L-GG-çIÛg 8æ‰3¿Y­V·Ö·Y–u€™Ï]ðµÖ&ï‚/¥\oYÖú˜jµº•™ß<ìzûLŽãÜÇY·~¿][߯̉híÑäB˜*uýk™ù`} ]ë÷û÷,ÎÇcŽãÜqʈèa­õÃõkFFFr+V¬ x<¾r¡MJ9 ¾àk­=¬:µ1 $W ÐÈÈHn&Õ0>e‰DbÀë===7/îyVk½eÁïêê0PGd­išõ{bEmÌ‚À-cccÏ.Î[Ãz½†}j N?588¸µ§§gÍ¢®W\¾àŒû„z{{ϪÞÐÞÞ¾¢Ñè:!ÄÙãããõÿòZŽzòk·¦Óé§N„Û `f>pàÀBˆÕ/¥T*5 %n!D€ˆ@DW@W›æÎ62@Jù'D!D &h €–ZÔ“âG¸‘O°D8* nŒÇãþO˜H$Þð›X,¶mQ×|ÿ#0===Ýdòô¹ñð9ÐÝŽ€'!5­ ­gŸžšžžž€ZÌÇ–H-÷ojXǵx<îF£@D‡´Ög™5Çq¶¸ma‰Ôìi)e4‹õÀ²0eµÖgÀyçðħåG·c;1󙢿kDû¤”QO/$©å¼­†q\ëééY£µ~Œˆ# •J%ǹ¡¥¥eG4½þx fffŠZëwúúúÞŽF£Ë ‰ìJŽŽV¿@ô}ØS/|kµÈÀŸ]Á£Û®ÔÃwãnx.¢¼tŸ´Ÿõàè¡d%‰ì€h4º¬¯¯ïm­õ;333ÅãaG£Ñë[ZZv8ŽsC*•J#`àþýû¯öz½«c±Øó±X,°8‘ÖzçÄÄuvvn€¡¡!û‚Jå•ËÃá•pIhö峺}«“^Ä‹äðvÍ®œ…OÛ|Z¥í¼Ÿ ÙÐÙÙ¹}bb‚´Ö;ãÅb±@,{Þëõ®Þ¿ÿÕ‹³‰™Y}À^9>?VMNMM i­o´m{Û+{ÿ¾6?Ç pæ¢@– U篮¦£ûéÖ'nmÖZµØ¿·ò`Ûe¯…)2¸f¾ûë·À—ü±c;Û´Ö7NMM ÕcÕ°_°wllì;Ì|L½ô‰§P*•zœˆîBìÅb7uww­iÒéô®¸ÇúŸ¯¶ß [˜ÇÙu==_ÿò l‘³-Ò\½0~nvnµ)Í_5ä˜Íz«V<įm™Ä¿Á{½Üþ·ë²—¼›N§w-ŒïîîÆb±›„{‰è®T*õø'ñüÔc4™L¾ÉÌ÷ø|¾Gúûûߨ±.jl ›8ïûWž~¦§Ÿ vumÖjÄhê8@wSäWÛÔ }sj®´þõºá?m¥îußþâß}­ž|ÿ>Ÿïf¾'™L·N:!N§_ªV«×&‰þžžž÷z{{WÀý¿žÍò·{½þ¼ó’Þ6«PxVÙö»ˆ‚ìT÷K_ðL „<Á3l×ù¨ãʳƒŽÖò¥âso]œ\!ýPWôç¿Ü“€µk¿´ª··ï½D"Ñ_­V¯M§Ó/}¿ú"K&“OѺl6ˆF£¯,wî{¢X*·¶výðæk} =»Êu¬}Âã“Ç4‹•ò>¿ß{4Þ¾âÙâ°u¿cñG_ýñiÀCí^½yó5{‡}ÍÍÍç&“ɧ?…ÒÉ ¨‰H:t(V.—_íëëûï¾¾¾s™™«e÷:Å|õöËW¬-MN>êèØÆ¥Â0„ŒCÀ”fw®Znk üyz¾ðLbçØ¹Ðt…‘7á*¨;výe9o{<á÷íû¯ø‡~8q¢¼Nê 3óÐÐÐw'''oíëë{mùòåg>øÆðV±ðH(غÓÎåžÕJ—OeæˆDëÑ8 5w8–ÕZo8¯©óåJI=Lï¼ìàòwï½w÷FÀù¹ëª[î½÷º;™qR· ý"ÝJ¥néìì|}ùòå«ò¹ÊÝÊU+>¸rÍ 3‡?ðD¡UK<”RÍbô/{A”þ«½íç€(ÖqYðþûîûé:Ç©¾dÛúoî¹çºgáÒð­ÄØØØ®™™™ïµ··ÿÇîƒÕæ²Uz4è|Û­TÞ“þø˜µm–Ó¶ö@Ì»f¡ñ¾aà[nUýä—§¿±,ûUDZ¿{ß}‘?%0::úX6›}nùòåÿ Ýêó®Ò—K…ßš¡Ðz¢È9åOYÊo™ ùÍ/ú ê]åòW"ë}¯–J•¸®zên|òT8œò½P&“ÙáºîEÏšÝÌzb´ÇTÂ0ÖÉ,•o²ªü’dÆtƦß6C ÿjÃÆ”Rë—-ëýûSÅ?e³³³…¹¹¹»"‘È£¥Réyµ¢sƒ²íeÊu³(ÁŒ2ƒ[d¥FÏ9nÓ—Ä+E·|ŸÖê®nØœùãããO8Žã}+Í‚ §ƒÈv Õ5nåÊU¸íæo‚@0Lƒ ÃcÁõ.ÜüQ#<š_îÙÓ^RÅ'ý4= 8¶}B±‚? \×¥b±˜žzkÃ…èl„KC3ðÊ ÝVf~È+%ü^>?<>/R©)ÌÍÍ!—É!Ÿ/ \±`Û</Âþ "-a´µµ ³#E€Cp´ƒîPÛ_\øG[z²\šÌüì&#Ô„‘‰ |Atµw àÁ#5zcˆvEàóú¡ª.æçfQ¶*p*”fg1šƒC-4üþlÇAÇé­ àw#ÀçõEóÅL!!X#—Ï “+@‚V ÌGŽP†>Ÿ„Ç0áJ à5½›ÛuP(‘™ŸÇ„/ÐÐ;²†„ÛZµš; U­šáÚ.¢ÝQ”ŠYÀã…"Ð`B!ÌL&ðùï_»Z†&’©q8®Û¶0rÅlC§IC*Å’w>›ãØR”eÛB>Ÿƒ”ƒa˜˜&´†› ®í 33ƒPS; 0XÚ0`z<°+•ÖÏ^*ÌÚôz¼¦„&¤ ¸¬¡ƒ­ ´ ×u µ†ij˜^¦Ïƒ@ Ûu ¥#öäù ðx½ì8U8Ž ­ x½Â…ƒ0 " "3C$˜" éñÀ0 €f )%¸p9éR‚ˆ<årE G6*14k([Á²,”KT¬ ìª ¥4+T*ryËEžŸC¾PÀìÜad²y”Šª¶ Çväâ÷p'b ÍÀGû‡mÎ ! ˜®€„í:°í*¤0`4kEP®3ƒÁÐÐp•‚Ò J)€Ö` Wk…#ô¤J‹FŠ9÷ž½‹YºoÁp_ÅBŽãÂvlX ¥R ¥r¥R†'o S„›Z Gà †ÀÌÒ8 àóŸfÖD”|r÷/®¾ö›«”Š!!$¤!‚ @$˜É)—,R’ "X¹®ªZ ̘ÀB5‘>ü'ýwƒ†‹9"8òÄ‚ªùTGÄSû¼°,$ŽÌz}átäÔÜ}±Woÿ•û-®ž‰*ÏIEND®B`‚pulseview-0.4.0/icons/trigger-marker-low.svg000600 001750 001750 00000002006 13117760425 020551 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/trigger-falling.svg000600 001750 001750 00000001371 13117760425 020111 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/decoder-shown.svg000600 001750 001750 00000002541 13117760425 017575 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/trigger-none.svg000600 001750 001750 00000001231 13117760425 017427 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/channels.svg000600 001750 001750 00000003373 13117760425 016633 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/show-cursors.svg000600 001750 001750 00000001324 13117760425 017510 0ustar00uweuwe000000 000000 pulseview-0.4.0/icons/trigger-marker-falling.svg000600 001750 001750 00000001624 13117760425 021371 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/pulseview.ico000600 001750 001750 00000022676 13117760425 017045 0ustar00uweuwe000000 000000 00 ¨%(0` ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿPfxéj|ƒøm~…øo‚ˆúoˆûo‚ˆùo‚ˆûpƒˆýq‚‡÷qƒ‰÷t†‹øu†ùu‡Œøqƒ‰ôt†ùs…ûs…Œûs†Œús†Œ÷alncÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!j}‚ûv‡‹ÿ‚‘•ÿ‡•˜ÿƒ”˜ÿtˆÿvŠÿw‹ÿxŒ‘ÿzŽ“ÿ‹› ÿŽœ ÿŒ›žÿ’¡¦ÿ{”ÿ‘ ¥ÿŠ˜œÿ‰–›ÿ‚’–ÿq„Šÿv†ŒÖÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿnz¤g}ƒÿk€…ÿp„Šÿ{’ÿ ¤ÿx’ÿ|•ÿ€“™ÿƒ—œÿ„˜ÿ™¦«ÿ‚–›ÿ}‘—ÿ‘¡£ÿwŒÿ‘Ÿ¢ÿxŠÿx‰ÿv‡Žÿr…Šÿpƒ‰éÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‘¡§Ü|•ÿuˆŽÿx’ÿ’—ÿ•¤ªÿ“˜ÿ‚•›ÿ…˜žÿˆ›¡ÿŠž£ÿ›ª®ÿƒ—ÿ~‘˜ÿ“¡¥ÿz“ÿ”¡¥ÿ{’ÿ{’ÿyŠÿt†‹ÿs…Œìÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ™«±ß{Ž”ÿu‰ÿyŒ’ÿ“™ÿ˜ª­ÿˆœ¡ÿŠ ¥ÿ¡¦ÿŽ¢§ÿ¡¦ÿž«°ÿ‹Ÿ¥ÿŒ ¥ÿŸ«±ÿŽ¡¦ÿ¡®³ÿŽ¡§ÿ‰¢ÿ–›ÿxŒ’ÿx‹‘ìÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ’¤«à‚“™ÿ{Ž”ÿ~“˜ÿ„–šÿ–¦«ÿ}•ÿ~—ÿ~‘˜ÿ~’šÿƒ–Ÿÿš©®ÿ‰¤ÿŒŸ¦ÿœª°ÿˆœ£ÿª°ÿ‰›£ÿ„—ÿ~’˜ÿu‰ÿv‰Žïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ”¦­Ü{’ÿuˆÿx‹ÿ’•ÿ•¤¨ÿ™ÿ“œÿ“žÿ€“ÿ†˜¡ÿž«±ÿŽ¡¨ÿ’¥«ÿž«±ÿƒ”žÿ—¢ªÿ~‘™ÿz”ÿuˆŽÿj~ƒÿp„ŒèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŸ±´ÔŒž¤ÿ|–ÿ}–ÿ€’˜ÿžª²ÿŽž§ÿŸ§ÿ‘ ¤ÿ‘¡¤ÿ¡¢ÿœ­¬ÿ€”–ÿˆœ¡ÿ£±µÿ™ª¯ÿž¬±ÿ‘•ÿzÿq„‰ÿdx~ÿw‹‘Õÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿž§Ö„—™ÿxŒÿ~‘–ÿ„˜œÿˆ—šÿ‰™œÿ†–šÿ„•™ÿ„”˜ÿƒ“˜ÿ†•›ÿ‰£ÿ‡›¢ÿ€‘˜ÿ€‘–ÿ‡–œÿˆ›¢ÿƒ—œÿwŠÿex~ÿˆš¡×ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ…—Ÿ¼’¢£ÿu‰Šÿ‘”ÿ•¦ªÿ¡¯¶ÿšª°ÿœ®³ÿ™ª±ÿ¢±·ÿžª·ÿžª¶ÿ‰–¥ÿ‚œÿy…–ÿx‚•ÿz‰•ÿy‰ÿw‰Žÿ‚”—ÿ}‘ÿªº¿Êÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿš©°t™¨¦ÿœ«­ÿ¤²¶ÿ­ºÀÿ´ÁÆÿœ¨¬ÿ‰“˜ÿzƒ‰ÿmu{ÿdmqÿ_hlÿflqÿqv}ÿ~…ÿŽ™¡ÿž­·ÿž®´ÿ®±ÿ®®ÿ™­ªÿ§¹¾bÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ³³¿¢°´ü¥´ºÿ«¹¿ÿ­»Àÿ§µ»ÿ#$$ÿÿÿÿÿÿÿÿÿD@Aÿ§´½ÿ¨¶½ÿ¤²¸ÿž«°ÿ‘ §êÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ®»Ã^šª²ß˜¨¯ù™ª°ÿ›­³ÿ#$$ÿÿÿÿÿÿÿÿÿB??ÿž®³ÿŸ¯´ÿ£³¸þ©·¼õ´ÁÁ)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦¦³¬¹¿(333Í"2HÛ,xÛ!8—ák¥ä!Pê_YÞ˜2TÞŽ?và~fgЪ¶¼R§·ºQÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ666Ï&:VÖ%2ŽÕ =¯Ôy¿ÕVÖigÒ°8[Õ©AŠ×ŽttÒÿßßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ222ñ.IoÞ+6«Ò#IËÉ‹ÜÐ¥cÑmy"ÅÊN]ÔÉ>¤ÜžòèÑÑ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)))ÿ/N{î/4¶Ø!MÍÂŒÝЦcÑ`|!¿É]QÙÑ3­êž€€ÿ¦‘‘$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿM(((í1R†þ35ÀàRκŒÝЦcÑT€ ·ÈjDßÚ%´ûž€€óœ}}Oÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ}357¹2U‰ó11Âê ZÓ¸ŽÝϧeÏI‡$´Ån;çÛ"¶÷¢~„Àœ{{}ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ000Ô%0>~3W‹Ü..Áö&fÚÄ’ÜÆ©oÆ>’*¾Äl8òܵã®gƒ›}}ÏÚ’’ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿe444Ñ&J}|5W³--Àü-sÞÒ™Û¼ª€»63ËÂj4ûÛ²¶Û'¶€Ò–xxbÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 333é ?2UˆÓ3z33ÃÝ1wáâ£Û±­’°2¤<ÛÂl2âÌ"}۷Ϩ‡ŒLœ}}æÄ——ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ%%%Œ555²F|!3VŠñ±}//Á±.vàò®Ý©´ª§0¢8ìÁi/µ¾]9~ÛµôáJÃ0ž€€µ˜zz‡ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!!!e444ê&J~x7Z¬%%½³##¼},tßþ½Ý ½Åž- 5û¼`#Âf2¯Ü µ²Ù²}¨ƒƒ(œ}}é–xxbÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ]777í!!!/9q 1Sˆä+P‚E--Áâ¹O.uàöÃÞÃÜ—- 5û‘Y LÁi.ÜÜ´QܶãåRÊ¢ƒƒ7œ~~í›}}[ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!!!\;;;ï6ÿÿÿ$HŠ5X‹Á­--ÀøEÌ51wàæÃÞÃÝ—0£8ì/{ 0Àh.öÆdLÛ¶ÈÚ²Žÿ¡‚‚?€€ï˜{{Zÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ---†:::ì:ÿÿÿ$Aw+2U‰÷"J|-³v00¾`ÚI/vßÔÃÞÃÞ—0£8ÚŒ?Âj0¾²SoÞ'º<Û¶øÜ$º1ÿÿÿœ‚‚B€€ìš{{‚ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ã555Ùÿÿÿ(K~Ç3W‹¢ÿÿÿ''¾Ñ¶`kÛn,tߺÃÞÃÞ—* 3•!e¸[b¾e(Êÿ’ÛÛ³©Ú±Æÿªªÿÿÿ¤)ŽvvÞ6//á***ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_é000Ý(ÿÿÿÿÿÿ!Exd4VŠìCy§**¿÷¢ 'pßœ%nÝ‘ÃÞÂÞ–%›-™&/“±O ¿f*÷®Fã;À#Û¶ïÙ²fÿÿÿÿÿÿ833)544Ýé_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR"""ÿ777É ÿÿÿÿÿÿ$Iy0R‡ï+N„Vÿÿÿ ¯u..»ÿÿÿ.uàÄfÚbÃÞÂÝ–•l+¡5¼€ÿÁh.¿°M nÿÿÿÚ²aÛ³íæOÄÿÿÿÿÿÿ 777É"""ÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿAÐl ÿÿÿÿÿÿÿÿÿ /FÍ/M{µÿÿÿÿÿÿ%%¼Ñ·]ÿÿÿ1wáçXÖ1ÃÞÂÞ– ‡ :1£:àÿÿÿµXb½b&Êÿÿÿÿ’Ûáºn]Ìÿÿÿÿÿÿÿÿÿ lÐAÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿdÄÿÿÿÿÿÿÿÿÿÿÿÿ])))ý$,Fÿÿÿ§''¾ö³ UÆ .uàüUÆ ÃÞÂÞ–œ- 5û+ª+·I¾d'ö¦CÿÿÿC;I*)*ý]ÿÿÿÿÿÿÿÿÿÿÿÿÄdÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ© ÿÿÿÿÿÿÿÿÿÿÿÿ,ô///Ÿÿÿÿÿÿÿ[§((•ÇÿÿÿVÖ21wàæÿÿÿÃÞÂÞ–ªÿª0¢7ë†*ÿÿ•T'ÌZ.£ÿÿÿÿÿÿ///Ÿô,ÿÿÿÿÿÿÿÿÿÿÿÿ ©ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ !!!ªfÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ—999óÿÿÿ333 ÷H¢ÿÿÿL–€)`²ÎÿÿÿÃÞÂÞ–€ÿÿ(‚/ÓdxÿÿÿJ.¦ ÷333ÿÿÿ999ó—ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf!!!ª ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¤+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Ó0ÿÿÿÿÿÿ`<<<ÿÿÿÿ/KØ'7Oàÿÿÿyˆ½v…¹ÿÿÿ'B)â8Õÿÿÿ<<<ÿ`ÿÿÿÿÿÿ0Ó ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ+¤ÿÿÿÿÿÿÿÿÿÿÿÿ= ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŒ_ÿÿÿÿÿÿÿÿÿÂ999åÿÿÿÿÿÿ"+è)9Q±ÿÿÿCIÞ&LSÝÿ(C*³%çÿÿÿÿÿÿ999åÂÿÿÿÿÿÿÿÿÿ_Œÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ =ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-ÃÿÿÿÿÿÿÿÿÿÓRÿÿÿÿÿÿÿ.1É5GJÍÿÿÿÿÿÿÿRÓÿÿÿÿÿÿÿÿÿÃ-ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ@@@Ä+ÿÿÿÿÿÿÿÿÿÄÿÿÿÿÿÿ ÿ3ÿÿÿÊ333Ïÿÿÿ3ÿ ÿÿÿÿÿÿÄÿÿÿÿÿÿÿÿÿ+@@@Äÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿapÿÿÿÿÿÿÿÿÿÿÿÿayÿÿÿÿÿÿ333Îÿÿÿÿÿÿ’ ÿÿÿÿÿÿÎ333ÿÿÿÿÿÿyaÿÿÿÿÿÿÿÿÿÿÿÿpaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ§ÿÿÿÿÿÿÿÿÿÿÿÿ999¼(ÿÿÿÿÿÿ$«ÿÿÿÿÿÿfdÿÿÿÿÿÿ«$ÿÿÿÿÿÿ(999¼ÿÿÿÿÿÿÿÿÿÿÿÿ§ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ†ÿÿÿÿÿÿÿÿÿÿÿÿ½ÿÿÿÿÿÿÿÿÿGŠÿÿÿÿÿÿ`mÿÿÿÿÿÿŠGÿÿÿÿÿÿÿÿÿ½ÿÿÿÿÿÿÿÿÿÿÿÿ†ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[^ÿÿÿÿÿÿÿÿÿk^ÿÿÿÿÿÿ[uÿÿÿÿÿÿ^kÿÿÿÿÿÿÿÿÿ^[ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿ"""*ÿÿÿÿÿÿVnÿÿÿÿÿÿ*"""ÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ‡ÿÿÿÿÿÿÿÿÿÿÿÿ¦ÿÿÿÿÿÿPcÿÿÿÿÿÿ¦ÿÿÿÿÿÿÿÿÿÿÿÿ‡ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ—ÿÿÿÿÿÿÿÿÿKXÿÿÿÿÿÿÿÿÿ—ÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿFMÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ89ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ?ÿÿüÿÿøÿÿøÿÿøÿÿøÿÿøÿÿøÿÿøÿÿøÿÿü?ÿÿü?ÿÿþÿÿÿàÿÿÿÿàÿÿÿÿàÿÿÿÿàÿÿÿÿàÿÿÿÿàÿÿÿÿÐÿÿÿÿÐÿÿÿÿ¨ÿÿÿÿ(ÿÿÿÿd&ÿÿÿþÔ+ÿÿý”)¿ÿÿó´-Ïÿÿç,4çÿÿÏhóÿÿžêWyÿÿ|Ú[>ÿþýÚ[¿ùùšYŸŸ÷ó’YÏïï÷²Mï÷ÿï2L÷ÿÿïvn÷ÿÿßvnûÿÿÿöoÿÿÿ¾÷ï}ÿÿ~÷ï~ÿÿÿÿÿÿÿÿýï÷¿ÿÿýï÷¿ÿÿÿï÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿpulseview-0.4.0/icons/trigger-change.svg000600 001750 001750 00000001444 13117760425 017723 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/preferences-system.png000600 001750 001750 00000002177 13117760425 020651 0ustar00uweuwe000000 000000 ‰PNG  IHDRÄ´l;bKGDÿÿÿ ½§“ pHYs  d_‘tIMEÕ  %yÙQI IDAT8Ë¥•L”uÇ_Ïq)à¡–r„ˆÍiV £ î…¸ Îei²¦ËjýáX îÛ“ÄQÿÐäÈÖšc-Ì-sÚ&±i-Ø”g;©C%v»8‘.@¸;ž§?ä¹çAm}·g{>ϾÏkïïçó~?DÄBàý¹ò= W–åvþïBh£·G´™™iÍåúMBhÅ€ô/¯J€A/ Q6˜›>=¦ª¤šÍìÛ·—„„„ó€¶<§¼%åƒçÔœò–S‘`I‘ Ëò0`¶×}ÄÌô=222"UEB³ï±Ã;1/gMNyK»–ª««eÀ!„8®Ã­V+’ôÀÔ(‚]Ÿí§§§‡ƒùË -éñ…F`ILḺ7—cˆ‰}¨Þ²e ›6mDÓT$IÂ?3yE‘%Ëòµ(jÀãñðá÷“æÐÑš››¥%;Ÿ\ºô!~?š¦¡iZdJ¦¶Ö`žk•ut6½DÞÛ§õ­–î“e×B`!DJ||ü¯Ïo/4=þÄSH’š•oüî}ørµö:óï†Õ€ãjó+ÁÜ7¾2EÝ'ËÚ£C‘•žžþ¹ÛíÎÖŸåææ¶m+\ò÷_ãhšÆ²Ä$Z[[iêŒå熱¾sfžÊp®´ˆŸSÐZUu”±; ×oþÁÇgÝ|{¼˜‚#g„šô“8ÖZŠ9qáßTåSõE7%›¸\ý–°êý‹îËpÓ+C¯^¯JMãrý.Ôµ±ËÏË%EÔÔÔèf5|8tÏödn^¢ŒñIËV¥¦Q±#³ÉÈúŒu¤>š†,Ë–H+ƒ¾ZjEPH4™(´$¡ ypõþ„Íf#>.–;Þæþ7 ‡žÜ¨`úúîLí~†¶‹?ðcO?ŒÌƒ!¯Ê²ÌʇW#IÒ‚pC$ôèkVöçqú»vºúɳÙp¹nðOàóù¿ßŸ-Ë2+V=‚ÇÅÅ…à=EÊÇ+¿õ,{¶gsêÌE=^ŠŠKp¹náuߤ£_ÅÝP__×n·ß±êÊgü~<@ee%€#V†<Ž#eOSZIë¹Ë z¼Øž+œ ŒöZ¦w°Xét:N§³X–eÌ©i466âóùB0êwéëÒ˜U5F‡€NüÞV ¸.æ„$†ÎÎÎ 0<11±·¡¡áë±±1TU½ì¡ä­{Á®íÈ7cɶðXЉ_únqµ«‹Ž~•)÷¥üѾ6%b&j˜Ug`˜‚À¬`Åš”­ç;¼½zƒîMMÐѯg˜,P“SÇ%Ì÷:Pÿ£¨sð é­‡¾´Œ ÷êuBbìÚë­#á1 ƒJQb¬Î] ýŒöÞñb ê*IEND®B`‚pulseview-0.4.0/icons/trigger-high.svg000600 001750 001750 00000001357 13117760425 017420 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/zoom-fit-best.png000600 001750 001750 00000001331 13117760425 017514 0ustar00uweuwe000000 000000 ‰PNG  IHDRójœ /PLTExxx¿¿³>>6992ûûûüüüúúúüüü¼¿¹¾Á»pqnMNKLMJÿÿÿ¾À»hifwyt½À¸½À¹gheÿÿÿÿÿÿ—˜•ÍÎÊZ]Xÿÿÿ¹º¸¼½»çèæéêèêëé²³±ÿÿÿXZVikfoqluwrz}w{~x„ƒ…€‹Žˆ”—‘š—Ÿ™ £¥¨¢¦©£­°©®±ª¶¹²º½¶ÞÞÜààÞáâàããáèèæèèèééèéêèêêéêëêííëððïõõôõõõõöõöööö÷ö÷÷÷øø÷øøøùùùúúùúúúüüûüüüýýýþþþÿÿÿýÀ6tRNS !$$%():FVbl¡¨¨©ÔÖÚìîîîîððñõ÷øøúúûûüýý+Žú£#IDATxÚ•Ì[S‚P†aÀÄÒÊNvV+S+µ²¬ÀФ¦¨u»Õ€õÿC›1ÓeÏÅšoÞ‹Åý[$žéú2ñˆWSE |_ÅÔOOÜ:¶å³›æ¬=Ï=0Ó©{ss;‹¹ T:(•àò@¢Ðõ2‘A–eBع“‰—;@*P!.ÐÁ܆IµZ|28 ¹åP× ƒÃianZÏXMÌʬ§(Jï‰Á1S0×Çý4ú.ã:æš©« ªª®³s®êf sy`hû †';š1(cN˜ùGf4roÞ|O³ÈóÉë!úèð*ÉóœÚ<+½‘_£×Òéº(p áèÞqáÞW8Ú]] p‚^YÛŠm{bÑ奠Àž  (†<¢ <÷ d\ù}C´IEND®B`‚pulseview-0.4.0/icons/pulseview.svg000600 001750 001750 00000116511 13117760425 017062 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/decoder-hidden.svg000600 001750 001750 00000001332 13117760425 017667 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/zoom-original.png000600 001750 001750 00000001376 13117760425 017614 0ustar00uweuwe000000 000000 ‰PNG  IHDRójœ JPLTExxx¿¿³>>6992¼¿¹¾Á»pqnMNKLMJ¾À»hifwyt½À¸½À¹gheZ]X¹º¸¼½»çèæéêèêëé²³±XZVjmhuwrz}w|ƒ…€„††ˆ„‰Œ†‹Žˆ”–”—‘”—“Ÿ™ž¡š ¡¥¨¢¨«¥®±ª²µ¯¶¹²º½¶ÂÃÁÙÚØÚÛÙÝÞÜÞÞÜÞßÝßßÝààßââàããáääâæçåèèæèèèééèêêéêëêëìëìíìííëííìîîîððïñññòòòóóòóôóôôôõõôõõõööõöööö÷ö÷÷÷øø÷ùùùúúùúúúûûúûûûüüûüüüýýýþþþÿÿÿs6†8+tRNS !$$%()FV¨¨©ÔÖìîîîîðøúúûûüý²ç8IDATxÚ•Ì[Wa‡ñ™‘QT:©Ð)%I1"§É1¥ˆÐŒS¨™wÿÛ¶·Éê¶ßÅ^ÿõ\læß,v·8ç¶[ôzàSaîËwðÓgDSç4rê Ù£M>þ˜hšEèÏ oÀˆzn·Ûïowןp¡àÔsZ­–ru{p©à„ Í)h4rPXÆ )š¤Z­Ê‚ 2N’ 9¦J’ôÚSâñÞƒ$©1š£ã*’ÉQ©PGiŽ ²(7M¤§¹lv¡9¤äQ‘ˆ")æóJˆæ \F‘Êe9H³ë¹VA‚:•J­æÂȲΓnóe¦^ÇÓì;Y–áL›Gþ§á¯þ£ÿp瘳uwß{>çÝÛY]40o^YÛ²mëlÖå%#‡Ï9ƒ‘çM:ž78–ù\gb•Ș4hIEND®B`‚pulseview-0.4.0/icons/window-new.png000600 001750 001750 00000001316 13117760425 017116 0ustar00uweuwe000000 000000 ‰PNG  IHDRÄ´l;bKGDÿÿÿ ½§“ pHYs  šœtIMEÕ  +%QŒ”étEXtCommentCreated with The GIMPïd%n2IDAT8ËÕ“ÍKTQÆïGqËÜD¦m#*\D‹6EÿNë¶­BZ´¡«B}R¨IX.L“Á™¹ïÓâ~ä•\u6çÜsÏù÷<ÏsŒ#4íô_‚êØh:«Öl/ôý;´6 ^†þ)†Á·¡ýI;•Qk¶fS𫹗÷™Ã@õe–Ö91ü…Z­ŠÙÒ&ø¯ýëh'\ÊW<3}ãæáÊí¾€î;P*W!8¾Â^kv6§ }¾ …go=*åÞ¾òž;×–¸pî$õÆõÆ=è>Çl„H«5–3zêt)¸oè{Ú¶»+´vŸ1XýÉoƒÖ `—xýøn)Ø4I ãTô æÏnÑjuh¶?BçCQ Àâþ/H !»ˆ´I@ Ðo,ccKk,ÌX³½[»ÊcDvš³hVâ:æ„,c´¨c¬®ÿdrêÉ·}9–„\) S K®á˜"¸aÈÆ1Æ£B¬Šû\æCì¸{&KFÌÉ¥´,û+×í3O®l3‹.R}”óA–:s X¡‡φRÆ„’C¬ŒG ÃLQEN4¶ÔL!3LÂã¾D Ç㲤\$âg)+>SåzùA‹Ô¼Þ<›AœÄždGëœÒŠ=ö+‰U,µgGYŽêÉ——˜'W¼F±1I®mÿMí1£<µZ­çšyT image/svg+xml pulseview-0.4.0/icons/trigger-marker-rising.svg000600 001750 001750 00000001754 13117760425 021254 0ustar00uweuwe000000 000000 image/svg+xml pulseview-0.4.0/icons/document-open.png000600 001750 001750 00000001627 13117760425 017602 0ustar00uweuwe000000 000000 ‰PNG  IHDRÄ´l;sBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î<IDAT8•OhUÇ?ofv6YÛ"h6 E‰P¤µˆÐ=ˆGdLsòVϽŠxêEëADÌ©gÁ(ˆBjmƒÿ°Í¡–lCš­I7Ýyó{¿Ÿ‡ÝnwÓ¨I¿ð˜ù1Ìç}ß÷ýæË²ŒÿRÊÂ9›™sÎpç&­¥ôóòù4MÛ»ßK¼÷ñìììá½Àë­úgŸ~Žsnb,.~q|雥à)`çðÜÜÜïιÇÛ 63ÖÖÖ(ËrT‡PUNŸ^ Óé<ºòÓÊ…²ïŸIÓ´?‘ãóóó„03TUåƒß'Š".]¾41áÉ'8sæw\¾°|ãíÝ`×jµTUÅÌpΑ¦)ÍWš˜ÙÈ5@»ÝFDxöä)wñÇÞPÙ!˜ª:-óÎH’„¥¯¿"„0rüâ /á½T5‚h2c‘ÊD*Bøê.XDÀÅàbšÍW'ÜŽ_“¤ŽY¤ëµ—§¾;vÍg««ê²,£ÑhÈÂÂB|ñJ‹ó¿Qtwf3#rcõ®ýò‡«sÁ9×¾|îÍ££ŒClÞVž{ú¯zbôÀ°»öÔø£ÜKüÞGßÎdÙ[6ÊXDÈKcfºÎf§àúVÿ_P{kªóðáQua²+èUðØu0HÆâØÔ ôÈE¸ª›—WŽ#:fÄû÷ a:ñ^pÛ#ð Š@îáP£@²nP#/”é´FÑ÷7ÇB ¨^ô€ïrP{QÔ&;¤Ó+1µãŽUDè{ã[z¥àE÷ìG³y+GT×'W"ø`lw+Z[}‚þ?l\;µˆ­NQYÐÍм Ôk1·ú‚ PVÆv·ô8÷÷8˜n¡<òÐl$š:X«DÎÑë•bj[ÉââbÒl6íÏ’›‚ï¾z`(@0¥ÛËSém_#8®çyþ寫í׫F=¹Ý+îëÌ̤ÜÙX¾rþÝ«¿ Op˜a,šû2ø=ý•eY‘\n0y¦T6„Wÿñò¾¦waÀIEND®B`‚pulseview-0.4.0/icons/application-exit.png000600 001750 001750 00000002074 13117760425 020274 0ustar00uweuwe000000 000000 ‰PNG  IHDRÄ´l;sBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î<¹IDAT8•ÏkUÇ?÷Þ™;ó~˜¦yMŠ>BcL„¶!¥’U ºhŒ¸ ´"-j1XÁtÙ7!BqSõ¨ˆˆ]¹\%‹JºhZ\4ÐR^Á¬ð_&ïç×Åûá{É zà0ÃÌá3ß{æüÖZþ‡ @Në `ˆ[÷=æ¼÷Á¥%cÌõƒ¨J)Òé4‡ð=€0 q]}syé‹k@}/Ü0Æ\çü» ªÕ*µZZ­†1c RJ¦§¦¹rå#¤l ®×k|õÍןK€i)ïxž‡Öš0 ‰¢ˆ8ŽI’­5CCC(¥PJNgHÛ}Sàû>Zk¢("IÚ¹7Æày™L!$B4 Z{=Œ¾`­5¾ï÷@…H)ÑZãµrÛm­´ˆ~`Ùä8žçáû>¾ïãy^ǵֈ¾ø!›}ã{!nõU,¥ì¸R Çq˜˜˜ ŽcŠÅ"®ëö…þ<=}ñðÔÔõàÑ#õ·GÅícwûææ&¾ï399Ùùim³I‚së[²ùüâkW¯zJ©H*U–ŽSPìIü^°µ–B¡À©S§0Ætâ àÎü<ãÃÃŒŸ=ëÛR‰×oÜðÛïYXð{À{Ug2fff¸{÷.Ç òô)«ssŒÎÌ0<:ÊîÊ X‹P ›$ ÌÎ"¤dŸb!Dç'NœàÙ³g”J%R©¿^¸À‘‘}ŸÝÕUl‘T*$• 2•"uò$ÁŠóù<Õj•‡’Ífqœfèé›7¹3?c /õ l«‘Ož`ãxq·Á[[[ìììN§ÑZ$ GΜá͵5VÎãp6ÃÑÓ§‘ÍŽQЏZútM†a§Ä¤” ¤”Œ‘{eœÙ{÷øéìê››õQÇñ[[3öß¾ø[î®gÇq(•Jì;T*eâ8F ¢±xr­¶òxc£f!¹d­Ûò÷Ûp¥ZkŠÅ"ë÷×Ñž&ÿRž\.GEc¨šç··?©•Ë_ xÜÍè;@´ÖAÀúú=^ãòå÷9vl¬9ý¢0 ‰ã˜`w q1Š>>ë ¶Ö¢”ÂZ˃÷948À‡ —Éår¸®K‡Ôê°’$&€m8Ž‘Ròü¯ç,o½=G*åãºns؇aϳ4[ú?ÁÁNÀþÎÄ«Íã",F†i4ªè0’ÄR©”¡¹=úƒGŽŽ,ßþñöbw牃fdWê´ÖËìYImûç¥z‘š”IIEND®B`‚pulseview-0.4.0/COPYING000600 001750 001750 00000104513 13117760425 014235 0ustar00uweuwe000000 000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pulseview-0.4.0/config.h.in000600 001750 001750 00000002444 13117760425 015225 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Alexandru Gagniuc * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _PULSEVIEW_CONFIG_H #define _PULSEVIEW_CONFIG_H /* Application details */ #define PV_TITLE "@PV_TITLE@" #define PV_BIN_NAME "@PROJECT_NAME@" /* Pulseview version information */ #define PV_VERSION_MAJOR @PV_VERSION_MAJOR@ #define PV_VERSION_MINOR @PV_VERSION_MINOR@ #define PV_VERSION_MICRO @PV_VERSION_MICRO@ #define PV_VERSION_SUFFIX @PV_VERSION_SUFFIX@ #define PV_VERSION_STRING "@PV_VERSION_STRING@" /* Platform properties */ #cmakedefine HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS #define PV_GLIBMM_VERSION "@PV_GLIBMM_VERSION@" #endif pulseview-0.4.0/pv/000700 001750 001750 00000000000 13117760503 013616 5ustar00uweuwe000000 000000 pulseview-0.4.0/pv/globalsettings.hpp000600 001750 001750 00000004266 13117760426 017366 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2017 Soeren Apel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_GLOBALSETTINGS_HPP #define PULSEVIEW_GLOBALSETTINGS_HPP #include #include #include #include #include using std::function; using std::map; using std::multimap; namespace pv { class GlobalSettings : public QSettings { Q_OBJECT public: static const QString Key_View_AlwaysZoomToFit; static const QString Key_View_ColouredBG; static const QString Key_View_StickyScrolling; static const QString Key_View_ShowSamplingPoints; static const QString Key_View_ShowAnalogMinorGrid; static const QString Key_Dec_InitialStateConfigurable; public: GlobalSettings(); void set_defaults_where_needed(); static void register_change_handler(const QString key, function cb); void setValue(const QString& key, const QVariant& value); /** * Begins the tracking of changes. All changes will * be recorded until stop_tracking() is called. * The change tracking is global and doesn't support nesting. */ void start_tracking(); /** * Ends the tracking of changes without any changes to the settings. */ void stop_tracking(); /** * Ends the tracking of changes, undoing the changes since the * change tracking began. */ void undo_tracked_changes(); private: static multimap< QString, function > callbacks_; static bool tracking_; static map tracked_changes_; }; } // namespace pv #endif // PULSEVIEW_GLOBALSETTINGS_HPP pulseview-0.4.0/pv/devices/000700 001750 001750 00000000000 13117760503 015240 5ustar00uweuwe000000 000000 pulseview-0.4.0/pv/devices/file.hpp000600 001750 001750 00000002536 13117760425 016703 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DEVICES_FILE_HPP #define PULSEVIEW_PV_DEVICES_FILE_HPP #include #include "device.hpp" using std::string; namespace pv { namespace devices { class File : public Device { protected: File(const string &file_name); public: /** * Builds the full name. It only contains all the fields. */ string full_name() const; /** * Builds the display name. It only contains fields as required. */ string display_name(const DeviceManager&) const; protected: const string file_name_; }; } // namespace devices } // namespace pv #endif // PULSEVIEW_PV_DEVICES_FILE_HPP pulseview-0.4.0/pv/devices/hardwaredevice.hpp000600 001750 001750 00000003474 13117760425 020743 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DEVICES_HARDWAREDEVICE_HPP #define PULSEVIEW_PV_DEVICES_HARDWAREDEVICE_HPP #include "device.hpp" using std::shared_ptr; using std::string; namespace sigrok { class Context; class HardwareDevice; } // sigrok namespace pv { namespace devices { class HardwareDevice final : public Device { public: HardwareDevice(const shared_ptr &context, shared_ptr device); ~HardwareDevice(); shared_ptr hardware_device() const; /** * Builds the full name. It only contains all the fields. */ string full_name() const; /** * Builds the display name. It only contains fields as required. * @param device_manager a reference to the device manager is needed * so that other similarly titled devices can be detected. */ string display_name(const DeviceManager &device_manager) const; void open(); void close(); private: const shared_ptr context_; bool device_open_; }; } // namespace devices } // namespace pv #endif // PULSEVIEW_PV_DEVICES_HARDWAREDEVICE_HPP pulseview-0.4.0/pv/devices/file.cpp000600 001750 001750 00000002220 13117760425 016664 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include "file.hpp" using std::string; namespace pv { namespace devices { File::File(const string &file_name) : file_name_(file_name) { } string File::full_name() const { return file_name_; } string File::display_name(const DeviceManager&) const { return boost::filesystem::path(file_name_).filename().string(); } } // namespace devices } // namespace pv pulseview-0.4.0/pv/devices/device.hpp000600 001750 001750 00000003767 13117760425 017232 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DEVICES_DEVICE_HPP #define PULSEVIEW_PV_DEVICES_DEVICE_HPP #include #include using std::shared_ptr; using std::string; namespace sigrok { class ConfigKey; class Device; class Session; } // namespace sigrok namespace pv { class DeviceManager; namespace devices { class Device { protected: Device() = default; public: virtual ~Device(); shared_ptr session() const; shared_ptr device() const; template T read_config(const sigrok::ConfigKey *key, const T default_value = 0); /** * Builds the full name. It only contains all the fields. */ virtual string full_name() const = 0; /** * Builds the display name. It only contains fields as required. * @param device_manager a reference to the device manager is needed * so that other similarly titled devices can be detected. */ virtual string display_name( const DeviceManager &device_manager) const = 0; virtual void open() = 0; virtual void close() = 0; virtual void start(); virtual void run(); virtual void stop(); protected: shared_ptr session_; shared_ptr device_; }; } // namespace devices } // namespace pv #endif // PULSEVIEW_PV_DEVICES_DEVICE_HPP pulseview-0.4.0/pv/devices/device.cpp000600 001750 001750 00000003564 13117760425 017220 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "device.hpp" using std::shared_ptr; using sigrok::ConfigKey; using sigrok::Capability; using Glib::VariantBase; using Glib::Variant; namespace pv { namespace devices { Device::~Device() { if (session_) session_->remove_datafeed_callbacks(); } shared_ptr Device::session() const { return session_; } shared_ptr Device::device() const { return device_; } template uint64_t Device::read_config(const sigrok::ConfigKey*, const uint64_t); template T Device::read_config(const ConfigKey *key, const T default_value) { assert(key); if (!device_) return default_value; if (!device_->config_check(key, Capability::GET)) return default_value; return VariantBase::cast_dynamic>( device_->config_get(ConfigKey::SAMPLERATE)).get(); } void Device::start() { assert(session_); session_->start(); } void Device::run() { assert(device_); assert(session_); session_->run(); } void Device::stop() { assert(session_); session_->stop(); } } // namespace devices } // namespace pv pulseview-0.4.0/pv/devices/inputfile.cpp000600 001750 001750 00000005102 13117760425 017746 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include "inputfile.hpp" using std::map; using std::shared_ptr; using std::streamsize; using std::string; using std::ifstream; using std::ios; namespace pv { namespace devices { const streamsize InputFile::BufferSize = 16384; InputFile::InputFile(const shared_ptr &context, const string &file_name, shared_ptr format, const map &options) : File(file_name), context_(context), format_(format), options_(options), interrupt_(false) { } void InputFile::open() { if (session_) close(); else session_ = context_->create_session(); input_ = format_->create_input(options_); if (!input_) throw QString("Failed to create input"); // open() should add the input device to the session but // we can't open the device without sending some data first f = new ifstream(file_name_, ios::binary); char buffer[BufferSize]; f->read(buffer, BufferSize); const streamsize size = f->gcount(); if (size == 0) return; input_->send(buffer, size); try { device_ = input_->device(); } catch (sigrok::Error) { return; } session_->add_device(device_); } void InputFile::close() { if (session_) session_->remove_devices(); } void InputFile::start() { } void InputFile::run() { char buffer[BufferSize]; if (!f) { // Previous call to run() processed the entire file already f = new ifstream(file_name_, ios::binary); input_->reset(); } interrupt_ = false; while (!interrupt_ && !f->eof()) { f->read(buffer, BufferSize); const streamsize size = f->gcount(); if (size == 0) break; input_->send(buffer, size); if (size != BufferSize) break; } input_->end(); delete f; f = nullptr; } void InputFile::stop() { interrupt_ = true; } } // namespace devices } // namespace pv pulseview-0.4.0/pv/devices/sessionfile.hpp000600 001750 001750 00000002473 13117760425 020307 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DEVICES_SESSIONFILE_HPP #define PULSEVIEW_PV_DEVICES_SESSIONFILE_HPP #include #include "file.hpp" using std::shared_ptr; using std::string; namespace sigrok { class Context; } // sigrok namespace pv { namespace devices { class SessionFile final : public File { public: SessionFile(const shared_ptr context, const string &file_name); void open(); void close(); private: const shared_ptr context_; }; } // namespace devices } // namespace pv #endif // PULSEVIEW_PV_DEVICES_SESSIONFILE_HPP pulseview-0.4.0/pv/devices/hardwaredevice.cpp000600 001750 001750 00000006215 13117760425 020732 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #include "hardwaredevice.hpp" using std::shared_ptr; using std::static_pointer_cast; using std::string; using std::vector; using boost::algorithm::join; using sigrok::HardwareDevice; namespace pv { namespace devices { HardwareDevice::HardwareDevice(const shared_ptr &context, shared_ptr device) : context_(context), device_open_(false) { device_ = device; } HardwareDevice::~HardwareDevice() { close(); } string HardwareDevice::full_name() const { vector parts = {device_->vendor(), device_->model(), device_->version(), device_->serial_number()}; if (device_->connection_id().length() > 0) parts.push_back("(" + device_->connection_id() + ")"); return join(parts, " "); } shared_ptr HardwareDevice::hardware_device() const { return static_pointer_cast(device_); } string HardwareDevice::display_name( const DeviceManager &device_manager) const { const auto hw_dev = hardware_device(); // If we can find another device with the same model/vendor then // we have at least two such devices and need to distinguish them. const auto &devices = device_manager.devices(); const bool multiple_dev = hw_dev && any_of( devices.begin(), devices.end(), [&](shared_ptr dev) { return dev->hardware_device()->vendor() == hw_dev->vendor() && dev->hardware_device()->model() == hw_dev->model() && dev->device_ != device_; }); vector parts = {device_->vendor(), device_->model()}; if (multiple_dev) { parts.push_back(device_->version()); parts.push_back(device_->serial_number()); if ((device_->serial_number().length() == 0) && (device_->connection_id().length() > 0)) parts.push_back("(" + device_->connection_id() + ")"); } return join(parts, " "); } void HardwareDevice::open() { if (device_open_) close(); try { device_->open(); } catch (const sigrok::Error &e) { throw QString(e.what()); } device_open_ = true; // Set up the session session_ = context_->create_session(); session_->add_device(device_); } void HardwareDevice::close() { if (device_open_) device_->close(); if (session_) session_->remove_devices(); device_open_ = false; } } // namespace devices } // namespace pv pulseview-0.4.0/pv/devices/sessionfile.cpp000600 001750 001750 00000002504 13117760425 020275 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "sessionfile.hpp" using std::shared_ptr; using std::string; namespace pv { namespace devices { SessionFile::SessionFile(const shared_ptr context, const string &file_name) : File(file_name), context_(context) { } void SessionFile::open() { if (session_) close(); session_ = context_->load_session(file_name_); device_ = session_->devices()[0]; } void SessionFile::close() { if (session_) session_->remove_devices(); } } // namespace devices } // namespace pv pulseview-0.4.0/pv/devices/inputfile.hpp000600 001750 001750 00000003337 13117760425 017763 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DEVICE_INPUTFILE_HPP #define PULSEVIEW_PV_DEVICE_INPUTFILE_HPP #include #include #include "file.hpp" using std::atomic; using std::ifstream; using std::map; using std::shared_ptr; using std::streamsize; using std::string; namespace pv { namespace devices { class InputFile final : public File { private: static const streamsize BufferSize; public: InputFile(const shared_ptr &context, const string &file_name, shared_ptr format, const map &options); void open(); void close(); void start(); void run(); void stop(); private: const shared_ptr context_; const shared_ptr format_; const map options_; shared_ptr input_; ifstream *f; atomic interrupt_; }; } // namespace devices } // namespace pv #endif // PULSEVIEW_PV_SESSIONS_INPUTFILE_HPP pulseview-0.4.0/pv/session.hpp000600 001750 001750 00000012706 13117760426 016026 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012-14 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_SESSION_HPP #define PULSEVIEW_PV_SESSION_HPP #include #include #include #include #include #include #include #include #include #include #include #include "util.hpp" #include "views/viewbase.hpp" using std::function; using std::list; using std::map; using std::mutex; using std::recursive_mutex; using std::shared_ptr; using std::string; using std::unordered_set; struct srd_decoder; struct srd_channel; namespace sigrok { class Analog; class Channel; class Device; class InputFormat; class Logic; class Meta; class OutputFormat; class Packet; class Session; } // namespace sigrok namespace pv { class DeviceManager; namespace data { class Analog; class AnalogSegment; class Logic; class LogicSegment; class SignalBase; class SignalData; } namespace devices { class Device; } namespace toolbars { class MainBar; } namespace views { class ViewBase; } class Session : public QObject { Q_OBJECT public: enum capture_state { Stopped, AwaitingTrigger, Running }; public: Session(DeviceManager &device_manager, QString name); ~Session(); DeviceManager& device_manager(); const DeviceManager& device_manager() const; shared_ptr session() const; shared_ptr device() const; QString name() const; void set_name(QString name); const list< shared_ptr > views() const; shared_ptr main_view() const; shared_ptr main_bar() const; void set_main_bar(shared_ptr main_bar); /** * Indicates whether the captured data was saved to disk already or not */ bool data_saved() const; void save_settings(QSettings &settings) const; void restore_settings(QSettings &settings); /** * Attempts to set device instance, may fall back to demo if needed */ void select_device(shared_ptr device); /** * Sets device instance that will be used in the next capture session. */ void set_device(shared_ptr device); void set_default_device(); void load_init_file(const string &file_name, const string &format); void load_file(QString file_name, shared_ptr format = nullptr, const map &options = map()); capture_state get_capture_state() const; void start_capture(function error_handler); void stop_capture(); double get_samplerate() const; void register_view(shared_ptr view); void deregister_view(shared_ptr view); bool has_view(shared_ptr view); const unordered_set< shared_ptr > signalbases() const; #ifdef ENABLE_DECODE bool add_decoder(srd_decoder *const dec); void remove_decode_signal(shared_ptr signalbase); #endif private: void set_capture_state(capture_state state); void update_signals(); shared_ptr signalbase_from_channel( shared_ptr channel) const; private: void sample_thread_proc(function error_handler); void free_unused_memory(); void feed_in_header(); void feed_in_meta(shared_ptr meta); void feed_in_trigger(); void feed_in_frame_begin(); void feed_in_logic(shared_ptr logic); void feed_in_analog(shared_ptr analog); void data_feed_in(shared_ptr device, shared_ptr packet); private: DeviceManager &device_manager_; shared_ptr device_; QString default_name_, name_; list< shared_ptr > views_; shared_ptr main_view_; shared_ptr main_bar_; mutable mutex sampling_mutex_; //!< Protects access to capture_state_. capture_state capture_state_; unordered_set< shared_ptr > signalbases_; unordered_set< shared_ptr > all_signal_data_; mutable recursive_mutex data_mutex_; shared_ptr logic_data_; uint64_t cur_samplerate_; shared_ptr cur_logic_segment_; map< shared_ptr, shared_ptr > cur_analog_segments_; std::thread sampling_thread_; bool out_of_memory_; bool data_saved_; Q_SIGNALS: void capture_state_changed(int state); void device_changed(); void signals_changed(); void name_changed(); void trigger_event(util::Timestamp location); void frame_began(); void data_received(); void frame_ended(); void add_view(const QString &title, views::ViewType type, Session *session); public Q_SLOTS: void on_data_saved(); }; } // namespace pv #endif // PULSEVIEW_PV_SESSION_HPP pulseview-0.4.0/pv/widgets/000700 001750 001750 00000000000 13117760503 015264 5ustar00uweuwe000000 000000 pulseview-0.4.0/pv/widgets/decodergroupbox.hpp000600 001750 001750 00000002642 13117760426 021202 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_HPP #define PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_HPP #include class QGridLayout; class QToolBar; namespace pv { namespace widgets { class DecoderGroupBox : public QWidget { Q_OBJECT public: DecoderGroupBox(QString title, QString tooltip, QWidget *parent = nullptr, bool isDeletable = true); void add_layout(QLayout *layout); void set_decoder_visible(bool visible); Q_SIGNALS: void delete_decoder(); void show_hide_decoder(); private: QGridLayout *const layout_; QPushButton show_hide_button_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_HPP pulseview-0.4.0/pv/widgets/sweeptimingwidget.hpp000600 001750 001750 00000003340 13117760426 021542 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_HPP #define PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_HPP #include #include #include #include #include #include namespace pv { namespace widgets { class SweepTimingWidget : public QWidget { Q_OBJECT private: enum ValueType { None, MinMaxStep, List }; public: SweepTimingWidget(const char *suffix, QWidget *parent = nullptr); void show_none(); void show_min_max_step(uint64_t min, uint64_t max, uint64_t step); void show_list(const uint64_t *vals, size_t count); void show_125_list(uint64_t min, uint64_t max); uint64_t value() const; void set_value(uint64_t value); Q_SIGNALS: void value_changed(); private: const char *const suffix_; QHBoxLayout layout_; QDoubleSpinBox value_; QComboBox list_; ValueType value_type_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_HPP pulseview-0.4.0/pv/widgets/exportmenu.hpp000600 001750 001750 00000002771 13117760426 020220 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_EXPORTMENU_HPP #define PULSEVIEW_PV_WIDGETS_EXPORTMENU_HPP #include #include #include using std::shared_ptr; using std::vector; namespace sigrok { class Context; class OutputFormat; } namespace pv { namespace widgets { class ExportMenu : public QMenu { Q_OBJECT; public: ExportMenu(QWidget *parent, shared_ptr context, vectoropen_actions = vector()); private Q_SLOTS: void on_action(QObject *action); Q_SIGNALS: void format_selected(shared_ptr format); private: shared_ptr context_; QSignalMapper mapper_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_EXPORTMENU_HPP pulseview-0.4.0/pv/widgets/devicetoolbutton.hpp000600 001750 001750 00000005073 13117760426 021401 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2014 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_HPP #define PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_HPP #include #include #include #include #include #include #include using std::list; using std::shared_ptr; using std::vector; using std::weak_ptr; struct srd_decoder; namespace pv { class DeviceManager; namespace devices { class Device; } namespace widgets { class DeviceToolButton : public QToolButton { Q_OBJECT; public: /** * Constructor * @param parent the parent widget. * @param device_manager the device manager. * @param connect_action the connect-to-device action. */ DeviceToolButton(QWidget *parent, DeviceManager &device_manager, QAction *connect_action); /** * Returns a reference to the selected device. */ shared_ptr selected_device(); /** * Sets the current list of devices. * @param device the list of devices. * @param selected_device the currently active device. */ void set_device_list( const list< shared_ptr > &devices, shared_ptr selected); /** * Sets the current device to "no device". Useful for when a selected * device fails to open. */ void reset(); private: /** * Repopulates the menu from the device list. */ void update_device_list(); private Q_SLOTS: void on_action(QObject *action); void on_menu_hovered(QAction *action); void on_menu_hover_timeout(); Q_SIGNALS: void device_selected(); private: DeviceManager &device_manager_; QAction *const connect_action_; QMenu menu_; QSignalMapper mapper_; shared_ptr selected_device_; vector< weak_ptr > devices_; QString device_tooltip_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_HPP pulseview-0.4.0/pv/widgets/devicetoolbutton.cpp000600 001750 001750 00000007671 13117760426 021402 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #include #include #include "devicetoolbutton.hpp" using std::list; using std::shared_ptr; using std::string; using std::weak_ptr; using std::vector; using pv::devices::Device; namespace pv { namespace widgets { DeviceToolButton::DeviceToolButton(QWidget *parent, DeviceManager &device_manager, QAction *connect_action) : QToolButton(parent), device_manager_(device_manager), connect_action_(connect_action), menu_(this), mapper_(this), devices_() { setPopupMode(QToolButton::MenuButtonPopup); setMenu(&menu_); setDefaultAction(connect_action_); setMinimumWidth(QFontMetrics(font()).averageCharWidth() * 24); connect(&mapper_, SIGNAL(mapped(QObject*)), this, SLOT(on_action(QObject*))); connect(&menu_, SIGNAL(hovered(QAction*)), this, SLOT(on_menu_hovered(QAction*))); } shared_ptr DeviceToolButton::selected_device() { return selected_device_; } void DeviceToolButton::set_device_list( const list< shared_ptr > &devices, shared_ptr selected) { selected_device_ = selected; setText(selected ? QString::fromStdString( selected->display_name(device_manager_)) : tr("")); devices_ = vector< weak_ptr >(devices.begin(), devices.end()); update_device_list(); } void DeviceToolButton::reset() { setText(tr("")); selected_device_.reset(); update_device_list(); } void DeviceToolButton::update_device_list() { menu_.clear(); menu_.addAction(connect_action_); menu_.setDefaultAction(connect_action_); menu_.addSeparator(); for (weak_ptr dev_weak_ptr : devices_) { shared_ptr dev(dev_weak_ptr.lock()); if (!dev) continue; QAction *const a = new QAction(QString::fromStdString( dev->display_name(device_manager_)), this); a->setCheckable(true); a->setChecked(selected_device_ == dev); a->setData(qVariantFromValue((void*)dev.get())); a->setToolTip(QString::fromStdString(dev->full_name())); mapper_.setMapping(a, a); connect(a, SIGNAL(triggered()), &mapper_, SLOT(map())); menu_.addAction(a); } } void DeviceToolButton::on_action(QObject *action) { assert(action); selected_device_.reset(); Device *const dev = (Device*)((QAction*)action)->data().value(); for (weak_ptr dev_weak_ptr : devices_) { shared_ptr dev_ptr(dev_weak_ptr); if (dev_ptr.get() == dev) { selected_device_ = shared_ptr(dev_ptr); break; } } update_device_list(); setText(QString::fromStdString( selected_device_->display_name(device_manager_))); device_selected(); } void DeviceToolButton::on_menu_hovered(QAction *action) { assert(action); // Only show the tooltip for device entries (they hold // device pointers in their data field) if (!action->data().isValid()) return; device_tooltip_ = action->toolTip(); if (QToolTip::isVisible()) on_menu_hover_timeout(); else QTimer::singleShot(1000, this, SLOT(on_menu_hover_timeout())); } void DeviceToolButton::on_menu_hover_timeout() { if (device_tooltip_.isEmpty()) return; QToolTip::showText(QCursor::pos(), device_tooltip_); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/popuptoolbutton.cpp000600 001750 001750 00000002644 13117760426 021301 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include "popuptoolbutton.hpp" namespace pv { namespace widgets { PopupToolButton::PopupToolButton(QWidget *parent) : QToolButton(parent), popup_(nullptr) { connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool))); } Popup* PopupToolButton::popup() const { return popup_; } void PopupToolButton::set_popup(Popup *popup) { assert(popup); popup_ = popup; } void PopupToolButton::on_clicked(bool) { if (!popup_) return; const QRect r = rect(); popup_->set_position(mapToGlobal(QPoint((r.left() + r.right()) / 2, ((r.top() + r.bottom() * 3) / 4))), Popup::Bottom); popup_->show(); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/importmenu.hpp000600 001750 001750 00000002717 13117760426 020211 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_IMPORTMENU_HPP #define PULSEVIEW_PV_WIDGETS_IMPORTMENU_HPP #include #include #include using std::shared_ptr; namespace sigrok { class Context; class InputFormat; } namespace pv { namespace widgets { class ImportMenu : public QMenu { Q_OBJECT; public: ImportMenu(QWidget *parent, shared_ptr context, QAction *open_action = nullptr); private Q_SLOTS: void on_action(QObject *action); Q_SIGNALS: void format_selected(shared_ptr format); private: shared_ptr context_; QSignalMapper mapper_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_IMPORTMENU_HPP pulseview-0.4.0/pv/widgets/exportmenu.cpp000600 001750 001750 00000005031 13117760426 020203 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #include #include "exportmenu.hpp" using std::find_if; using std::map; using std::pair; using std::string; using std::shared_ptr; using std::vector; using sigrok::Context; using sigrok::OutputFormat; namespace pv { namespace widgets { ExportMenu::ExportMenu(QWidget *parent, shared_ptr context, vectoropen_actions) : QMenu(parent), context_(context), mapper_(this) { assert(context); if (!open_actions.empty()) { bool first_action = true; for (auto open_action : open_actions) { addAction(open_action); if (first_action) { first_action = false; setDefaultAction(open_action); } } addSeparator(); } const map > formats = context->output_formats(); for (const pair > &f : formats) { if (f.first == "srzip") continue; assert(f.second); QAction *const action = addAction(tr("Export %1...") .arg(QString::fromStdString(f.second->description()))); action->setData(qVariantFromValue((void*)f.second.get())); mapper_.setMapping(action, action); connect(action, SIGNAL(triggered()), &mapper_, SLOT(map())); } connect(&mapper_, SIGNAL(mapped(QObject*)), this, SLOT(on_action(QObject*))); } void ExportMenu::on_action(QObject *action) { assert(action); const map > formats = context_->output_formats(); const auto iter = find_if(formats.cbegin(), formats.cend(), [&](const pair > &f) { return f.second.get() == ((QAction*)action)->data().value(); }); if (iter == formats.cend()) return; format_selected((*iter).second); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/decodermenu.hpp000600 001750 001750 00000002557 13117760426 020306 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_DECODERMENU_HPP #define PULSEVIEW_PV_WIDGETS_DECODERMENU_HPP #include #include struct srd_decoder; namespace pv { namespace widgets { class DecoderMenu : public QMenu { Q_OBJECT; public: DecoderMenu(QWidget *parent, bool first_level_decoder = false); private: static int decoder_name_cmp(const void *a, const void *b); private Q_SLOTS: void on_action(QObject *action); Q_SIGNALS: void decoder_selected(srd_decoder *decoder); private: QSignalMapper mapper_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_DECODERMENU_HPP pulseview-0.4.0/pv/widgets/importmenu.cpp000600 001750 001750 00000004500 13117760426 020174 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #include #include "importmenu.hpp" using std::find_if; using std::map; using std::pair; using std::string; using std::shared_ptr; using sigrok::Context; using sigrok::InputFormat; namespace pv { namespace widgets { ImportMenu::ImportMenu(QWidget *parent, shared_ptr context, QAction *open_action) : QMenu(parent), context_(context), mapper_(this) { assert(context); if (open_action) { addAction(open_action); setDefaultAction(open_action); addSeparator(); } const map > formats = context->input_formats(); for (const pair > &f : formats) { assert(f.second); QAction *const action = addAction(tr("Import %1...") .arg(QString::fromStdString(f.second->description()))); action->setData(qVariantFromValue((void*)f.second.get())); mapper_.setMapping(action, action); connect(action, SIGNAL(triggered()), &mapper_, SLOT(map())); } connect(&mapper_, SIGNAL(mapped(QObject*)), this, SLOT(on_action(QObject*))); } void ImportMenu::on_action(QObject *action) { assert(action); const map > formats = context_->input_formats(); const auto iter = find_if(formats.cbegin(), formats.cend(), [&](const pair > &f) { return f.second.get() == ((QAction*)action)->data().value(); }); if (iter == formats.cend()) return; format_selected((*iter).second); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/popup.hpp000600 001750 001750 00000003623 13117760426 017152 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_POPUP_HPP #define PULSEVIEW_PV_WIDGETS_POPUP_HPP #include namespace pv { namespace widgets { class Popup : public QWidget { Q_OBJECT public: enum Position { Right, Top, Left, Bottom }; private: static const unsigned int ArrowLength; static const unsigned int ArrowOverlap; static const unsigned int MarginWidth; public: Popup(QWidget *parent); const QPoint& point() const; Position position() const; void set_position(const QPoint point, Position pos); bool eventFilter(QObject *obj, QEvent *event); void show(); private: bool space_for_arrow() const; QPolygon arrow_polygon() const; QRegion arrow_region() const; QRect bubble_rect() const; QRegion bubble_region() const; QRegion popup_region() const; void reposition_widget(); private: void closeEvent(QCloseEvent*); void paintEvent(QPaintEvent*); void resizeEvent(QResizeEvent*); void mouseReleaseEvent(QMouseEvent *event); protected: void showEvent(QShowEvent *); Q_SIGNALS: void closed(); private: QPoint point_; Position pos_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_POPUP_HPP pulseview-0.4.0/pv/widgets/wellarray.hpp000600 001750 001750 00000010760 13117760426 020011 0ustar00uweuwe000000 000000 /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef PULSEVIEW_PV_WIDGETS_WELLARRAY_HPP #define PULSEVIEW_PV_WIDGETS_WELLARRAY_HPP #include namespace pv { namespace widgets { struct WellArrayData; class WellArray : public QWidget { Q_OBJECT Q_PROPERTY(int selectedColumn READ selectedColumn) Q_PROPERTY(int selectedRow READ selectedRow) public: WellArray(int rows, int cols, QWidget* parent = nullptr); QString cellContent(int row, int col) const; int selectedColumn() const { return selCol; } int selectedRow() const { return selRow; } virtual void setCurrent(int row, int col); virtual void setSelected(int row, int col); QSize sizeHint() const; virtual void setCellBrush(int row, int col, const QBrush &); QBrush cellBrush(int row, int col); inline int cellWidth() const { return cellw; } inline int cellHeight() const { return cellh; } inline int rowAt(int y) const { return y / cellh; } inline int columnAt(int x) const { if (isRightToLeft()) return ncols - (x / cellw) - 1; return x / cellw; } inline int rowY(int row) const { return cellh * row; } inline int columnX(int column) const { if (isRightToLeft()) return cellw * (ncols - column - 1); return cellw * column; } inline int numRows() const { return nrows; } inline int numCols() const {return ncols; } inline QRect cellRect() const { return QRect(0, 0, cellw, cellh); } inline QSize gridSize() const { return QSize(ncols * cellw, nrows * cellh); } QRect cellGeometry(int row, int column) { QRect r; if (row >= 0 && row < nrows && column >= 0 && column < ncols) r.setRect(columnX(column), rowY(row), cellw, cellh); return r; } inline void updateCell(int row, int column) { update(cellGeometry(row, column)); } Q_SIGNALS: void selected(int row, int col); protected: virtual void paintCell(QPainter *, int row, int col, const QRect&); virtual void paintCellContents(QPainter *, int row, int col, const QRect&); void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void keyPressEvent(QKeyEvent*); void focusInEvent(QFocusEvent*); void focusOutEvent(QFocusEvent*); void paintEvent(QPaintEvent*); private: Q_DISABLE_COPY(WellArray) int nrows; int ncols; int cellw; int cellh; int curRow; int curCol; int selRow; int selCol; WellArrayData *d; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_WELLARRAY_HPP pulseview-0.4.0/pv/widgets/colourpopup.hpp000600 001750 001750 00000002505 13117760426 020374 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP #define PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP #include "popup.hpp" #include "wellarray.hpp" #include namespace pv { namespace widgets { class ColourPopup : public Popup { Q_OBJECT public: ColourPopup(int rows, int cols, QWidget *parent); WellArray& well_array(); Q_SIGNALS: void selected(int row, int col); private Q_SLOTS: void colour_selected(int, int); private: WellArray well_array_; QVBoxLayout layout_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP pulseview-0.4.0/pv/widgets/wellarray.cpp000600 001750 001750 00000020217 13117760426 020002 0ustar00uweuwe000000 000000 /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include #include "wellarray.hpp" namespace pv { namespace widgets { void WellArray::paintEvent(QPaintEvent *event) { QRect r = event->rect(); int cx = r.x(); int cy = r.y(); int ch = r.height(); int cw = r.width(); int colfirst = columnAt(cx); int collast = columnAt(cx + cw); int rowfirst = rowAt(cy); int rowlast = rowAt(cy + ch); if (isRightToLeft()) { int t = colfirst; colfirst = collast; collast = t; } QPainter painter(this); QPainter *p = &painter; QRect rect(0, 0, cellWidth(), cellHeight()); if (collast < 0 || collast >= ncols) collast = ncols-1; if (rowlast < 0 || rowlast >= nrows) rowlast = nrows-1; // Go through the rows for (int r = rowfirst; r <= rowlast; ++r) { // get row position and height int rowp = rowY(r); // Go through the columns in the row r // if we know from where to where, go through [colfirst, collast], // else go through all of them for (int c = colfirst; c <= collast; ++c) { // get position and width of column c int colp = columnX(c); // Translate painter and draw the cell rect.translate(colp, rowp); paintCell(p, r, c, rect); rect.translate(-colp, -rowp); } } } struct WellArrayData { QBrush *brush; }; WellArray::WellArray(int rows, int cols, QWidget *parent) : QWidget(parent) ,nrows(rows), ncols(cols) { d = nullptr; setFocusPolicy(Qt::StrongFocus); cellw = 28; cellh = 24; curCol = 0; curRow = 0; selCol = -1; selRow = -1; } QSize WellArray::sizeHint() const { ensurePolished(); return gridSize().boundedTo(QSize(640, 480)); } void WellArray::paintCell(QPainter* p, int row, int col, const QRect &rect) { int b = 3; //margin const QPalette& g = palette(); QStyleOptionFrame opt; int dfw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); opt.lineWidth = dfw; opt.midLineWidth = 1; opt.rect = rect.adjusted(b, b, -b, -b); opt.palette = g; opt.state = QStyle::State_Enabled | QStyle::State_Sunken; style()->drawPrimitive(QStyle::PE_Frame, &opt, p, this); b += dfw; if ((row == curRow) && (col == curCol)) { if (hasFocus()) { QStyleOptionFocusRect opt; opt.palette = g; opt.rect = rect; opt.state = QStyle::State_None | QStyle::State_KeyboardFocusChange; style()->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, p, this); } } paintCellContents(p, row, col, opt.rect.adjusted(dfw, dfw, -dfw, -dfw)); } /*! Reimplement this function to change the contents of the well array. */ void WellArray::paintCellContents(QPainter *p, int row, int col, const QRect &r) { if (d) { p->fillRect(r, d->brush[row*numCols()+col]); } else { p->fillRect(r, Qt::white); p->setPen(Qt::black); p->drawLine(r.topLeft(), r.bottomRight()); p->drawLine(r.topRight(), r.bottomLeft()); } } void WellArray::mousePressEvent(QMouseEvent *event) { // The current cell marker is set to the cell the mouse is pressed in QPoint pos = event->pos(); setCurrent(rowAt(pos.y()), columnAt(pos.x())); } void WellArray::mouseReleaseEvent(QMouseEvent * /* event */) { // The current cell marker is set to the cell the mouse is clicked in setSelected(curRow, curCol); } /* Sets the cell currently having the focus. This is not necessarily the same as the currently selected cell. */ void WellArray::setCurrent(int row, int col) { if ((curRow == row) && (curCol == col)) return; if (row < 0 || col < 0) row = col = -1; int oldRow = curRow; int oldCol = curCol; curRow = row; curCol = col; updateCell(oldRow, oldCol); updateCell(curRow, curCol); } /* Sets the currently selected cell to \a row, \a column. If \a row or \a column are less than zero, the current cell is unselected. Does not set the position of the focus indicator. */ void WellArray::setSelected(int row, int col) { int oldRow = selRow; int oldCol = selCol; if (row < 0 || col < 0) row = col = -1; selCol = col; selRow = row; updateCell(oldRow, oldCol); updateCell(selRow, selCol); if (row >= 0) selected(row, col); } void WellArray::focusInEvent(QFocusEvent*) { updateCell(curRow, curCol); } void WellArray::setCellBrush(int row, int col, const QBrush &b) { if (!d) { d = new WellArrayData; int i = numRows()*numCols(); d->brush = new QBrush[i]; } if (row >= 0 && row < numRows() && col >= 0 && col < numCols()) d->brush[row*numCols()+col] = b; } /* Returns the brush set for the cell at \a row, \a column. If no brush is set, Qt::NoBrush is returned. */ QBrush WellArray::cellBrush(int row, int col) { if (d && row >= 0 && row < numRows() && col >= 0 && col < numCols()) return d->brush[row*numCols()+col]; return Qt::NoBrush; } /*!\reimp */ void WellArray::focusOutEvent(QFocusEvent*) { updateCell(curRow, curCol); } /*\reimp */ void WellArray::keyPressEvent(QKeyEvent* event) { switch (event->key()) { // Look at the key code case Qt::Key_Left: // If 'left arrow'-key, if (curCol > 0) // and cr't not in leftmost col setCurrent(curRow, curCol - 1); // set cr't to next left column break; case Qt::Key_Right: // Correspondingly... if (curCol < numCols()-1) setCurrent(curRow, curCol + 1); break; case Qt::Key_Up: if (curRow > 0) setCurrent(curRow - 1, curCol); break; case Qt::Key_Down: if (curRow < numRows()-1) setCurrent(curRow + 1, curCol); break; case Qt::Key_Space: setSelected(curRow, curCol); break; default: // If not an interesting key, event->ignore(); // we don't accept the event return; } } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/popuptoolbutton.hpp000600 001750 001750 00000002373 13117760426 021305 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_HPP #define PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_HPP #include "popup.hpp" #include namespace pv { namespace widgets { class PopupToolButton : public QToolButton { Q_OBJECT; public: PopupToolButton(QWidget *parent); Popup* popup() const; void set_popup(Popup *popup); private Q_SLOTS: void on_clicked(bool); private: Popup *popup_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_HPP pulseview-0.4.0/pv/widgets/timestampspinbox.hpp000600 001750 001750 00000004557 13117760426 021424 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Jens Steinhauser * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_TIMESTAMPSPINBOX_HPP #define PULSEVIEW_PV_WIDGETS_TIMESTAMPSPINBOX_HPP #include "pv/util.hpp" #include namespace pv { namespace widgets { class TimestampSpinBox : public QAbstractSpinBox { Q_OBJECT Q_PROPERTY(unsigned precision READ precision WRITE setPrecision) // Needed because of some strange behaviour of the Qt4 MOC that would add // a reference to a 'staticMetaObject' member of 'pv::util' (the namespace) // if pv::util::Timestamp is used directly in the Q_PROPERTY macros below. // Didn't happen with the Qt5 MOC in this case, however others have had // similar problems with Qt5: https://bugreports.qt.io/browse/QTBUG-37519 typedef pv::util::Timestamp Timestamp; Q_PROPERTY(Timestamp singleStep READ singleStep WRITE setSingleStep) Q_PROPERTY(Timestamp value READ value WRITE setValue NOTIFY valueChanged USER true) public: TimestampSpinBox(QWidget* parent = nullptr); void stepBy(int steps) override; StepEnabled stepEnabled() const override; unsigned precision() const; void setPrecision(unsigned precision); const pv::util::Timestamp& singleStep() const; void setSingleStep(const pv::util::Timestamp& step); const pv::util::Timestamp& value() const; QSize minimumSizeHint() const override; public Q_SLOTS: void setValue(const pv::util::Timestamp& val); Q_SIGNALS: void valueChanged(const pv::util::Timestamp&); private Q_SLOTS: void on_editingFinished(); private: unsigned precision_; pv::util::Timestamp stepsize_; pv::util::Timestamp value_; void updateEdit(); }; } // namespace widgets } // namespace pv #endif pulseview-0.4.0/pv/widgets/decodergroupbox.cpp000600 001750 001750 00000004642 13117760426 021177 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include "decodergroupbox.hpp" #include #include #include #include #include namespace pv { namespace widgets { DecoderGroupBox::DecoderGroupBox(QString title, QString tooltip, QWidget *parent, bool isDeletable) : QWidget(parent), layout_(new QGridLayout), show_hide_button_(QIcon(":/icons/decoder-shown.svg"), QString(), this) { layout_->setContentsMargins(0, 0, 0, 0); setLayout(layout_); auto *lbl = new QLabel(QString("

%1

").arg(title)); lbl->setToolTip(tooltip); layout_->addWidget(lbl, 0, 0); layout_->setColumnStretch(0, 1); QHBoxLayout *const toolbar = new QHBoxLayout; layout_->addLayout(toolbar, 0, 1); show_hide_button_.setToolTip(tr("Show/hide this decoder trace")); show_hide_button_.setFlat(true); show_hide_button_.setIconSize(QSize(16, 16)); connect(&show_hide_button_, SIGNAL(clicked()), this, SIGNAL(show_hide_decoder())); toolbar->addWidget(&show_hide_button_); if (isDeletable) { QPushButton *const delete_button = new QPushButton( QIcon(":/icons/decoder-delete.svg"), QString(), this); delete_button->setToolTip(tr("Delete this decoder trace")); delete_button->setFlat(true); delete_button->setIconSize(QSize(16, 16)); connect(delete_button, SIGNAL(clicked()), this, SIGNAL(delete_decoder())); toolbar->addWidget(delete_button); } } void DecoderGroupBox::add_layout(QLayout *layout) { assert(layout); layout_->addLayout(layout, 1, 0, 1, 2); } void DecoderGroupBox::set_decoder_visible(bool visible) { show_hide_button_.setIcon(QIcon(visible ? ":/icons/decoder-shown.svg" : ":/icons/decoder-hidden.svg")); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/colourbutton.hpp000600 001750 001750 00000003045 13117760426 020544 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP #define PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP #include #include "colourpopup.hpp" namespace pv { namespace widgets { class ColourButton : public QPushButton { Q_OBJECT; private: static const int SwatchMargin; public: ColourButton(int rows, int cols, QWidget *parent); ColourPopup& popup(); const QColor& colour() const; void set_colour(QColor colour); void set_palette(const QColor *const palette); private: void paintEvent(QPaintEvent *event); private Q_SLOTS: void on_clicked(bool); void on_selected(int row, int col); Q_SIGNALS: void selected(const QColor &colour); private: ColourPopup popup_; QColor cur_colour_; }; } // namespace widgets } // namespace pv #endif // PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP pulseview-0.4.0/pv/widgets/decodermenu.cpp000600 001750 001750 00000003745 13117760426 020301 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "decodermenu.hpp" namespace pv { namespace widgets { DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) : QMenu(parent), mapper_(this) { GSList *l = g_slist_sort(g_slist_copy( (GSList*)srd_decoder_list()), decoder_name_cmp); for (; l; l = l->next) { const srd_decoder *const d = (srd_decoder*)l->data; assert(d); const bool have_channels = (d->channels || d->opt_channels) != 0; if (first_level_decoder == have_channels) { QAction *const action = addAction(QString::fromUtf8(d->name)); action->setData(qVariantFromValue(l->data)); mapper_.setMapping(action, action); connect(action, SIGNAL(triggered()), &mapper_, SLOT(map())); } } g_slist_free(l); connect(&mapper_, SIGNAL(mapped(QObject*)), this, SLOT(on_action(QObject*))); } int DecoderMenu::decoder_name_cmp(const void *a, const void *b) { return strcmp(((const srd_decoder*)a)->name, ((const srd_decoder*)b)->name); } void DecoderMenu::on_action(QObject *action) { assert(action); srd_decoder *const dec = (srd_decoder*)((QAction*)action)->data().value(); assert(dec); decoder_selected(dec); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/popup.cpp000600 001750 001750 00000014744 13117760426 017153 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #include #include #include "popup.hpp" using std::max; using std::min; namespace pv { namespace widgets { const unsigned int Popup::ArrowLength = 10; const unsigned int Popup::ArrowOverlap = 3; const unsigned int Popup::MarginWidth = 6; Popup::Popup(QWidget *parent) : QWidget(parent, Qt::Popup | Qt::FramelessWindowHint), point_(), pos_(Left) { } const QPoint& Popup::point() const { return point_; } Popup::Position Popup::position() const { return pos_; } void Popup::set_position(const QPoint point, Position pos) { point_ = point, pos_ = pos; setContentsMargins( MarginWidth + ((pos == Right) ? ArrowLength : 0), MarginWidth + ((pos == Bottom) ? ArrowLength : 0), MarginWidth + ((pos == Left) ? ArrowLength : 0), MarginWidth + ((pos == Top) ? ArrowLength : 0)); } bool Popup::eventFilter(QObject *obj, QEvent *event) { QKeyEvent *keyEvent; (void)obj; if (event->type() == QEvent::KeyPress) { keyEvent = static_cast(event); if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) { close(); return true; } } return false; } void Popup::show() { QLineEdit* le; QWidget::show(); // We want to close the popup when the Enter key was // pressed and the first editable widget had focus. if ((le = this->findChild())) { // For combo boxes we need to hook into the parent of // the line edit (i.e. the QComboBox). For edit boxes // we hook into the widget directly. if (le->parent()->metaObject()->className() == this->metaObject()->className()) le->installEventFilter(this); else le->parent()->installEventFilter(this); le->selectAll(); le->setFocus(); } } bool Popup::space_for_arrow() const { // Check if there is room for the arrow switch (pos_) { case Right: if (point_.x() > x()) return false; return true; case Bottom: if (point_.y() > y()) return false; return true; case Left: if (point_.x() < (x() + width())) return false; return true; case Top: if (point_.y() < (y() + height())) return false; return true; } return true; } QPolygon Popup::arrow_polygon() const { QPolygon poly; const QPoint p = mapFromGlobal(point_); const int l = ArrowLength + ArrowOverlap; switch (pos_) { case Right: poly << QPoint(p.x() + l, p.y() - l); break; case Bottom: poly << QPoint(p.x() - l, p.y() + l); break; case Left: case Top: poly << QPoint(p.x() - l, p.y() - l); break; } poly << p; switch (pos_) { case Right: case Bottom: poly << QPoint(p.x() + l, p.y() + l); break; case Left: poly << QPoint(p.x() - l, p.y() + l); break; case Top: poly << QPoint(p.x() + l, p.y() - l); break; } return poly; } QRegion Popup::arrow_region() const { return QRegion(arrow_polygon()); } QRect Popup::bubble_rect() const { return QRect( QPoint((pos_ == Right) ? ArrowLength : 0, (pos_ == Bottom) ? ArrowLength : 0), QSize(width() - ((pos_ == Left || pos_ == Right) ? ArrowLength : 0), height() - ((pos_ == Top || pos_ == Bottom) ? ArrowLength : 0))); } QRegion Popup::bubble_region() const { const QRect rect(bubble_rect()); const unsigned int r = MarginWidth; const unsigned int d = 2 * r; return QRegion(rect.adjusted(r, 0, -r, 0)).united( QRegion(rect.adjusted(0, r, 0, -r))).united( QRegion(rect.left(), rect.top(), d, d, QRegion::Ellipse)).united( QRegion(rect.right() - d, rect.top(), d, d, QRegion::Ellipse)).united( QRegion(rect.left(), rect.bottom() - d, d, d, QRegion::Ellipse)).united( QRegion(rect.right() - d, rect.bottom() - d, d, d, QRegion::Ellipse)); } QRegion Popup::popup_region() const { if (space_for_arrow()) return arrow_region().united(bubble_region()); else return bubble_region(); } void Popup::reposition_widget() { QPoint o; const QRect screen_rect = QApplication::desktop()->availableGeometry( QApplication::desktop()->screenNumber(point_)); if (pos_ == Right || pos_ == Left) o.ry() = -height() / 2; else o.rx() = -width() / 2; if (pos_ == Left) o.rx() = -width(); else if (pos_ == Top) o.ry() = -height(); o += point_; move(max(min(o.x(), screen_rect.right() - width()), screen_rect.left()), max(min(o.y(), screen_rect.bottom() - height()), screen_rect.top())); } void Popup::closeEvent(QCloseEvent*) { closed(); } void Popup::paintEvent(QPaintEvent*) { QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); const QColor outline_color(QApplication::palette().color( QPalette::Dark)); // Draw the bubble const QRegion b = bubble_region(); const QRegion bubble_outline = QRegion(rect()).subtracted( b.translated(1, 0).intersected(b.translated(0, 1).intersected( b.translated(-1, 0).intersected(b.translated(0, -1))))); painter.setPen(Qt::NoPen); painter.setBrush(QApplication::palette().brush(QPalette::Window)); painter.drawRect(rect()); // Draw the arrow if (!space_for_arrow()) return; const QPoint ArrowOffsets[] = { QPoint(1, 0), QPoint(0, -1), QPoint(-1, 0), QPoint(0, 1)}; const QRegion a(arrow_region()); const QRegion arrow_outline = a.subtracted( a.translated(ArrowOffsets[pos_])); painter.setClipRegion(bubble_outline.subtracted(a).united( arrow_outline)); painter.setBrush(outline_color); painter.drawRect(rect()); } void Popup::resizeEvent(QResizeEvent*) { reposition_widget(); setMask(popup_region()); } void Popup::mouseReleaseEvent(QMouseEvent *event) { assert(event); // We need our own out-of-bounds click handler because QWidget counts // the drop-shadow region as inside the widget if (!bubble_rect().contains(event->pos())) close(); } void Popup::showEvent(QShowEvent*) { reposition_widget(); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/colourbutton.cpp000600 001750 001750 00000005317 13117760426 020543 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include "colourbutton.hpp" #include #include #include namespace pv { namespace widgets { const int ColourButton::SwatchMargin = 7; ColourButton::ColourButton(int rows, int cols, QWidget *parent) : QPushButton("", parent), popup_(rows, cols, this) { connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool))); connect(&popup_, SIGNAL(selected(int, int)), this, SLOT(on_selected(int, int))); } ColourPopup& ColourButton::popup() { return popup_; } const QColor& ColourButton::colour() const { return cur_colour_; } void ColourButton::set_colour(QColor colour) { cur_colour_ = colour; const unsigned int rows = popup_.well_array().numRows(); const unsigned int cols = popup_.well_array().numCols(); for (unsigned int r = 0; r < rows; r++) for (unsigned int c = 0; c < cols; c++) if (popup_.well_array().cellBrush(r, c).color() == colour) { popup_.well_array().setSelected(r, c); popup_.well_array().setCurrent(r, c); return; } } void ColourButton::set_palette(const QColor *const palette) { assert(palette); const unsigned int rows = popup_.well_array().numRows(); const unsigned int cols = popup_.well_array().numCols(); for (unsigned int r = 0; r < rows; r++) for (unsigned int c = 0; c < cols; c++) popup_.well_array().setCellBrush(r, c, QBrush(palette[r * cols + c])); } void ColourButton::on_clicked(bool) { popup_.set_position(mapToGlobal(rect().center()), Popup::Bottom); popup_.show(); } void ColourButton::on_selected(int row, int col) { cur_colour_ = popup_.well_array().cellBrush(row, col).color(); selected(cur_colour_); } void ColourButton::paintEvent(QPaintEvent *event) { QPushButton::paintEvent(event); QPainter p(this); const QRect r = rect().adjusted(SwatchMargin, SwatchMargin, -SwatchMargin, -SwatchMargin); p.setPen(QApplication::palette().color(QPalette::Dark)); p.setBrush(QBrush(cur_colour_)); p.drawRect(r); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/timestampspinbox.cpp000600 001750 001750 00000005500 13117760426 021404 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Jens Steinhauser * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include "timestampspinbox.hpp" #include #include namespace pv { namespace widgets { TimestampSpinBox::TimestampSpinBox(QWidget* parent) : QAbstractSpinBox(parent) , precision_(9) , stepsize_("1e-6") { connect(this, SIGNAL(editingFinished()), this, SLOT(on_editingFinished())); updateEdit(); } void TimestampSpinBox::stepBy(int steps) { setValue(value_ + steps * stepsize_); } QAbstractSpinBox::StepEnabled TimestampSpinBox::stepEnabled() const { return QAbstractSpinBox::StepUpEnabled | QAbstractSpinBox::StepDownEnabled; } unsigned TimestampSpinBox::precision() const { return precision_; } void TimestampSpinBox::setPrecision(unsigned precision) { precision_ = precision; updateEdit(); } const pv::util::Timestamp& TimestampSpinBox::singleStep() const { return stepsize_; } void TimestampSpinBox::setSingleStep(const pv::util::Timestamp& step) { stepsize_ = step; } const pv::util::Timestamp& TimestampSpinBox::value() const { return value_; } QSize TimestampSpinBox::minimumSizeHint() const { const QFontMetrics fm(fontMetrics()); const int l = round(value_).str().size() + precision_ + 10; const int w = fm.width(QString(l, '0')); const int h = lineEdit()->minimumSizeHint().height(); return QSize(w, h); } void TimestampSpinBox::setValue(const pv::util::Timestamp& val) { if (val == value_) return; value_ = val; updateEdit(); valueChanged(value_); } void TimestampSpinBox::on_editingFinished() { if (!lineEdit()->isModified()) return; lineEdit()->setModified(false); QRegExp re(R"(\s*([-+]?)\s*([0-9]+\.?[0-9]*).*)"); if (re.exactMatch(text())) { QStringList captures = re.capturedTexts(); captures.removeFirst(); // remove entire match QString str = captures.join(""); setValue(pv::util::Timestamp(str.toStdString())); } else { // replace the malformed entered string with the old value updateEdit(); } } void TimestampSpinBox::updateEdit() { QString newtext = pv::util::format_time_si( value_, pv::util::SIPrefix::none, precision_); lineEdit()->setText(newtext); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/sweeptimingwidget.cpp000600 001750 001750 00000007745 13117760426 021552 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include "sweeptimingwidget.hpp" #include #include #include #include using std::abs; using std::vector; namespace pv { namespace widgets { SweepTimingWidget::SweepTimingWidget(const char *suffix, QWidget *parent) : QWidget(parent), suffix_(suffix), layout_(this), value_(this), list_(this), value_type_(None) { setContentsMargins(0, 0, 0, 0); value_.setDecimals(0); value_.setSuffix(QString::fromUtf8(suffix)); connect(&list_, SIGNAL(currentIndexChanged(int)), this, SIGNAL(value_changed())); connect(&value_, SIGNAL(editingFinished()), this, SIGNAL(value_changed())); setLayout(&layout_); layout_.setMargin(0); layout_.addWidget(&list_); layout_.addWidget(&value_); show_none(); } void SweepTimingWidget::show_none() { value_type_ = None; value_.hide(); list_.hide(); } void SweepTimingWidget::show_min_max_step(uint64_t min, uint64_t max, uint64_t step) { assert(max > min); assert(step > 0); value_type_ = MinMaxStep; value_.setRange(min, max); value_.setSingleStep(step); value_.show(); list_.hide(); } void SweepTimingWidget::show_list(const uint64_t *vals, size_t count) { value_type_ = List; list_.clear(); for (size_t i = 0; i < count; i++) { char *const s = sr_si_string_u64(vals[i], suffix_); list_.addItem(QString::fromUtf8(s), qVariantFromValue(vals[i])); g_free(s); } value_.hide(); list_.show(); } void SweepTimingWidget::show_125_list(uint64_t min, uint64_t max) { assert(max > min); // Create a 1-2-5-10 list of entries. const unsigned int FineScales[] = {1, 2, 5}; uint64_t value, decade; unsigned int fine; vector values; // Compute the starting decade for (decade = 1; decade * 10 <= min; decade *= 10); // Compute the first entry for (fine = 0; fine < countof(FineScales); fine++) if (FineScales[fine] * decade >= min) break; assert(fine < countof(FineScales)); // Add the minimum entry if it's not on the 1-2-5 progression if (min != FineScales[fine] * decade) values.push_back(min); while ((value = FineScales[fine] * decade) < max) { values.push_back(value); if (++fine >= countof(FineScales)) fine = 0, decade *= 10; } // Add the max value values.push_back(max); // Make a C array, and give it to the sweep timing widget uint64_t *const values_array = new uint64_t[values.size()]; copy(values.begin(), values.end(), values_array); show_list(values_array, values.size()); delete[] values_array; } uint64_t SweepTimingWidget::value() const { switch (value_type_) { case None: return 0; case MinMaxStep: return (uint64_t)value_.value(); case List: { const int index = list_.currentIndex(); return (index >= 0) ? list_.itemData( index).value() : 0; } default: // Unexpected value type assert(false); return 0; } } void SweepTimingWidget::set_value(uint64_t value) { value_.setValue(value); int best_match = list_.count() - 1; int64_t best_variance = INT64_MAX; for (int i = 0; i < list_.count(); i++) { const int64_t this_variance = abs( (int64_t)value - list_.itemData(i).value()); if (this_variance < best_variance) { best_variance = this_variance; best_match = i; } } list_.setCurrentIndex(best_match); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/widgets/colourpopup.cpp000600 001750 001750 00000002532 13117760426 020367 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include "colourpopup.hpp" namespace pv { namespace widgets { ColourPopup::ColourPopup(int rows, int cols, QWidget *parent) : Popup(parent), well_array_(rows, cols, this), layout_(this) { layout_.addWidget(&well_array_); setLayout(&layout_); connect(&well_array_, SIGNAL(selected(int, int)), this, SIGNAL(selected(int, int))); connect(&well_array_, SIGNAL(selected(int, int)), this, SLOT(colour_selected(int, int))); } WellArray& ColourPopup::well_array() { return well_array_; } void ColourPopup::colour_selected(int, int) { close(); } } // namespace widgets } // namespace pv pulseview-0.4.0/pv/prop/000700 001750 001750 00000000000 13117760503 014576 5ustar00uweuwe000000 000000 pulseview-0.4.0/pv/prop/enum.hpp000600 001750 001750 00000003026 13117760426 016262 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_PROP_ENUM_HPP #define PULSEVIEW_PV_PROP_ENUM_HPP #include #include #include "property.hpp" #include using std::pair; using std::vector; Q_DECLARE_METATYPE(Glib::VariantBase); class QComboBox; namespace pv { namespace prop { class Enum : public Property { Q_OBJECT; public: Enum(QString name, QString desc, vector > values, Getter getter, Setter setter); virtual ~Enum() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); void commit(); private Q_SLOTS: void on_current_item_changed(int); private: const vector< pair > values_; QComboBox *selector_; }; } // namespace prop } // namespace pv #endif // PULSEVIEW_PV_PROP_ENUM_HPP pulseview-0.4.0/pv/prop/property.hpp000600 001750 001750 00000003404 13117760426 017202 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_PROP_PROPERTY_HPP #define PULSEVIEW_PV_PROP_PROPERTY_HPP #include // Suppress warnings due to use of deprecated std::auto_ptr<> by glibmm. G_GNUC_BEGIN_IGNORE_DEPRECATIONS #include G_GNUC_END_IGNORE_DEPRECATIONS #include #include #include using std::function; class QWidget; namespace pv { namespace prop { class Property : public QObject { Q_OBJECT; public: typedef function Getter; typedef function Setter; protected: Property(QString name, QString desc, Getter getter, Setter setter); public: const QString& name() const; const QString& desc() const; virtual QWidget* get_widget(QWidget *parent, bool auto_commit = false) = 0; virtual bool labeled_widget() const; virtual void commit() = 0; protected: const Getter getter_; const Setter setter_; private: QString name_; QString desc_; }; } // namespace prop } // namespace pv #endif // PULSEVIEW_PV_PROP_PROPERTY_HPP pulseview-0.4.0/pv/prop/double.hpp000600 001750 001750 00000003160 13117760426 016567 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_PROP_DOUBLE_HPP #define PULSEVIEW_PV_PROP_DOUBLE_HPP #include #include #include "property.hpp" using std::pair; class QDoubleSpinBox; namespace pv { namespace prop { class Double : public Property { Q_OBJECT public: Double(QString name, QString desc, int decimals, QString suffix, boost::optional< pair > range, boost::optional step, Getter getter, Setter setter); virtual ~Double() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); void commit(); private Q_SLOTS: void on_value_changed(double); private: const int decimals_; const QString suffix_; const boost::optional< pair > range_; const boost::optional step_; QDoubleSpinBox *spin_box_; }; } // namespace prop } // namespace pv #endif // PULSEVIEW_PV_PROP_DOUBLE_HPP pulseview-0.4.0/pv/prop/property.cpp000600 001750 001750 00000002246 13117760426 017200 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include "property.hpp" namespace pv { namespace prop { Property::Property(QString name, QString desc, Getter getter, Setter setter) : getter_(getter), setter_(setter), name_(name), desc_(desc) { } const QString& Property::name() const { return name_; } const QString& Property::desc() const { return desc_; } bool Property::labeled_widget() const { return false; } } // namespace prop } // namespace pv pulseview-0.4.0/pv/prop/bool.hpp000600 001750 001750 00000002463 13117760426 016255 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_PROP_BOOL_HPP #define PULSEVIEW_PV_PROP_BOOL_HPP #include "property.hpp" class QCheckBox; namespace pv { namespace prop { class Bool : public Property { Q_OBJECT; public: Bool(QString name, QString desc, Getter getter, Setter setter); virtual ~Bool() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); bool labeled_widget() const; void commit(); private Q_SLOTS: void on_state_changed(int); private: QCheckBox *check_box_; }; } // namespace prop } // namespace pv #endif // PULSEVIEW_PV_PROP_BOOL_HPP pulseview-0.4.0/pv/prop/double.cpp000600 001750 001750 00000004146 13117760426 016567 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "double.hpp" using boost::optional; using std::pair; namespace pv { namespace prop { Double::Double(QString name, QString desc, int decimals, QString suffix, optional< pair > range, optional step, Getter getter, Setter setter) : Property(name, desc, getter, setter), decimals_(decimals), suffix_(suffix), range_(range), step_(step), spin_box_(nullptr) { } QWidget* Double::get_widget(QWidget *parent, bool auto_commit) { if (spin_box_) return spin_box_; if (!getter_) return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) return nullptr; double value = Glib::VariantBase::cast_dynamic>( variant).get(); spin_box_ = new QDoubleSpinBox(parent); spin_box_->setDecimals(decimals_); spin_box_->setSuffix(suffix_); if (range_) spin_box_->setRange(range_->first, range_->second); if (step_) spin_box_->setSingleStep(*step_); spin_box_->setValue(value); if (auto_commit) connect(spin_box_, SIGNAL(valueChanged(double)), this, SLOT(on_value_changed(double))); return spin_box_; } void Double::commit() { assert(setter_); if (!spin_box_) return; setter_(Glib::Variant::create(spin_box_->value())); } void Double::on_value_changed(double) { commit(); } } // namespace prop } // namespace pv pulseview-0.4.0/pv/prop/int.cpp000600 001750 001750 00000010703 13117760426 016103 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include "int.hpp" using boost::optional; using std::max; using std::min; using std::pair; namespace pv { namespace prop { Int::Int(QString name, QString desc, QString suffix, optional< pair > range, Getter getter, Setter setter) : Property(name, desc, getter, setter), suffix_(suffix), range_(range), spin_box_(nullptr) { } QWidget* Int::get_widget(QWidget *parent, bool auto_commit) { int64_t int_val = 0, range_min = 0; uint64_t range_max = 0; if (spin_box_) return spin_box_; if (!getter_) return nullptr; value_ = getter_(); GVariant *value = value_.gobj(); if (!value) return nullptr; spin_box_ = new QSpinBox(parent); spin_box_->setSuffix(suffix_); const GVariantType *const type = g_variant_get_type(value); assert(type); if (g_variant_type_equal(type, G_VARIANT_TYPE_BYTE)) { int_val = g_variant_get_byte(value); range_min = 0, range_max = UINT8_MAX; } else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT16)) { int_val = g_variant_get_int16(value); range_min = INT16_MIN, range_max = INT16_MAX; } else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT16)) { int_val = g_variant_get_uint16(value); range_min = 0, range_max = UINT16_MAX; } else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT32)) { int_val = g_variant_get_int32(value); range_min = INT32_MIN, range_max = INT32_MAX; } else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT32)) { int_val = g_variant_get_uint32(value); range_min = 0, range_max = UINT32_MAX; } else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT64)) { int_val = g_variant_get_int64(value); range_min = INT64_MIN, range_max = INT64_MAX; } else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64)) { int_val = g_variant_get_uint64(value); range_min = 0, range_max = UINT64_MAX; } else { // Unexpected value type. assert(false); } // @todo sigrok supports 64-bit quantities, but Qt does not have a // standard widget to allow the values to be modified over the full // 64-bit range on 32-bit machines. To solve the issue we need a // custom widget. range_min = max(range_min, (int64_t)INT_MIN); range_max = min(range_max, (uint64_t)INT_MAX); if (range_) spin_box_->setRange((int)range_->first, (int)range_->second); else spin_box_->setRange((int)range_min, (int)range_max); spin_box_->setValue((int)int_val); if (auto_commit) connect(spin_box_, SIGNAL(valueChanged(int)), this, SLOT(on_value_changed(int))); return spin_box_; } void Int::commit() { assert(setter_); if (!spin_box_) return; GVariant *new_value = nullptr; const GVariantType *const type = g_variant_get_type(value_.gobj()); assert(type); if (g_variant_type_equal(type, G_VARIANT_TYPE_BYTE)) new_value = g_variant_new_byte(spin_box_->value()); else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT16)) new_value = g_variant_new_int16(spin_box_->value()); else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT16)) new_value = g_variant_new_uint16(spin_box_->value()); else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT32)) new_value = g_variant_new_int32(spin_box_->value()); else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT32)) new_value = g_variant_new_uint32(spin_box_->value()); else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT64)) new_value = g_variant_new_int64(spin_box_->value()); else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64)) new_value = g_variant_new_uint64(spin_box_->value()); else { // Unexpected value type. assert(false); } assert(new_value); value_ = Glib::VariantBase(new_value); setter_(value_); } void Int::on_value_changed(int) { commit(); } } // namespace prop } // namespace pv pulseview-0.4.0/pv/prop/string.cpp000600 001750 001750 00000003557 13117760426 016630 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include "string.hpp" using std::string; using Glib::ustring; namespace pv { namespace prop { String::String(QString name, QString desc, Getter getter, Setter setter) : Property(name, desc, getter, setter), line_edit_(nullptr) { } QWidget* String::get_widget(QWidget *parent, bool auto_commit) { if (line_edit_) return line_edit_; if (!getter_) return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) return nullptr; string value = Glib::VariantBase::cast_dynamic>( variant).get(); line_edit_ = new QLineEdit(parent); line_edit_->setText(QString::fromStdString(value)); if (auto_commit) connect(line_edit_, SIGNAL(textEdited(const QString&)), this, SLOT(on_text_edited(const QString&))); return line_edit_; } void String::commit() { assert(setter_); if (!line_edit_) return; QByteArray ba = line_edit_->text().toLocal8Bit(); setter_(Glib::Variant::create(ba.data())); } void String::on_text_edited(const QString&) { commit(); } } // namespace prop } // namespace pv pulseview-0.4.0/pv/prop/bool.cpp000600 001750 001750 00000003527 13117760426 016252 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "bool.hpp" namespace pv { namespace prop { Bool::Bool(QString name, QString desc, Getter getter, Setter setter) : Property(name, desc, getter, setter), check_box_(nullptr) { } QWidget* Bool::get_widget(QWidget *parent, bool auto_commit) { if (check_box_) return check_box_; if (!getter_) return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) return nullptr; bool value = Glib::VariantBase::cast_dynamic>( variant).get(); check_box_ = new QCheckBox(name(), parent); check_box_->setToolTip(desc()); check_box_->setCheckState(value ? Qt::Checked : Qt::Unchecked); if (auto_commit) connect(check_box_, SIGNAL(stateChanged(int)), this, SLOT(on_state_changed(int))); return check_box_; } bool Bool::labeled_widget() const { return true; } void Bool::commit() { assert(setter_); if (!check_box_) return; setter_(Glib::Variant::create( check_box_->checkState() == Qt::Checked)); } void Bool::on_state_changed(int) { commit(); } } // namespace prop } // namespace pv pulseview-0.4.0/pv/prop/enum.cpp000600 001750 001750 00000003777 13117760426 016272 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "enum.hpp" using std::pair; using std::vector; namespace pv { namespace prop { Enum::Enum(QString name, QString desc, vector > values, Getter getter, Setter setter) : Property(name, desc, getter, setter), values_(values), selector_(nullptr) { } QWidget* Enum::get_widget(QWidget *parent, bool auto_commit) { if (selector_) return selector_; if (!getter_) return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) return nullptr; selector_ = new QComboBox(parent); for (unsigned int i = 0; i < values_.size(); i++) { const pair &v = values_[i]; selector_->addItem(v.second, qVariantFromValue(v.first)); if (v.first.equal(variant)) selector_->setCurrentIndex(i); } if (auto_commit) connect(selector_, SIGNAL(currentIndexChanged(int)), this, SLOT(on_current_item_changed(int))); return selector_; } void Enum::commit() { assert(setter_); if (!selector_) return; const int index = selector_->currentIndex(); if (index < 0) return; setter_(selector_->itemData(index).value()); } void Enum::on_current_item_changed(int) { commit(); } } // namespace prop } // namespace pv pulseview-0.4.0/pv/prop/string.hpp000600 001750 001750 00000002413 13117760426 016623 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_PROP_STRING_HPP #define PULSEVIEW_PV_PROP_STRING_HPP #include "property.hpp" class QLineEdit; namespace pv { namespace prop { class String : public Property { Q_OBJECT; public: String(QString name, QString desc, Getter getter, Setter setter); QWidget* get_widget(QWidget *parent, bool auto_commit); void commit(); private Q_SLOTS: void on_text_edited(const QString&); private: QLineEdit *line_edit_; }; } // namespace prop } // namespace pv #endif // PULSEVIEW_PV_PROP_STRING_HPP pulseview-0.4.0/pv/prop/int.hpp000600 001750 001750 00000003003 13117760426 016103 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_PROP_INT_HPP #define PULSEVIEW_PV_PROP_INT_HPP #include #include #include "property.hpp" using std::pair; class QSpinBox; namespace pv { namespace prop { class Int : public Property { Q_OBJECT; public: Int(QString name, QString desc, QString suffix, boost::optional< pair > range, Getter getter, Setter setter); virtual ~Int() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); void commit(); private Q_SLOTS: void on_value_changed(int); private: const QString suffix_; const boost::optional< pair > range_; Glib::VariantBase value_; QSpinBox *spin_box_; }; } // namespace prop } // namespace pv #endif // PULSEVIEW_PV_PROP_INT_HPP pulseview-0.4.0/pv/binding/000700 001750 001750 00000000000 13117760503 015230 5ustar00uweuwe000000 000000 pulseview-0.4.0/pv/binding/binding.cpp000600 001750 001750 00000004360 13117760425 017356 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #include "binding.hpp" using std::shared_ptr; using std::string; using std::vector; namespace pv { namespace binding { const vector< shared_ptr >& Binding::properties() { return properties_; } void Binding::commit() { for (shared_ptr p : properties_) { assert(p); p->commit(); } } void Binding::add_properties_to_form(QFormLayout *layout, bool auto_commit) const { assert(layout); for (shared_ptr p : properties_) { assert(p); QWidget *const widget = p->get_widget(layout->parentWidget(), auto_commit); if (p->labeled_widget()) { layout->addRow(widget); } else { auto *lbl = new QLabel(p->name()); lbl->setToolTip(p->desc()); layout->addRow(lbl, widget); } } } QWidget* Binding::get_property_form(QWidget *parent, bool auto_commit) const { QWidget *const form = new QWidget(parent); QFormLayout *const layout = new QFormLayout(form); form->setLayout(layout); add_properties_to_form(layout, auto_commit); return form; } QString Binding::print_gvariant(Glib::VariantBase gvar) { QString s; if (!gvar.gobj()) s = QString::fromStdString("(null)"); else if (gvar.is_of_type(Glib::VariantType("s"))) s = QString::fromStdString( Glib::VariantBase::cast_dynamic>( gvar).get()); else s = QString::fromStdString(gvar.print()); return s; } } // namespace binding } // namespace pv pulseview-0.4.0/pv/binding/inputoutput.hpp000600 001750 001750 00000004360 13117760425 020371 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_BINDING_INPUTOUTPUT_HPP #define PULSEVIEW_PV_BINDING_INPUTOUTPUT_HPP #include #include #include #include "binding.hpp" #include using std::map; using std::shared_ptr; using std::string; using std::vector; namespace sigrok { class Option; } namespace pv { namespace binding { /** * A binding of glibmm variants for sigrok input and output options. */ class InputOutput : public Binding { public: /** * Constructs a new @c InputOutput binding. * @param options the map of options to use as a template. */ InputOutput(const map> &options); /** * Gets the map of selected options. * @return the options. */ const map& options() const; private: /** * A helper function to bind an option list to and enum property. * @param name the name of the property. * @param name the description of the property. * @param values the list of values. * @param getter the getter that will read the values out of the map. * @param setter the setter that will set the values into the map. */ shared_ptr bind_enum(const QString &name, const QString &desc, const vector &values, prop::Property::Getter getter, prop::Property::Setter setter); private: /** * The current map of options. */ map options_; }; } // namespace binding } // namespace pv #endif // PULSEVIEW_PV_BINDING_INPUTOUTPUT_H pulseview-0.4.0/pv/binding/binding.hpp000600 001750 001750 00000003264 13117760425 017365 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_BINDING_BINDING_HPP #define PULSEVIEW_PV_BINDING_BINDING_HPP #include // Suppress warnings due to use of deprecated std::auto_ptr<> by glibmm. G_GNUC_BEGIN_IGNORE_DEPRECATIONS #include G_GNUC_END_IGNORE_DEPRECATIONS #include #include #include using std::shared_ptr; using std::vector; class QFormLayout; class QWidget; namespace pv { namespace prop { class Property; } namespace binding { class Binding { public: const vector< shared_ptr >& properties(); void commit(); void add_properties_to_form(QFormLayout *layout, bool auto_commit = false) const; QWidget* get_property_form(QWidget *parent, bool auto_commit = false) const; static QString print_gvariant(Glib::VariantBase gvar); protected: vector< shared_ptr > properties_; }; } // namespace binding } // namespace pv #endif // PULSEVIEW_PV_BINDING_BINDING_HPP pulseview-0.4.0/pv/binding/decoder.hpp000600 001750 001750 00000003276 13117760425 017363 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_BINDING_DECODER_HPP #define PULSEVIEW_PV_BINDING_DECODER_HPP #include "binding.hpp" #include using std::shared_ptr; struct srd_decoder_option; namespace pv { namespace data { class DecoderStack; namespace decode { class Decoder; } } namespace binding { class Decoder : public Binding { public: Decoder(shared_ptr decoder_stack, shared_ptr decoder); private: static shared_ptr bind_enum(const QString &name, const QString &desc, const srd_decoder_option *option, prop::Property::Getter getter, prop::Property::Setter setter); Glib::VariantBase getter(const char *id); void setter(const char *id, Glib::VariantBase value); private: shared_ptr decoder_stack_; shared_ptr decoder_; }; } // namespace binding } // namespace pv #endif // PULSEVIEW_PV_BINDING_DECODER_HPP pulseview-0.4.0/pv/binding/decoder.cpp000600 001750 001750 00000007531 13117760425 017354 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2013 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include "decoder.hpp" #include #include #include #include #include #include #include using boost::none; using std::make_pair; using std::map; using std::pair; using std::shared_ptr; using std::string; using std::vector; using pv::prop::Double; using pv::prop::Enum; using pv::prop::Int; using pv::prop::Property; using pv::prop::String; namespace pv { namespace binding { Decoder::Decoder( shared_ptr decoder_stack, shared_ptr decoder) : decoder_stack_(decoder_stack), decoder_(decoder) { assert(decoder_); const srd_decoder *const dec = decoder_->decoder(); assert(dec); for (GSList *l = dec->options; l; l = l->next) { const srd_decoder_option *const opt = (srd_decoder_option*)l->data; const QString name = QString::fromUtf8(opt->desc); const Property::Getter get = [&, opt]() { return getter(opt->id); }; const Property::Setter set = [&, opt](Glib::VariantBase value) { setter(opt->id, value); }; shared_ptr prop; if (opt->values) prop = bind_enum(name, "", opt, get, set); else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("d"))) prop = shared_ptr(new Double(name, "", 2, "", none, none, get, set)); else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("x"))) prop = shared_ptr( new Int(name, "", "", none, get, set)); else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("s"))) prop = shared_ptr( new String(name, "", get, set)); else continue; properties_.push_back(prop); } } shared_ptr Decoder::bind_enum( const QString &name, const QString &desc, const srd_decoder_option *option, Property::Getter getter, Property::Setter setter) { vector< pair > values; for (GSList *l = option->values; l; l = l->next) { Glib::VariantBase var = Glib::VariantBase((GVariant*)l->data, true); values.push_back(make_pair(var, print_gvariant(var))); } return shared_ptr(new Enum(name, desc, values, getter, setter)); } Glib::VariantBase Decoder::getter(const char *id) { GVariant *val = nullptr; assert(decoder_); // Get the value from the hash table if it is already present const map& options = decoder_->options(); const auto iter = options.find(id); if (iter != options.end()) val = (*iter).second; else { assert(decoder_->decoder()); // Get the default value if not for (GSList *l = decoder_->decoder()->options; l; l = l->next) { const srd_decoder_option *const opt = (srd_decoder_option*)l->data; if (strcmp(opt->id, id) == 0) { val = opt->def; break; } } } return (val) ? Glib::VariantBase(val, true) : Glib::VariantBase(); } void Decoder::setter(const char *id, Glib::VariantBase value) { assert(decoder_); decoder_->set_option(id, value.gobj()); assert(decoder_stack_); decoder_stack_->begin_decode(); } } // namespace binding } // namespace pv pulseview-0.4.0/pv/binding/device.hpp000600 001750 001750 00000004337 13117760425 017214 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_BINDING_DEVICE_HPP #define PULSEVIEW_PV_BINDING_DEVICE_HPP #include #include #include #include "binding.hpp" #include #include using std::function; using std::pair; using std::set; using std::shared_ptr; namespace pv { namespace binding { class Device : public QObject, public Binding { Q_OBJECT public: Device(shared_ptr configurable); Q_SIGNALS: void config_changed(); private: void bind_bool(const QString &name, const QString &desc, prop::Property::Getter getter, prop::Property::Setter setter); void bind_enum(const QString &name, const QString &desc, const sigrok::ConfigKey *key, set capabilities, prop::Property::Getter getter, prop::Property::Setter setter, function printer = print_gvariant); void bind_int(const QString &name, const QString &desc, QString suffix, boost::optional< pair > range, prop::Property::Getter getter, prop::Property::Setter setter); static QString print_timebase(Glib::VariantBase gvar); static QString print_vdiv(Glib::VariantBase gvar); static QString print_voltage_threshold(Glib::VariantBase gvar); static QString print_probe_factor(Glib::VariantBase gvar); protected: shared_ptr configurable_; }; } // namespace binding } // namespace pv #endif // PULSEVIEW_PV_BINDING_DEVICE_HPP pulseview-0.4.0/pv/binding/device.cpp000600 001750 001750 00000012351 13117760425 017202 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include "device.hpp" #include #include #include #include using boost::optional; using std::function; using std::make_pair; using std::pair; using std::set; using std::shared_ptr; using std::string; using std::vector; using sigrok::Capability; using sigrok::Configurable; using sigrok::ConfigKey; using sigrok::Error; using pv::prop::Bool; using pv::prop::Enum; using pv::prop::Int; using pv::prop::Property; namespace pv { namespace binding { Device::Device(shared_ptr configurable) : configurable_(configurable) { auto keys = configurable->config_keys(); for (auto key : keys) { auto capabilities = configurable->config_capabilities(key); if (!capabilities.count(Capability::GET) || !capabilities.count(Capability::SET)) continue; string name_str; try { name_str = key->description(); } catch (Error e) { name_str = key->name(); } const QString name = QString::fromStdString(name_str); const Property::Getter get = [&, key]() { return configurable_->config_get(key); }; const Property::Setter set = [&, key](Glib::VariantBase value) { configurable_->config_set(key, value); config_changed(); }; switch (key->id()) { case SR_CONF_SAMPLERATE: // Sample rate values are not bound because they are shown // in the MainBar break; case SR_CONF_CAPTURE_RATIO: bind_int(name, "", "%", pair(0, 100), get, set); break; case SR_CONF_PATTERN_MODE: case SR_CONF_BUFFERSIZE: case SR_CONF_TRIGGER_SOURCE: case SR_CONF_TRIGGER_SLOPE: case SR_CONF_COUPLING: case SR_CONF_CLOCK_EDGE: bind_enum(name, "", key, capabilities, get, set); break; case SR_CONF_FILTER: case SR_CONF_EXTERNAL_CLOCK: case SR_CONF_RLE: case SR_CONF_POWER_OFF: bind_bool(name, "", get, set); break; case SR_CONF_TIMEBASE: bind_enum(name, "", key, capabilities, get, set, print_timebase); break; case SR_CONF_VDIV: bind_enum(name, "", key, capabilities, get, set, print_vdiv); break; case SR_CONF_VOLTAGE_THRESHOLD: bind_enum(name, "", key, capabilities, get, set, print_voltage_threshold); break; case SR_CONF_PROBE_FACTOR: if (capabilities.count(Capability::LIST)) bind_enum(name, "", key, capabilities, get, set, print_probe_factor); else bind_int(name, "", "", pair(1, 500), get, set); break; default: break; } } } void Device::bind_bool(const QString &name, const QString &desc, Property::Getter getter, Property::Setter setter) { assert(configurable_); properties_.push_back(shared_ptr(new Bool( name, desc, getter, setter))); } void Device::bind_enum(const QString &name, const QString &desc, const ConfigKey *key, set capabilities, Property::Getter getter, Property::Setter setter, function printer) { assert(configurable_); if (!capabilities.count(Capability::LIST)) return; try { Glib::VariantContainerBase gvar = configurable_->config_list(key); Glib::VariantIter iter(gvar); vector< pair > values; while ((iter.next_value(gvar))) values.push_back(make_pair(gvar, printer(gvar))); properties_.push_back(shared_ptr(new Enum(name, desc, values, getter, setter))); } catch (sigrok::Error& e) { qDebug() << "Error: Listing device key" << name << "failed!"; return; } } void Device::bind_int(const QString &name, const QString &desc, QString suffix, optional< pair > range, Property::Getter getter, Property::Setter setter) { assert(configurable_); properties_.push_back(shared_ptr(new Int(name, desc, suffix, range, getter, setter))); } QString Device::print_timebase(Glib::VariantBase gvar) { uint64_t p, q; g_variant_get(gvar.gobj(), "(tt)", &p, &q); return QString::fromUtf8(sr_period_string(p, q)); } QString Device::print_vdiv(Glib::VariantBase gvar) { uint64_t p, q; g_variant_get(gvar.gobj(), "(tt)", &p, &q); return QString::fromUtf8(sr_voltage_string(p, q)); } QString Device::print_voltage_threshold(Glib::VariantBase gvar) { gdouble lo, hi; g_variant_get(gvar.gobj(), "(dd)", &lo, &hi); return QString("L<%1V H>%2V").arg(lo, 0, 'f', 1).arg(hi, 0, 'f', 1); } QString Device::print_probe_factor(Glib::VariantBase gvar) { uint64_t factor; factor = g_variant_get_uint64(gvar.gobj()); return QString("%1x").arg(factor); } } // namespace binding } // namespace pv pulseview-0.4.0/pv/binding/inputoutput.cpp000600 001750 001750 00000006451 13117760425 020367 0ustar00uweuwe000000 000000 /* * This file is part of the PulseView project. * * Copyright (C) 2015 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #include #include #include #include #include #include #include #include #include #include "inputoutput.hpp" using boost::none; using std::make_pair; using std::map; using std::pair; using std::shared_ptr; using std::string; using std::vector; using Glib::VariantBase; using Glib::VariantType; using sigrok::Option; using pv::prop::Bool; using pv::prop::Double; using pv::prop::Enum; using pv::prop::Int; using pv::prop::Property; using pv::prop::String; namespace pv { namespace binding { InputOutput::InputOutput( const map> &options) { for (pair> o : options) { const shared_ptr