$ show analogdevicesinc/scopy
Scopy is a cross-platform Qt/C++ desktop application for signal analysis and instrument control, developed by Analog Devices. It provides a software oscilloscope, spectrum analyzer, signal generator, logic analyzer, data logger, and many other test-and-measurement tools. The application communicates with Analog Devices hardware (M2K, AD936x, ADRV9009, etc.) via the IIO (Industrial I/O) framework and libiio, and integrates GNU Radio for real-time signal processing pipelines. Scopy features a modular plugin architecture where each hardware target or instrument is a separate plugin package, loaded dynamically at runtime. The core framework provides reusable GUI widgets (plotting, menus, docking), an IIO attribute abstraction layer (iio-widgets), an asynchronous command queue for device operations, and a JavaScript scripting API for automation and testing. The codebase is large and well-structured, with extensive CI/CD for Linux, macOS, Windows, Android, and ARM platforms, but contains some legacy code and mixed API styles that indicate moderate technical drift.
The LLM identified 3 files worth highlighting for reuse:
Provides a fluent builder API for creating IIO attribute widgets (combo, range, checkbox, etc.) using a strategy pattern. The builder decouples data access (DataStrategyInterface) from UI rendering (GuiStrategyInterface), allowing the same widget to work with synchronous or asynchronous IIO reads/writes. This component is self-contained, depends only on Qt and libiio, and can be extracted to build generic device configuration UIs for any IIO-based hardware.
Implements an asynchronous command queue for IIO operations. Commands (e.g., attribute read/write, buffer operations) are enqueued and executed on a dedicated thread, with signals for completion and error handling. The pattern is generic and reusable for any application that needs thread-safe, ordered execution of I/O operations with callback notification. It is isolated from the rest of Scopy and depends only on Qt and libiio.
A custom Qwt plot magnifier that supports mouse-wheel zoom, rubber-band zoom, and panning with configurable modifiers. It handles edge cases like zoom limits, axis synchronization, and gesture conflicts. This component is a drop-in replacement for QwtPlotMagnifier and can be reused in any Qwt-based plotting application. It demonstrates careful handling of Qt mouse events and Qwt plot transformations.