# ruylazaroengenharia/nanovna_screenmirror architecture

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

- Interactive diagram: https://gitdiagram.com/ruylazaroengenharia/nanovna_screenmirror
- Repository: https://github.com/ruylazaroengenharia/nanovna_screenmirror

## Overview

NanoVNA Mirror and SV4401A Mirror are desktop applications for mirroring and controlling RF analyzers, acquiring measurements, and producing RF analyses and reports. The user workflow starts at the GUI, communicates with a connected instrument through its serial shell, then displays live captures or uses acquired S-parameters for tools, meter readings, exports, and reports. The README documents additional tool capabilities beyond the sampled implementations; those are represented by the shared tools subsystem. Evidence for unsampled details is limited to README statements and the source index.

Main entry points: [`nanovna_mirror.py`](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py) (NanoVNA GUI), [`devices.py`](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/devices.py) (Serial VNA drivers), [`tools_ui.py`](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/tools_ui.py) (Measurement tools), [`sv4401a_mirror.py`](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/sv4401a_mirror.py) (SV4401A launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mirror applications"]
  node_nano_app["NanoVNA GUI<br/>[nanovna_mirror.py]"]
  node_sv_app["SV4401A launcher<br/>[sv4401a_mirror.py]"]
  node_controls["Instrument controls<br/>[nanovna_mirror.py]"]
  node_console["Command console<br/>[nanovna_mirror.py]"]
end

subgraph group_instrument["Instrument interface"]
  node_serial_vna["Serial VNA drivers<br/>[devices.py]"]
end

subgraph group_analysis["RF analysis"]
  node_tools["Measurement tools<br/>[tools_ui.py]"]
  node_rf_calc["RF calculations<br/>[rf_tools.py]"]
  node_cable_data[("Cable table<br/>[cabos.py]")]
  node_s21_meter["S21 meter<br/>[nanovna_mirror.py]"]
end

subgraph group_outputs["Results and state"]
  node_screen["Live screen<br/>[nanovna_mirror.py]"]
  node_report["PNG/PDF report<br/>[nanovna_mirror.py]"]
  node_touchstone["Touchstone export<br/>[nanovna_mirror.py]"]
  node_history[("Antenna history<br/>[tools_ui.py]")]
end

node_operator(("Operator"))
node_nano_device["NanoVNA-H"]
node_sv_device["SV4401A"]

node_operator -->|"uses"| node_nano_app
node_operator -->|"launches"| node_sv_app
node_sv_app -->|"starts with profile"| node_nano_app
node_nano_app -->|"selects driver"| node_serial_vna
node_serial_vna -.->|"serial commands"| node_nano_device
node_serial_vna -.->|"serial commands"| node_sv_device
node_nano_app -->|"renders capture"| node_screen
node_nano_app -->|"sends commands"| node_controls
node_controls -.->|"calls driver"| node_serial_vna
node_nano_app -->|"reads measurements"| node_s21_meter
node_s21_meter -->|"sets frequency and reads data"| node_serial_vna
node_nano_app -->|"opens tools"| node_tools
node_tools -->|"acquires sweeps"| node_serial_vna
node_tools -->|"uses calculations"| node_rf_calc
node_tools -->|"loads cable data"| node_cable_data
node_nano_app -->|"generates"| node_report
node_nano_app -->|"exports"| node_touchstone
node_nano_app -->|"provides commands"| node_console
node_tools -->|"stores comparisons"| node_history

click node_nano_app "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py"
click node_sv_app "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/sv4401a_mirror.py"
click node_serial_vna "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/devices.py"
click node_tools "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/tools_ui.py"
click node_rf_calc "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/rf_tools.py"
click node_cable_data "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/cabos.py"
click node_screen "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py"
click node_controls "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py"
click node_s21_meter "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py"
click node_report "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py"
click node_touchstone "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py"
click node_console "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py"
click node_history "https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/tools_ui.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nano_app,node_sv_app,node_controls,node_console toneBlue
class node_serial_vna toneAmber
class node_tools,node_rf_calc,node_cable_data,node_s21_meter toneMint
class node_screen,node_report,node_touchstone,node_history toneRose
class node_operator,node_nano_device,node_sv_device toneIndigo
```

## Components

### Mirror applications

- [NanoVNA GUI](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py): `nanovna_mirror.py`
- [SV4401A launcher](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/sv4401a_mirror.py): `sv4401a_mirror.py`
- [Instrument controls](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py): `nanovna_mirror.py`
- [Command console](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py): `nanovna_mirror.py`

### Instrument interface

- [Serial VNA drivers](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/devices.py): `devices.py`

### RF analysis

- [Measurement tools](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/tools_ui.py): `tools_ui.py`
- [RF calculations](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/rf_tools.py): `rf_tools.py`
- [Cable table](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/cabos.py): `cabos.py`
- [S21 meter](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py): `nanovna_mirror.py`

### Results and state

- [Live screen](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py): `nanovna_mirror.py`
- [PNG/PDF report](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py): `nanovna_mirror.py`
- [Touchstone export](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/nanovna_mirror.py): `nanovna_mirror.py`
- [Antenna history](https://github.com/ruylazaroengenharia/nanovna_screenmirror/blob/main/tools_ui.py): `tools_ui.py`

### Other components

- **Operator**
- **NanoVNA-H**
- **SV4401A**

## Connections

- Operator → NanoVNA GUI: uses (evidence: `README.md`)
- Operator → SV4401A launcher: launches (evidence: `README.md`)
- SV4401A launcher → NanoVNA GUI: starts with profile (evidence: `sv4401a_mirror.py`)
- NanoVNA GUI → Serial VNA drivers: selects driver (evidence: `nanovna_mirror.py`)
- Serial VNA drivers → NanoVNA-H: serial commands (evidence: `README.md`)
- Serial VNA drivers → SV4401A: serial commands (evidence: `README.md`)
- NanoVNA GUI → Live screen: renders capture (evidence: `README.md`)
- NanoVNA GUI → Instrument controls: sends commands (evidence: `README.md`)
- Instrument controls → Serial VNA drivers: calls driver (evidence: `nanovna_mirror.py`)
- NanoVNA GUI → S21 meter: reads measurements (evidence: `README.md`)
- S21 meter → Serial VNA drivers: sets frequency and reads data (evidence: `devices.py`)
- NanoVNA GUI → Measurement tools: opens tools (evidence: `nanovna_mirror.py`)
- Measurement tools → Serial VNA drivers: acquires sweeps (evidence: `README.md`)
- Measurement tools → RF calculations: uses calculations (evidence: `tools_ui.py`)
- Measurement tools → Cable table: loads cable data (evidence: `tools_ui.py`)
- NanoVNA GUI → PNG/PDF report: generates (evidence: `README.md`)
- NanoVNA GUI → Touchstone export: exports (evidence: `README.md`)
- NanoVNA GUI → Command console: provides commands (evidence: `README.md`)
- Measurement tools → Antenna history: stores comparisons (evidence: `README.md`)
