Neural Capture · Demo: open Demo tour

Monograph · 06 · GUI wizard

06

Core pipeline · operator

GUI wizard

Chapter contract

Owns WinUI wizard pages and P/Invoke surface consumption. Must not call Sapera directly. Done when a reader can walk Connect→Setup→Capture→Done and know what each page triggers in the DLL.

The operator never sees C++. Four pages gate the dangerous hardware steps.

  1. Connect

    Discover GigE cameras; scan/connect BLE turntable. Calls CamMatrix_DiscoverCameras, BLE scan APIs.

  2. Setup

    Presets: Quick 36, Detailed 72, or custom angle step / total rotation / speed. Persists via settings API.

  3. Capture

    CamMatrix_StartCapture(session, positions, angleStep, speed). Poll state/elapsed for UI chrome. Stop aborts worker.

  4. Done

    Show path + image count; open folder. Completion callback may fire success audio.

Connect page
Plate GUI-1

Connect. Real UI screenshot — engine/app output, not conceptual art.

Capture page
Plate GUI-2

Capture. Live sequence controls and status.

Polling vs callbacks

UI uses DispatcherTimer polling for state/progress plus optional log/progress callbacks marshaled to the UI thread. Never touch camera mutexes from XAML event handlers.

Algorithm · UI poll loop (Capture page)
  1. DispatcherTimer tick (~200–500 ms)
  2. Read CamMatrix_GetCaptureState, progress, elapsed capture/rotate ms
  3. Update progress chrome; on terminal state, navigate Done
  4. Stop button → CamMatrix_StopCapture → join worker
Decision

No Sapera types in C#

Why

P/Invoke only sees C primitives and callbacks. UI cannot free a SapBuffer* by accident. Hardware failures surface as logs + boolean success, not raw SDK exceptions in XAML.

App/Pages/*Page.xamlWizard surfaces
App/Services/CaptureService.csP/Invoke wrapper
src/api/CaptureAPI.hExported surface area