Files
PilotVault/Fly App/lib/ui/fly/panels/camera_write.dart
T
tajniak81andClaude Opus 5.5 c1770fff73 Give the Fly App GO 4-style camera controls
One settings table in CameraBridge watches every camera value into the
telemetry tick and backs a generic setCameraValue, so the tabbed camera
menu (Exposure / Photo / Video / Other) is built from row specs and the
camera's own capability ranges. Writes show at once and fall back to what
the camera reports. Adds the quick exposure panel (Auto/A/S/M, ISO slider,
shutter and aperture wheels, EV strip, metered EV in M), a new camera
column with record timer and interval/pano progress, a zoom column for
zoom cameras, tap-to-focus / tap-to-meter, and a live histogram.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 19:57:38 +02:00

31 lines
1.0 KiB
Dart

import 'dart:async';
import '../../../fly/state/camera_state.dart';
/// How long a written camera setting may stay unconfirmed before the HUD
/// shows the camera's own value again.
const Duration cameraSettle = Duration(seconds: 3);
/// Writes one camera setting the way every camera-menu row does (plan P4):
/// show [pending] at once, send, roll back with [onError] if the camera
/// refuses, and drop the pending value after [cameraSettle] in any case — by
/// then the camera has reported the new value (which replaces it) or ignored
/// the write (and the row snaps back to what it really is).
Future<void> writeCameraSetting(
CameraState camera, {
required String label,
required Map<String, Object?> pending,
required Future<void> Function() send,
required void Function(String label, Object error) onError,
}) async {
camera.setPending(pending);
try {
await send();
} catch (e) {
camera.dropPending(pending.keys);
onError(label, e);
return;
}
Timer(cameraSettle, () => camera.dropPending(pending.keys));
}