chore: add build artifacts, map assets, and routing data
This commit is contained in:
@@ -4,6 +4,12 @@ enum AngleUnit {
|
||||
dual, // Both: 045° (0800 ₥)
|
||||
}
|
||||
|
||||
extension AngleUnitExtension on AngleUnit {
|
||||
String formatHeading(double deg, {bool includeLabel = false}) {
|
||||
return AngleFormatter.format(deg, this, includeLabel: includeLabel);
|
||||
}
|
||||
}
|
||||
|
||||
class AngleFormatter {
|
||||
static const double degToMilsNato = 17.7777777778; // 6400 mils / 360 deg
|
||||
|
||||
@@ -23,11 +29,11 @@ class AngleFormatter {
|
||||
|
||||
switch (unit) {
|
||||
case AngleUnit.degrees:
|
||||
return includeLabel ? 'السمت: $degStr' : degStr;
|
||||
return includeLabel ? 'الاتجاه: $degStr' : degStr;
|
||||
case AngleUnit.mils:
|
||||
return includeLabel ? 'السمت: $milsStr' : milsStr;
|
||||
return includeLabel ? 'الاتجاه: $milsStr' : milsStr;
|
||||
case AngleUnit.dual:
|
||||
return includeLabel ? '$degStr ($milsStr)' : '$degStr ($milsStr)';
|
||||
return includeLabel ? 'الاتجاه: $degStr ($milsStr)' : '$degStr ($milsStr)';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import 'package:intaleq_maps/intaleq_maps.dart';
|
||||
|
||||
enum UnitRole {
|
||||
commander,
|
||||
infantry,
|
||||
vehicle,
|
||||
medic
|
||||
}
|
||||
|
||||
class FriendlyUnit {
|
||||
final String deviceId;
|
||||
final String callsign;
|
||||
final LatLng position;
|
||||
final double heading;
|
||||
final UnitRole role;
|
||||
final DateTime lastSeen;
|
||||
|
||||
FriendlyUnit({
|
||||
required this.deviceId,
|
||||
required this.callsign,
|
||||
required this.position,
|
||||
required this.heading,
|
||||
required this.role,
|
||||
required this.lastSeen,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'deviceId': deviceId,
|
||||
'callsign': callsign,
|
||||
'lat': position.latitude,
|
||||
'lng': position.longitude,
|
||||
'heading': heading,
|
||||
'role': role.name,
|
||||
'timestamp': lastSeen.millisecondsSinceEpoch,
|
||||
};
|
||||
|
||||
factory FriendlyUnit.fromJson(Map<String, dynamic> json) {
|
||||
return FriendlyUnit(
|
||||
deviceId: json['deviceId'],
|
||||
callsign: json['callsign'],
|
||||
position: LatLng(json['lat'], json['lng']),
|
||||
heading: (json['heading'] as num).toDouble(),
|
||||
role: UnitRole.values.firstWhere(
|
||||
(e) => e.name == json['role'],
|
||||
orElse: () => UnitRole.infantry,
|
||||
),
|
||||
lastSeen: DateTime.fromMillisecondsSinceEpoch(json['timestamp']),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum TacticalSheetType {
|
||||
route,
|
||||
los,
|
||||
viewshed,
|
||||
artillery,
|
||||
hlz,
|
||||
minefield,
|
||||
isochrone,
|
||||
symbols,
|
||||
overlays
|
||||
}
|
||||
|
||||
class ActiveTacticalSheet {
|
||||
final TacticalSheetType type;
|
||||
final String title;
|
||||
final IconData icon;
|
||||
|
||||
ActiveTacticalSheet(this.type, this.title, this.icon);
|
||||
}
|
||||
Reference in New Issue
Block a user