Flutter web app replacing legacy WPF CCTV surveillance keyboard controller. Includes wall overview, section view with monitor grid, camera input, PTZ control, alarm/lock/sequence BLoCs, and legacy-matching UI styling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
1.3 KiB
Dart
51 lines
1.3 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
enum PtzDirection { none, left, right, up, down, zoomIn, zoomOut }
|
|
|
|
enum PtzLockStatus { none, acquiring, locked, denied }
|
|
|
|
class PtzState extends Equatable {
|
|
final int? activeCameraId;
|
|
final PtzDirection currentDirection;
|
|
final bool isMoving;
|
|
final PtzLockStatus lockStatus;
|
|
final String? lockedBy;
|
|
final String? error;
|
|
|
|
const PtzState({
|
|
this.activeCameraId,
|
|
this.currentDirection = PtzDirection.none,
|
|
this.isMoving = false,
|
|
this.lockStatus = PtzLockStatus.none,
|
|
this.lockedBy,
|
|
this.error,
|
|
});
|
|
|
|
bool get hasActiveCamera => activeCameraId != null;
|
|
bool get hasLock => lockStatus == PtzLockStatus.locked;
|
|
|
|
PtzState copyWith({
|
|
int? activeCameraId,
|
|
PtzDirection? currentDirection,
|
|
bool? isMoving,
|
|
PtzLockStatus? lockStatus,
|
|
String? lockedBy,
|
|
String? error,
|
|
bool clearCamera = false,
|
|
}) {
|
|
return PtzState(
|
|
activeCameraId:
|
|
clearCamera ? null : (activeCameraId ?? this.activeCameraId),
|
|
currentDirection: currentDirection ?? this.currentDirection,
|
|
isMoving: isMoving ?? this.isMoving,
|
|
lockStatus: lockStatus ?? this.lockStatus,
|
|
lockedBy: lockedBy ?? this.lockedBy,
|
|
error: error,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props =>
|
|
[activeCameraId, currentDirection, isMoving, lockStatus, lockedBy, error];
|
|
}
|