# GeoVLog — Airborne‑Survey Logging Suite
End‑to‑end software stack for **real‑time acquisition, encryption, monitoring and
post‑flight QC** of geophysical sensor data collected by the two
**Diamond DA42 MPP TerraStar** platforms.
```
Diamond DA42 MPP Advantech MIC‑7700 IPC
(serial sensors) ─► GeoVLogSvc ─► encrypted .h5 ─► GeoVLogReader ─► GeoVLogViewer
│ ▲
└── gRPC telemetry ──► GeoVLogMon ──┘
```
---
## 0 · Platform snapshot
| Item | Spec |
|------|------|
| **Aircraft type** | Diamond DA42 MPP TerraStar |
| | S/N 42.MN057 (**M‑BRAB**)
S/N 42.MN058 (**M‑BRAC**) |
| **Avionics** | Garmin **G1000 NXi** |
| **Display (crew)** | Samsung **DB10E‑T** 10.1″ WXGA (1280 × 800) |
| **Data‑acq PC** | Advantech **MIC‑7700**
• CPU i7‑6700TE
• 8 GB DDR4
• **SQFlash 830‑series** 2.5″ SATA SSD |
| **OS** | Microsoft **Windows 10 Pro** |
| **GeoVLog stack** | .NET 8, HDF5.NET, AES‑256‑GCM encryption |
---
## 1 · Sensor inventory (airframe wiring)
| # | Sensor | Port | Baud | Update Hz | Notes |
|---|--------|------|------|-----------|-------|
| 1 | **Geometrics G‑823 #1** | COM1 | 9600 | 10 * | Total‑field Cs‑mag (left wing‑tip) |
| 2 | **Geometrics G‑823 #2** | COM2 | 9600 | 10 * | Total‑field Cs‑mag (right wing‑tip) |
| 3 | **GEM GSM‑90 VLF EM** | COM7 | 115200 | 10 | 3‑axis VLF |
| 4 | **u‑blox LEA‑5H‑50 GPS** | COM4 | 9600 | 1 | `$GPRMC`, `$GPGGA` |
| 5 | **FreeFlight RA‑4500** | COM9 | 56000 | 25 | Radar‑alt, hex stream |
| 6 | **SBG Ellipse2‑N INS** | COM12 | 115200 | 10 | Attitude `$PRDID` |
\* Geometrics 10 Hz to be confirmed after on‑wing test.
---
### 1.1 Message examples
INS $PRDID (SBG Ellipse2‑N)
```text
$PRDID,-003.72,+000.10,356.75*7A
$PRDID,-003.73,+000.10,356.69*76
...
$PRDID,-003.73,+000.11,356.50*7D
```
GPS $GPRMC / $GPGGA (u‑blox LEA‑5H‑50)
```text
$GPRMC,103021.00,A,1754.84632,S,03105.65138,E,0.009,,061222,,,D*67
$GPGGA,103021.00,1754.84632,S,03105.65138,E,2,11,0.74,1496.3,M,1.0,M,,0000*4A
...
$GPGGA,103027.00,1754.84628,S,03105.65136,E,2,11,0.74,1496.2,M,1.0,M,,0000*48
```
Radar‑alt hex (FreeFlight RA‑4500)
```text
10DF0303E80033100310DF0303E80033100310DF0303E800331003...
```
VLF line (GEM GSM‑90)
```text
011019.4,19.6,011.67,-069.2,-004.7, 086, 122,016,19.0,007.05,-023.6,...
011019.5,19.6,011.47,-074.1,-018.1, 089, 117,016,19.0,005.68,-002.2,...
```
Magnetometer #1 (Geometrics G‑823)
```text
$ 30614.050,1521
$ 30613.942,1499
...
```
*(Parsing specs will live in `docs/parsers/`.)*
---
### 1.2 Message‑parsing placeholders
Detailed parsing docs will live here:
```
docs/parsers/
PRDID.md # SBG Ellipse2 attitude sentence
GPRMC_GPGGA.md # u‑blox NMEA position / fix quality
GEM_VLF.md # GSM‑90 VLF line
Geometrics_G823.md # Cs‑mag ASCII
RA4500.md # Radar‑alt hex stream
```
`GpsParser` now fully decodes both `$GPRMC` and `$GPGGA` sentences once the
raw frames are validated (checksum and fix status). Other decoders will follow.
---
## 2 · Repository layout
- **[src](src/)/**
• **[GeoVLog.Core](src/GeoVLog.Core/)** — shared models, crypto, HDF5 helpers
• **[GeoVLogSvc](src/GeoVLogSvc/)** — Windows Service logger (aircraft)
• **[GeoVLogReader](src/GeoVLogReader/)** — CLI decrypt & extract
• **[GeoVLogMon](src/GeoVLogMon/)** — WPF live cockpit monitor
• **[GeoVLogViewer](src/GeoVLogViewer/)** — WPF analyst GUI (placeholder)
- **[tests](tests/)/** — xUnit projects & integration tests
Each directory contains its own **README.md** with build/run instructions and a roadmap.
---
## 3 · Project overview
| Project | Type | Purpose |
|---------|------|---------|
| **[GeoVLog.Core](src/GeoVLog.Core/)** | Class library | Data contracts (`Record`, `Manifest`), AES/RSA helpers, embedded public key, HDF5 constants |
| **[GeoVLogSvc](src/GeoVLogSvc/)** | Worker Service | Reads COM ports, timestamps frames using the system clock, writes **encrypted** HDF5; hourly rotation, manifest YAML, gRPC telemetry |
| **[GeoVLogMon](src/GeoVLogMon/)** | WPF app | Optional cockpit monitor – live charts, COM LEDs, disk health, start/stop flight |
| **[GeoVLogReader](src/GeoVLogReader/)** | Console app | Decrypt & extract logs to plain HDF5 / CSV; uses private key PEM |
| **[GeoVLogViewer](src/GeoVLogViewer/)** | WPF app (scaffold) | Future analyst GUI for plotting, QC, map overlay |
| **[tests](tests/)** | xUnit | Unit & integration tests across layers |
*(Each linked folder contains its own README.)*
---
## 4 · Build & publish
```powershell
git clone https://yourrepo/GeoVLog.git
dotnet build GeoVLog/GeoVLog.sln -c Release
# self‑contained single‑file publishes
dotnet publish src/GeoVLogSvc -c Release -r win-x64
dotnet publish src/GeoVLogReader -c Release -r win-x64
dotnet publish src/GeoVLogMon -c Release -r win-x64
```
MSI scripts live in `tools/installer/`.
---
## 5 · End‑to‑end workflow — from power‑on to analysis
| Stage | Action | Outputs / checks |
|-------|--------|------------------|
| **1 Boot** | • Pilot powers MIC‑7700.
• **GeoVLogSvc** auto‑starts.
• GNSS lock logged. | Event ID 1000 “Logger ready” |
| **2 Pre‑take‑off** | Launch **GeoVLogMon**:
• COM LEDs **green**
• Disk bar > 20 % | Ready banner green |
| **3 Start Flight** | Operator clicks **Start Flight** → `BeginFlight` RPC.
• `manifest.yaml` created
• First hourly file opened | Event ID 1010 “Opened …” |
| **4 In‑flight log** | • Streams ≈ 2 GB h⁻¹ encrypted HDF5.
• Hourly rotation.
• Alarms (disk, overrun) as ID 2010. | Encrypted files + manifest |
| **5 Flight end** | **Stop Flight** or power‑down → clean close, SHA‑256 in manifest. | Event ID 1011 “Flight closed” |
| **6 Off‑load** | Copy flight folder from `D:\SurveyData` to ground PC. | Hash verify OK |
| **7 Decrypt & extract** | Run `GeoVLogReader -i 20250521_0930_GeoVLog.h5 --out-file Plain_0930.h5` on ground PC. | Plain HDF5/CSV |
| **8 Analyse / QC** | Python notebook or **GeoVLogViewer**. | QC plots, report |
---
## 6 · Development conventions
* **Language / toolchain** – **C# 11 / .NET 8**, `Nullable` enabled, *warnings‑as‑errors* (`TreatWarningsAsErrors=true`).
* **Folder pattern** – keep code organised under `Models/`, `Crypto/`, `Hdf5/`, `Services/`, `ViewModels/`.
* **Single source of truth** – all reusable logic lives in **GeoVLog.Core**; no duplicated helpers in app projects.
* **Commit hooks** – run `dotnet format` and `dotnet test` before push.
* **Branch / PR tags** – `[core]`, `[svc]`, `[reader]`, `[mon]`, `[viewer]`.
* **Code signing & integrity** – production binaries are Authenticode‑signed; GeoVLogSvc verifies its own signature on startup.
* **Strong-name signing** – place `GeoVLog.snk` in the repository root and set `GeoVLogSignedBuild=true` to sign assemblies. Without this property, builds remain unsigned for development even if the key is present.
---
## 7 · License
MIT – see root `LICENSE`.
---
## 8 · Contacts
| Role | Name | Contact |
|------|------|---------|
| Tech Lead | _placeholder_ | |
| Ops Engineer | _placeholder_ | |
| Support | support@your‑company.com | |
---
_Last updated 2025-05-22_