# ddkn/chromatographer architecture

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

- Interactive diagram: https://gitdiagram.com/ddkn/chromatographer
- Repository: https://github.com/ddkn/chromatographer

## Overview

This reference application collects chromatographer measurements through an NI-DAQ device, with both command-line and Qt interfaces. The main experiment waits through a cycle interval, primes valves, samples differential voltage across a configured window, resets the valves, and reports each dataset. The Qt interface adds manual V1/V7 controls, live plotting, cycle progress, and file output; the command-line interface supports device listing and manual valve operations. The Qt worker and UI wiring are evidenced by sampled excerpts; unsampled implementation details are not inferred.

Main entry points: [`chromatographer-qt.py`](https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py) (Qt interface), [`chromatographer.py`](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py) (Experiment loop), [`chromatographer.ui`](https://github.com/ddkn/chromatographer/blob/master/chromatographer.ui) (UI layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_qt_interface["Qt interface"]
  node_cli_interface["CLI interface<br/>[chromatographer.py]"]
  node_ui_layout["UI layout<br/>[chromatographer.ui]"]
  node_qt_worker["Qt worker"]
  node_device_selection["Device selection"]
  node_plot_progress["Plot and progress"]
  node_manual_valves["Manual valves"]
end

subgraph group_experiment["Experiment runtime"]
  node_experiment_loop["Experiment loop<br/>[chromatographer.py]"]
  node_cycle_wait["Cycle wait<br/>[chromatographer.py]"]
  node_valve_priming["Valve priming<br/>[chromatographer.py]"]
  node_valve_reset["Cycle reset<br/>[chromatographer.py]"]
  node_voltage_sampling["Voltage sampling<br/>[chromatographer.py]"]
  node_valve_operations["Valve operations<br/>[chromatographer.py]"]
end

subgraph group_io["Hardware and output"]
  node_daq_device{{"NI-DAQ device"}}
  node_measurement_file["Measurement file"]
end

node_lab_operator(("Lab operator"))
node_cli_user(("CLI user"))

node_lab_operator -->|"operates"| node_qt_interface
node_cli_user -->|"configures"| node_cli_interface
node_qt_interface -->|"loads"| node_ui_layout
node_qt_interface -->|"lists devices"| node_device_selection
node_device_selection -->|"queries"| node_daq_device
node_qt_interface -->|"creates worker"| node_qt_worker
node_qt_worker -->|"runs"| node_experiment_loop
node_cli_interface -->|"runs"| node_experiment_loop
node_qt_interface -->|"controls"| node_manual_valves
node_manual_valves -->|"opens or closes"| node_valve_operations
node_experiment_loop -->|"waits"| node_cycle_wait
node_experiment_loop -->|"primes"| node_valve_priming
node_experiment_loop -->|"samples"| node_voltage_sampling
node_experiment_loop -->|"resets"| node_valve_reset
node_valve_priming -->|"sets states"| node_valve_operations
node_valve_reset -->|"sets cycle state"| node_valve_operations
node_valve_operations -->|"writes digital output"| node_daq_device
node_voltage_sampling -->|"reads analog input"| node_daq_device
node_qt_worker -->|"emits updates"| node_plot_progress
node_plot_progress -->|"updates display"| node_qt_interface
node_qt_interface -->|"appends samples"| node_measurement_file
node_cli_interface -->|"prints samples"| node_measurement_file

click node_qt_interface "https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py"
click node_cli_interface "https://github.com/ddkn/chromatographer/blob/master/chromatographer.py"
click node_ui_layout "https://github.com/ddkn/chromatographer/blob/master/chromatographer.ui"
click node_qt_worker "https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py"
click node_device_selection "https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py"
click node_plot_progress "https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py"
click node_manual_valves "https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py"
click node_experiment_loop "https://github.com/ddkn/chromatographer/blob/master/chromatographer.py"
click node_cycle_wait "https://github.com/ddkn/chromatographer/blob/master/chromatographer.py"
click node_valve_priming "https://github.com/ddkn/chromatographer/blob/master/chromatographer.py"
click node_valve_reset "https://github.com/ddkn/chromatographer/blob/master/chromatographer.py"
click node_voltage_sampling "https://github.com/ddkn/chromatographer/blob/master/chromatographer.py"
click node_valve_operations "https://github.com/ddkn/chromatographer/blob/master/chromatographer.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_qt_interface,node_cli_interface,node_ui_layout,node_qt_worker,node_device_selection,node_plot_progress,node_manual_valves,node_cli_user toneBlue
class node_experiment_loop,node_cycle_wait,node_valve_priming,node_valve_reset,node_voltage_sampling,node_valve_operations toneAmber
class node_daq_device,node_measurement_file toneMint
class node_lab_operator toneIndigo
```

## Components

### User interfaces

- [Qt interface](https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py): `chromatographer-qt.py`
- [CLI interface](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py): `chromatographer.py`
- [UI layout](https://github.com/ddkn/chromatographer/blob/master/chromatographer.ui): `chromatographer.ui`
- [Qt worker](https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py): `chromatographer-qt.py`
- [Device selection](https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py): `chromatographer-qt.py`
- [Plot and progress](https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py): `chromatographer-qt.py`
- [Manual valves](https://github.com/ddkn/chromatographer/blob/master/chromatographer-qt.py): `chromatographer-qt.py`

### Experiment runtime

- [Experiment loop](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py): `chromatographer.py`
- [Cycle wait](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py): `chromatographer.py`
- [Valve priming](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py): `chromatographer.py`
- [Cycle reset](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py): `chromatographer.py`
- [Voltage sampling](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py): `chromatographer.py`
- [Valve operations](https://github.com/ddkn/chromatographer/blob/master/chromatographer.py): `chromatographer.py`

### Hardware and output

- **NI-DAQ device**
- **Measurement file**

### Other components

- **Lab operator**
- **CLI user**

## Connections

- Lab operator → Qt interface: operates
- CLI user → CLI interface: configures
- Qt interface → UI layout: loads
- Qt interface → Device selection: lists devices
- Device selection → NI-DAQ device: queries
- Qt interface → Qt worker: creates worker
- Qt worker → Experiment loop: runs
- CLI interface → Experiment loop: runs
- Qt interface → Manual valves: controls
- Manual valves → Valve operations: opens or closes
- Experiment loop → Cycle wait: waits
- Experiment loop → Valve priming: primes
- Experiment loop → Voltage sampling: samples
- Experiment loop → Cycle reset: resets
- Valve priming → Valve operations: sets states
- Cycle reset → Valve operations: sets cycle state
- Valve operations → NI-DAQ device: writes digital output
- Voltage sampling → NI-DAQ device: reads analog input
- Qt worker → Plot and progress: emits updates
- Plot and progress → Qt interface: updates display
- Qt interface → Measurement file: appends samples
- CLI interface → Measurement file: prints samples
