# openastrotech/openastrotracker-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/openastrotech/openastrotracker-desktop
- Repository: https://github.com/openastrotech/openastrotracker-desktop

## Overview

OpenAstroTracker Desktop provides Windows mount-control software and an ASCOM telescope driver, backed by shared communications libraries. The main user workflow is to choose a connection, send mount commands, and view mount state; the UI also supports target selection, polar alignment, settings, and theme customization. The README documents serial and WiFi control and major driver capabilities. Sampled source confirms command handling and UI command dispatch, but not all MountVM or driver internals, so uncertain wiring is omitted.

Main entry points: [`OATCommunications/TelescopeCommandHandlers/OatmealTelescopeCommandHandlers.cs`](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/TelescopeCommandHandlers/OatmealTelescopeCommandHandlers.cs) (Mount command handlers), [`ASCOM.Driver/TelescopeDriver/Driver.cs`](https://github.com/openastrotech/openastrotracker-desktop/blob/master/ASCOM.Driver/TelescopeDriver/Driver.cs) (Telescope driver), [`OATControl/ViewModels/MountVM.cs`](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/ViewModels/MountVM.cs) (Mount state and commands), [`OATCommunications.WPF/CommunicationHandlers/CommunicationHandlerFactory.cs`](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications.WPF/CommunicationHandlers/CommunicationHandlerFactory.cs) (Connection handler factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Mount Control"]
  node_main["Main window<br/>[MainWindow.xaml.cs]"]
  node_mountvm["Mount state and commands<br/>[MountVM.cs]"]
  node_target["Target selection"]
  node_polar["Polar alignment"]
  node_alignmentlogs["Alignment log processors"]
  node_settings["App settings<br/>[AppSettings.cs]"]
  node_themes["Theme management<br/>[ThemeManager.cs]"]
  node_minicontroller["Mini controller"]
end

subgraph group_comm["Communications"]
  node_handlerfactory["Connection handler factory"]
  node_serial["Serial transport"]
  node_tcp["TCP transport"]
  node_discovery["WiFi discovery"]
  node_protocol["Mount command handlers"]
  node_commmodel["Mount and position models<br/>[MountState.cs]"]
  node_ascomcomm["ASCOM communication adapter"]
end

subgraph group_ascom["ASCOM Driver"]
  node_ascomdriver["Telescope driver<br/>[Driver.cs]"]
  node_focuserdriver["Focuser driver<br/>[FocuserDriver.cs]"]
  node_driverconfig["Driver setup<br/>[SetupDialogForm.cs]"]
end

subgraph group_simulation["Simulation"]
  node_simulator["Mount simulator<br/>[TCPSimClient.cs]"]
end

node_user(("Mount operator"))
node_mount{{"OpenAstroTracker mount"}}
node_ascomclient(("Astronomy client"))

node_user -->|"operates"| node_main
node_main -->|"presents state"| node_mountvm
node_user -->|"chooses target"| node_target
node_user -->|"runs alignment"| node_polar
node_user -->|"controls mount"| node_minicontroller
node_minicontroller -->|"dispatches commands"| node_mountvm
node_mountvm -->|"selects transport"| node_handlerfactory
node_handlerfactory -->|"creates handler"| node_serial
node_handlerfactory -->|"creates handler"| node_tcp
node_tcp -->|"starts discovery"| node_discovery
node_serial -->|"transports commands"| node_protocol
node_tcp -->|"transports commands"| node_protocol
node_protocol -->|"sends commands"| node_mount
node_protocol -->|"updates state"| node_commmodel
node_ascomclient -->|"calls driver"| node_ascomdriver
node_ascomdriver -.->|"uses adapter"| node_ascomcomm
node_ascomdriver -->|"controls telescope"| node_mount
node_focuserdriver -->|"controls focuser"| node_mount
node_driverconfig -->|"configures driver"| node_ascomdriver
node_simulator -.->|"supplies simulated state"| node_mountvm
node_alignmentlogs -->|"processes logs"| node_polar
node_user -->|"configures"| node_settings
node_user -->|"customizes appearance"| node_themes

click node_main "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/MainWindow.xaml.cs"
click node_mountvm "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/ViewModels/MountVM.cs"
click node_target "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/TargetChooser.xaml.cs"
click node_polar "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/DlgRunPolarAlignment.xaml.cs"
click node_alignmentlogs "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/ViewModels/PolarAlignLogProcessorBase.cs"
click node_settings "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/ViewModels/AppSettings.cs"
click node_themes "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/Theming/ThemeManager.cs"
click node_minicontroller "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/MiniController.xaml.cs"
click node_handlerfactory "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications.WPF/CommunicationHandlers/CommunicationHandlerFactory.cs"
click node_serial "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications.WPF/CommunicationHandlers/SerialCommunicationHandler.cs"
click node_tcp "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/CommunicationHandlers/TcpCommunicationHandler.cs"
click node_discovery "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/ClientAdapters/UdpClientAdapter.cs"
click node_protocol "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/TelescopeCommandHandlers/OatmealTelescopeCommandHandlers.cs"
click node_commmodel "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/Model/MountState.cs"
click node_ascomdriver "https://github.com/openastrotech/openastrotracker-desktop/blob/master/ASCOM.Driver/TelescopeDriver/Driver.cs"
click node_focuserdriver "https://github.com/openastrotech/openastrotracker-desktop/blob/master/ASCOM.Driver/TelescopeDriver/FocuserDriver.cs"
click node_driverconfig "https://github.com/openastrotech/openastrotracker-desktop/blob/master/ASCOM.Driver/TelescopeDriver/SetupDialogForm.cs"
click node_ascomcomm "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications.ASCOM/CommunicationHandlers/ASCOMCommunicationHandler.cs"
click node_simulator "https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATSimulation/Communication/TCPSimClient.cs"

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_main,node_mountvm,node_target,node_polar,node_alignmentlogs,node_settings,node_themes,node_minicontroller,node_ascomclient toneBlue
class node_handlerfactory,node_serial,node_tcp,node_discovery,node_protocol,node_commmodel,node_ascomcomm toneAmber
class node_ascomdriver,node_focuserdriver,node_driverconfig toneMint
class node_simulator toneRose
class node_user,node_mount toneIndigo
```

## Components

### Mount Control

- [Main window](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/MainWindow.xaml.cs): `OATControl/MainWindow.xaml.cs`
- [Mount state and commands](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/ViewModels/MountVM.cs): `OATControl/ViewModels/MountVM.cs`
- [Target selection](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/TargetChooser.xaml.cs): `OATControl/TargetChooser.xaml.cs`
- [Polar alignment](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/DlgRunPolarAlignment.xaml.cs): `OATControl/DlgRunPolarAlignment.xaml.cs`
- [Alignment log processors](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/ViewModels/PolarAlignLogProcessorBase.cs): `OATControl/ViewModels/PolarAlignLogProcessorBase.cs`
- [App settings](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/ViewModels/AppSettings.cs): `OATControl/ViewModels/AppSettings.cs`
- [Theme management](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/Theming/ThemeManager.cs): `OATControl/Theming/ThemeManager.cs`
- [Mini controller](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATControl/MiniController.xaml.cs): `OATControl/MiniController.xaml.cs`

### Communications

- [Connection handler factory](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications.WPF/CommunicationHandlers/CommunicationHandlerFactory.cs): `OATCommunications.WPF/CommunicationHandlers/CommunicationHandlerFactory.cs`
- [Serial transport](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications.WPF/CommunicationHandlers/SerialCommunicationHandler.cs): `OATCommunications.WPF/CommunicationHandlers/SerialCommunicationHandler.cs`
- [TCP transport](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/CommunicationHandlers/TcpCommunicationHandler.cs): `OATCommunications/CommunicationHandlers/TcpCommunicationHandler.cs`
- [WiFi discovery](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/ClientAdapters/UdpClientAdapter.cs): `OATCommunications/ClientAdapters/UdpClientAdapter.cs`
- [Mount command handlers](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/TelescopeCommandHandlers/OatmealTelescopeCommandHandlers.cs): `OATCommunications/TelescopeCommandHandlers/OatmealTelescopeCommandHandlers.cs`
- [Mount and position models](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications/Model/MountState.cs): `OATCommunications/Model/MountState.cs`
- [ASCOM communication adapter](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATCommunications.ASCOM/CommunicationHandlers/ASCOMCommunicationHandler.cs): `OATCommunications.ASCOM/CommunicationHandlers/ASCOMCommunicationHandler.cs`

### ASCOM Driver

- [Telescope driver](https://github.com/openastrotech/openastrotracker-desktop/blob/master/ASCOM.Driver/TelescopeDriver/Driver.cs): `ASCOM.Driver/TelescopeDriver/Driver.cs`
- [Focuser driver](https://github.com/openastrotech/openastrotracker-desktop/blob/master/ASCOM.Driver/TelescopeDriver/FocuserDriver.cs): `ASCOM.Driver/TelescopeDriver/FocuserDriver.cs`
- [Driver setup](https://github.com/openastrotech/openastrotracker-desktop/blob/master/ASCOM.Driver/TelescopeDriver/SetupDialogForm.cs): `ASCOM.Driver/TelescopeDriver/SetupDialogForm.cs`

### Simulation

- [Mount simulator](https://github.com/openastrotech/openastrotracker-desktop/blob/master/OATSimulation/Communication/TCPSimClient.cs): `OATSimulation/Communication/TCPSimClient.cs`

### Other components

- **Mount operator**
- **OpenAstroTracker mount**
- **Astronomy client**

## Connections

- Mount operator → Main window: operates
- Main window → Mount state and commands: presents state
- Mount operator → Target selection: chooses target
- Mount operator → Polar alignment: runs alignment
- Mount operator → Mini controller: controls mount
- Mini controller → Mount state and commands: dispatches commands
- Mount state and commands → Connection handler factory: selects transport
- Connection handler factory → Serial transport: creates handler
- Connection handler factory → TCP transport: creates handler
- TCP transport → WiFi discovery: starts discovery
- Serial transport → Mount command handlers: transports commands
- TCP transport → Mount command handlers: transports commands
- Mount command handlers → OpenAstroTracker mount: sends commands
- Mount command handlers → Mount and position models: updates state
- Astronomy client → Telescope driver: calls driver
- Telescope driver → ASCOM communication adapter: uses adapter
- Telescope driver → OpenAstroTracker mount: controls telescope
- Focuser driver → OpenAstroTracker mount: controls focuser
- Driver setup → Telescope driver: configures driver
- Mount simulator → Mount state and commands: supplies simulated state
- Alignment log processors → Polar alignment: processes logs
- Mount operator → App settings: configures
- Mount operator → Theme management: customizes appearance
