mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-14 15:10:36 +02:00
first version worth putting in git - compiles and runs - missing a lot still.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/// A bundle of preset OSM tags that describe a particular camera model/type.
|
||||
class CameraProfile {
|
||||
final String name;
|
||||
final Map<String, String> tags;
|
||||
|
||||
const CameraProfile({
|
||||
required this.name,
|
||||
required this.tags,
|
||||
});
|
||||
|
||||
// Built‑in ALPR profile (Flock Falcon‑style).
|
||||
factory CameraProfile.alpr() => const CameraProfile(
|
||||
name: 'ALPR Camera',
|
||||
tags: {
|
||||
'man_made': 'surveillance',
|
||||
'surveillance:type': 'ALPR',
|
||||
'surveillance': 'public',
|
||||
'surveillance:zone': 'traffic',
|
||||
'camera:type': 'fixed',
|
||||
'camera:mount': 'pole',
|
||||
},
|
||||
);
|
||||
|
||||
CameraProfile copyWith({
|
||||
String? name,
|
||||
Map<String, String>? tags,
|
||||
}) =>
|
||||
CameraProfile(
|
||||
name: name ?? this.name,
|
||||
tags: tags ?? this.tags,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
class OsmCameraNode {
|
||||
final int id;
|
||||
final LatLng coord;
|
||||
final Map<String, String> tags;
|
||||
|
||||
OsmCameraNode({
|
||||
required this.id,
|
||||
required this.coord,
|
||||
required this.tags,
|
||||
});
|
||||
|
||||
bool get hasDirection => tags.containsKey('direction');
|
||||
double? get directionDeg =>
|
||||
hasDirection ? double.tryParse(tags['direction']!) : null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'camera_profile.dart';
|
||||
|
||||
class PendingUpload {
|
||||
final LatLng coord;
|
||||
final double direction;
|
||||
final CameraProfile profile;
|
||||
final DateTime queuedAt;
|
||||
|
||||
PendingUpload({
|
||||
required this.coord,
|
||||
required this.direction,
|
||||
required this.profile,
|
||||
}) : queuedAt = DateTime.now();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user