# analogdevicesinc/scopy architecture

> Architecture diagram of the GitHub repository analogdevicesinc/scopy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/analogdevicesinc/scopy
- Repository: https://github.com/analogdevicesinc/scopy

## Overview

##### High-Level Architecture Components

a. Core Layer:
- Main window management, device management, and plugin infrastructure
- Tool menu system and device browser

b. Plugin Layer:
- ADC Plugin
- DAC Plugin
- Power Quality Monitor (PQM)
- Network Analyzer
- Digital I/O
- Register Map
- Debugger
- Data Logger

c. Common Services Layer:
- GUI Utilities (/gui directory)
- IIO Utilities (/iioutil directory)
- GR Utilities (/gr-util directory)
- Common Libraries (/common directory)

##### Integration Points

Connections between components:

a. Plugin Management:
- Plugin interface defined in /pluginbase

b. Device Communication:
- IIO device layer connecting hardware to plugins
- Device factory and management system

##### Cross-Cutting Concerns

Overlays or side containers for:

a. Build System:
- CMake configuration
- Platform-specific builds (Windows, Linux, macOS, Android)

b. Resource Management:
- Translations
- Styles and Themes
- Documentation

##### Specific Component Details

For each major component, include:

a. Core:
- Device Management
- Tool Menu System
- Window Management
- Plugin Infrastructure

b. Plugins:
- Individual instrument functionality
- GUI components
- Hardware interfaces

##### Resource management

This architecture reflects Scopy's nature as a modular, plugin-based oscilloscope and signal analysis toolset with strong hardware integration capabilities and cross-platform support.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        MainWindow["Main Window"]
        DeviceManager["Device Manager"]
        PluginManager["Plugin Manager"]
        ToolMenu["Tool Menu"]
    end

    subgraph Plugins
        ADC["ADC Plugin"]
        DAC["DAC Plugin"]
        PQM["Power Quality Monitor"]
        RegMap["Register Map"]
        Debugger["Debugger"]
        DataLogger["Data Logger"]
    end

    subgraph Common
        GUI["GUI Utilities"]
        IIO["IIO Utilities"]
        GR["GR Utilities"]
        CommonLib["Common Libraries"]
    end

    subgraph PluginBase
        PluginAPI["Plugin API"]
        ResourceMgr["Resource Manager"]
    end

    subgraph BuildSystem
        CMake["CMake Config"]
        Windows["Windows Build"]
        Ubuntu["Ubuntu Build"]
        MacOS["MacOS Build"]
    end

    subgraph Resources
        Translations["Translations"]
        Docs["Documentation"]
        Styles["Styles"]
    end

    MainWindow --> PluginManager
    PluginManager --> DeviceManager
    PluginManager --> ToolMenu
    PluginManager --> |Loads| Plugins
    DeviceManager --> IIO

    PluginBase --> Plugins
    Common --> Plugins
    Resources --> MainWindow

    BuildSystem --> MainWindow

    %% Click events for component mapping
    click MainWindow "https://github.com/analogdevicesinc/scopy/blob/main/core/src/scopymainwindow.cpp"
    click DeviceManager "https://github.com/analogdevicesinc/scopy/blob/main/core/src/devicemanager.cpp"
    click PluginManager "https://github.com/analogdevicesinc/scopy/blob/main/core/src/pluginmanager.cpp"
    click ToolMenu "https://github.com/analogdevicesinc/scopy/blob/main/core/src/toolmenu.cpp"
    click ADC "https://github.com/analogdevicesinc/scopy/tree/main/plugins/adc"
    click DAC "https://github.com/analogdevicesinc/scopy/tree/main/plugins/dac"
    click PQM "https://github.com/analogdevicesinc/scopy/tree/main/plugins/pqm"
    click RegMap "https://github.com/analogdevicesinc/scopy/tree/main/plugins/regmap"
    click Debugger "https://github.com/analogdevicesinc/scopy/tree/main/plugins/debugger"
    click DataLogger "https://github.com/analogdevicesinc/scopy/tree/main/plugins/datalogger"
    click GUI "https://github.com/analogdevicesinc/scopy/tree/main/gui"
    click IIO "https://github.com/analogdevicesinc/scopy/tree/main/iioutil"
    click GR "https://github.com/analogdevicesinc/scopy/tree/main/gr-util"
    click CommonLib "https://github.com/analogdevicesinc/scopy/tree/main/common"
    click PluginAPI "https://github.com/analogdevicesinc/scopy/blob/main/pluginbase/include/pluginbase/plugin.h"
    click ResourceMgr "https://github.com/analogdevicesinc/scopy/blob/main/pluginbase/include/pluginbase/resourcemanager.h"
    click CMake "https://github.com/analogdevicesinc/scopy/blob/main/CMakeLists.txt"
    click Windows "https://github.com/analogdevicesinc/scopy/tree/main/ci/windows"
    click Ubuntu "https://github.com/analogdevicesinc/scopy/tree/main/ci/ubuntu"
    click MacOS "https://github.com/analogdevicesinc/scopy/tree/main/ci/macOS"
    click Translations "https://github.com/analogdevicesinc/scopy/tree/main/resources/translations"
    click Docs "https://github.com/analogdevicesinc/scopy/tree/main/docs"
    click Styles "https://github.com/analogdevicesinc/scopy/tree/main/gui/style"

    %% Styling
    classDef core fill:#a8d1f0
    classDef plugin fill:#90EE90
    classDef common fill:#FFE5B4
    classDef build fill:#D3D3D3
    classDef resources fill:#DDA0DD

    class MainWindow,DeviceManager,PluginManager,ToolMenu core
    class ADC,DAC,PQM,RegMap,Debugger,DataLogger plugin
    class GUI,IIO,GR,CommonLib,PluginAPI,ResourceMgr common
    class CMake,Windows,Ubuntu,MacOS build
    class Translations,Docs,Styles resources
```
