# gridprotectionalliance/pmuconnectiontester architecture

> Architecture diagram of the GitHub repository gridprotectionalliance/pmuconnectiontester, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gridprotectionalliance/pmuconnectiontester
- Repository: https://github.com/gridprotectionalliance/pmuconnectiontester

## Overview

##### Main Components
- External Phasor Devices (PMU, PDC, DFR, PQ)
- Network Interface (UDP/TCP listeners)
- Communication Layer (GSF.Communication)
- Protocol Parsing Layer (GSF.PhasorProtocols)
- Core Data Model & Services (GSF.Core, GSF.TimeSeries, GSF.Security)
- UI Layer (Windows Forms – PMUConnectionTester.exe)
- Configuration & Persistence (ApplicationSettings, Sample*.PmuConnection files)
- Visualization Engine (real-time graphing controls)
- Installer (WiX-based setup project)
- Build & CI Scripts (MSBuild, custom .bat/.buildproj files)
- Documentation Site (Jekyll in docs folder)

##### Relationships & Data Flows
- Sideflow: Documentation Site (docs folder) delivered as static help pages

##### Architectural Patterns & Design Principles
- Layered Architecture: separation of Communication, Parsing, Core Services, and UI
- Plug-in Protocol Support: Protocol Parsing Layer loads handlers for IEEE C37.118, IEC 61850, BPA, etc.
- Configuration-Driven: connection profiles define endpoints, protocols, codecs
- Event-Driven UI: UI subscribes to data updates for real-time rendering
- Build Automation: MSBuild scripts orchestrate nightly/beta/master builds and versioning
- Install-Time Packaging: WiX project for MSI creation and licensing

##### Technologies & Frameworks
- .NET Framework 4.6+ (C#)
- Windows Forms (System.Windows.Forms)
- Grid Protection Alliance Foundation (GSF.Communication, GSF.PhasorProtocols, GSF.Core, GSF.TimeSeries, GSF.Security, etc.)
- MSBuild + Community Tasks + Extension Pack (Build/Scripts/Targets)
- WiX Toolset (PMUConnectionTesterSetup.wixproj)
- Jekyll for docs (docs/_config.yml, layouts, includes)

##### Detailed Coverage
– Connection Selector
– MulticastSourceSelector
– AlternateCommandChannel
– Visualization Forms (charts, tables)
- Where app.config and Sample*.PmuConnection files feed into ApplicationSettings
- Build directory as a parallel infrastructure component driving nightly/beta distributions

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Devices
    subgraph "External Devices"
        ExtDevices["External Phasor Devices"]:::external
    end

    %% Network Interface Layer
    subgraph "Network Interface Layer"
        NetInterface["Network Interface"]:::network
    end

    %% Communication Layer
    subgraph "Communication Layer"
        CommLayer["GSF.Communication"]:::core
    end

    %% Protocol Parsing Layer
    subgraph "Protocol Parsing Layer"
        ParserLayer["GSF.PhasorProtocols"]:::core
    end

    %% Core Data & Services
    subgraph "Core Data & Services"
        GSFCore["GSF.Core"]:::core
        TimeSeries["GSF.TimeSeries"]:::core
        Security["GSF.Security"]:::core
    end

    %% UI Layer
    subgraph "UI Layer"
        UIForm["PMUConnectionTester.exe"]:::ui
        ConnectionSelector["Connection Selector"]:::ui
        MulticastSelector["MulticastSourceSelector"]:::ui
        AlternateCmd["AlternateCommandChannel"]:::ui
        ReceiveSelector["ReceiveFromSelector"]:::ui
        NetSelector["NetworkInterfaceSelector"]:::ui
        VisualizationForms["Visualization Forms"]:::ui
    end

    %% Configuration & Persistence
    Persistence["Connection Profiles & Settings"]:::persistence

    %% Installer & Build
    subgraph "Build & CI / Installer"
        BuildScripts["Build & CI Scripts"]:::build
        Installer["WiX Installer"]:::build
    end

    %% Documentation
    Docs["Documentation Site (Jekyll)"]:::docs

    %% Relationships
    ExtDevices -->|"UDP/TCP frames"| NetInterface
    NetInterface -->|"raw frames"| CommLayer
    CommLayer -->|"packet assembly"| ParserLayer
    ParserLayer -->|"decoded frames"| GSFCore
    GSFCore -->|"time-series"| TimeSeries
    TimeSeries -->|"security checks"| Security
    Security -->|"data objects"| VisualizationForms
    VisualizationForms -->|"render UI"| UIForm
    UIForm -->|"sub-components"| ConnectionSelector
    UIForm --> MulticastSelector
    UIForm --> AlternateCmd
    UIForm --> ReceiveSelector
    UIForm --> NetSelector
    UIForm --> VisualizationForms
    UIForm <-->|"load/save profiles"| Persistence
    BuildScripts -->|compile & package| GSFCore
    BuildScripts --> TimeSeries
    BuildScripts --> Security
    BuildScripts --> UIForm
    BuildScripts --> Installer
    Installer -->|"deploy app"| UIForm
    Docs -->|"static help pages"| UIForm

    %% Click Events
    click ReceiveSelector "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTester/ReceiveFromSelector.cs"
    click NetSelector "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTester/NetworkInterfaceSelector.cs"
    click CommLayer "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Dependencies/GSF/GSF.Communication.XML"
    click ParserLayer "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Dependencies/GSF/GSF.PhasorProtocols.XML"
    click GSFCore "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Dependencies/GSF/GSF.Core.XML"
    click TimeSeries "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Dependencies/GSF/GSF.TimeSeries.XML"
    click Security "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Dependencies/GSF/GSF.Security.XML"
    click UIForm "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTester/PMUConnectionTester.cs"
    click AlternateCmd "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTester/AlternateCommandChannel.cs"
    click MulticastSelector "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTester/MulticastSourceSelector.cs"
    click Persistence "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTester/ApplicationSettings.cs"
    click Persistence "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTester/app.config"
    click Installer "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/Source/Tools/PMUConnectionTester/PMUConnectionTesterSetup/PMUConnectionTesterSetup.wixproj"
    click BuildScripts "https://github.com/gridprotectionalliance/pmuconnectiontester/tree/master/Build/Scripts"
    click Docs "https://github.com/gridprotectionalliance/pmuconnectiontester/blob/master/docs/_config.yml"

    %% Styles
    classDef external fill:#cccccc,stroke:#333,stroke-width:1px;
    classDef network fill:#dddddd,stroke:#333,stroke-width:1px;
    classDef core fill:#cce5ff,stroke:#333,stroke-width:1px;
    classDef ui fill:#d4edda,stroke:#333,stroke-width:1px;
    classDef persistence fill:#f0f0f0,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
    classDef build fill:#ffe5cc,stroke:#333,stroke-width:1px;
    classDef docs fill:#f9f2f4,stroke:#333,stroke-width:1px;
```
