Initial commit: COPILOT D6 Flutter keyboard controller
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>
This commit is contained in:
50
copilot_keyboard/lib/presentation/blocs/ptz/ptz_state.dart
Normal file
50
copilot_keyboard/lib/presentation/blocs/ptz/ptz_state.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
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];
|
||||
}
|
||||
Reference in New Issue
Block a user