Professional cross-platform desktop application for controlling and monitoring a Keysight N6705 power analyzer over SCPI/TCP, built with Qt/QML (PySide6) and a Python MVVM backend.
- Core Capabilities
- Technology Stack
- Architecture Overview
- Runtime Sequence
- Repository Structure
- Dependencies
- Run From Source
- Windows Installer (EXE Setup)
- Documentation
- Testing
- Troubleshooting
- Project Status
- License
- Remote Ethernet connection to N6705 (
host,port,timeout) - Instrument identification via
*IDN? - Per-channel control (CH1..CH4):
- Voltage setpoint (
VOLT) - Current limit (
CURR) - Output state (
OUTP ON/OFF)
- Voltage setpoint (
- Real-time operation modes:
- Meter View
- Scope View (V/I/P + Ah/Wh trends)
- Data Logger (channel status + event stream)
- Log Plot (historical multi-file analysis)
- CSV logging with integrated channel accumulators (
charge_ah,energy_wh) - PNG export for historical chart panels
- Session persistence in JSON
- Light/Dark theme switch in top bar
- Python 3.10+
- PySide6 / QtQuick / QtQuick.Controls (Material style)
- QML UI + Python ViewModels (MVVM)
- SCPI over TCP for instrument communication
flowchart LR
UI[QML UI] --> VM[DashboardViewModel]
VM --> DEV[N6705PowerAnalyzer]
DEV --> TCP[ScpiTcpClient]
TCP --> PSU[Keysight N6705]
VM --> LOG[ConsumptionLogger]
VM --> HIST[LogPlotLoader]
LOG --> CSV[(CSV Files)]
VM --> CFG[(session.json)]
ScpiTcpClient: TCP connection lifecycle and SCPI read/write/query primitivesN6705PowerAnalyzer: instrument-level operations (setpoints, outputs, measurements)DashboardViewModel: UI orchestration, connection, polling, logging, session stateConsumptionLogger: deterministic CSV writing + Ah/Wh accumulationLogPlotLoader: historical load, validation, decimation, chart series payload
sequenceDiagram
participant User
participant QML as QML UI
participant VM as DashboardViewModel
participant DEV as N6705PowerAnalyzer
participant TCP as ScpiTcpClient
participant PSU as Keysight N6705
participant LOG as ConsumptionLogger
participant CSV as CSV File
User->>QML: Connect + Run
QML->>VM: connectDevice(host, port, timeout)
VM->>DEV: identify()
DEV->>TCP: query("*IDN?")
TCP->>PSU: *IDN?
PSU-->>TCP: IDN response
TCP-->>DEV: IDN string
DEV-->>VM: connection ready
VM-->>QML: status + connected state
loop Polling cycle
VM->>DEV: measure_channels([1..n])
DEV->>TCP: query(SCPI MEAS commands)
TCP->>PSU: SCPI query batch
PSU-->>TCP: V/I/P values
TCP-->>DEV: parsed responses
DEV-->>VM: channel measurements
VM-->>QML: telemetry update signals
end
opt Logging active
VM->>LOG: register(sample, totals)
LOG->>CSV: append row
end
app.py: application entrypointn6705_ui/qml_main.py: Qt/QML bootstrapn6705_ui/communication/scpi_client.py: SCPI TCP clientn6705_ui/device/n6705.py: N6705 device adaptern6705_ui/presentation/viewmodels/: MVVM orchestration layern6705_ui/presentation/qml/: QML UI views/componentsn6705_ui/logging/: CSV logger + historical loadertests/: integration and service testspackaging/windows/: Windows build and installer scriptsdocs/doxygen/: documentation pages and UML assets
Defined in requirements.txt:
PySide6>=6.8,<7
Installed automatically by packaging/windows/build_installer.ps1:
pyinstallerpyinstaller-hooks-contribpillow
System dependency:
- Inno Setup 6 (
ISCC.exe)
python -m venv .venvLinux/macOS:
source .venv/bin/activateWindows PowerShell:
.\.venv\Scripts\Activate.ps1pip install -r requirements.txtpython app.pyThe packaging pipeline generates:
- Standalone application bundle (
PyInstaller) - Installable setup executable (
Inno Setup)
- Windows 10/11 x64
- Python 3.10+ on the build machine
- Inno Setup 6 installed
Preferred command (works even if PowerShell script policy is restrictive):
.\packaging\windows\build_installer.cmd -AppVersion 1.0.0Alternative direct command:
powershell -NoProfile -ExecutionPolicy Bypass -File .\packaging\windows\build_installer.ps1 -AppVersion 1.0.0- App bundle:
dist/windows/app/N6705PowerConsole/ - Installer:
dist/windows/installer/n6705-power-console-<version>-setup.exe
- Per-user install path:
%LOCALAPPDATA%\Programs\N6705 Power Console - Start Menu shortcut + optional Desktop shortcut
- Uninstaller registration
- User environment variable:
N6705_UI_HOME
-SkipTests: skip unit tests before packaging-SkipInstaller: build app bundle only-Clean: remove previous build outputs
- Architecture reference:
ARCHITECTURE.md - User guide:
USER_GUIDE.md - Doxygen main page:
docs/doxygen/mainpage.md - Doxygen tutorial:
docs/doxygen/tutorial.md - UML/diagram assets:
docs/doxygen/uml/
Generate Doxygen HTML:
doxygen DoxyfileOutput: docs/build/html/
Run test suite:
python -m unittest discover -s tests -vPySide6 is not installed:- install dependencies with
pip install -r requirements.txt
- install dependencies with
iscc.exe not foundduring installer build:- install Inno Setup 6, or ensure
ISCC.exeis reachable
- install Inno Setup 6, or ensure
- QML module/plugin load issues on Windows:
- run with the same interpreter where dependencies were installed
- Connection fails:
- verify instrument IP/route, firewall, and TCP 5025
Active development. Core workflows are stable and being iterated with UI, packaging, and documentation improvements.
This project is licensed under the MIT License. See LICENSE.
Author: Mouhsine Kassimi Farhaoui
Mail: mouhsine98@gmail.com