MotorSignal-App/lib/models/telemetry_sample.dart

104 lines
2.5 KiB
Dart

import '../services/validation/telemetry_validator.dart';
class TelemetrySample {
final DateTime timestamp;
// Location Data
final double? latitude;
final double? longitude;
final double? altitude;
final double? speed; // MPH
final double? heading;
final double? gpsAccuracy;
final DateTime? gpsTimestamp;
final int? gpsAgeMs;
// IMU Data
final DateTime? imuTimestamp;
final double? leanAngle;
final double? pitchAngle;
final double? accelX;
final double? accelY;
final double? accelZ;
final double? longitudinalG;
final double? lateralG;
final double? gyroX;
final double? gyroY;
final double? gyroZ;
// Validation & Quality
final TelemetryQuality? quality;
TelemetrySample({
required this.timestamp,
this.latitude,
this.longitude,
this.altitude,
this.speed,
this.heading,
this.gpsAccuracy,
this.gpsTimestamp,
this.gpsAgeMs,
this.imuTimestamp,
this.leanAngle,
this.pitchAngle,
this.accelX,
this.accelY,
this.accelZ,
this.longitudinalG,
this.lateralG,
this.gyroX,
this.gyroY,
this.gyroZ,
this.quality,
});
TelemetrySample copyWith({
DateTime? timestamp,
double? latitude,
double? longitude,
double? altitude,
double? speed,
double? heading,
double? gpsAccuracy,
DateTime? gpsTimestamp,
int? gpsAgeMs,
DateTime? imuTimestamp,
double? leanAngle,
double? pitchAngle,
double? accelX,
double? accelY,
double? accelZ,
double? longitudinalG,
double? lateralG,
double? gyroX,
double? gyroY,
double? gyroZ,
TelemetryQuality? quality,
}) {
return TelemetrySample(
timestamp: timestamp ?? this.timestamp,
latitude: latitude ?? this.latitude,
longitude: longitude ?? this.longitude,
altitude: altitude ?? this.altitude,
speed: speed ?? this.speed,
heading: heading ?? this.heading,
gpsAccuracy: gpsAccuracy ?? this.gpsAccuracy,
gpsTimestamp: gpsTimestamp ?? this.gpsTimestamp,
gpsAgeMs: gpsAgeMs ?? this.gpsAgeMs,
imuTimestamp: imuTimestamp ?? this.imuTimestamp,
leanAngle: leanAngle ?? this.leanAngle,
pitchAngle: pitchAngle ?? this.pitchAngle,
accelX: accelX ?? this.accelX,
accelY: accelY ?? this.accelY,
accelZ: accelZ ?? this.accelZ,
longitudinalG: longitudinalG ?? this.longitudinalG,
lateralG: lateralG ?? this.lateralG,
gyroX: gyroX ?? this.gyroX,
gyroY: gyroY ?? this.gyroY,
gyroZ: gyroZ ?? this.gyroZ,
quality: quality ?? this.quality,
);
}
}