aboutsummaryrefslogtreecommitdiffstats
path: root/lib/data/models
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2024-08-15 15:54:01 -0400
committerLisandro Perez Meyer <lpmeyer@ics.com>2024-08-15 20:10:34 +0000
commit3ef28eeae6e3336232ab13d0d934aa82892dfe74 (patch)
treee1c4626d690bc137c00a08a264b4b27559060adf /lib/data/models
parent25b6a079d5fe9c1365d776298ae5230a4de1ba16 (diff)
Fix engine speed signal type
Update use of the VSS engine speed (RPM) signal to match the fix done to the AGL VSS overlays to restore the upstream integer data type. Bug-AGL: SPEC-5204 Change-Id: I1993cf291cdc2ca056f4fb2b389ef4eee5558473 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'lib/data/models')
-rw-r--r--lib/data/models/vehicle.dart10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/data/models/vehicle.dart b/lib/data/models/vehicle.dart
index dfeae05..0f1031b 100644
--- a/lib/data/models/vehicle.dart
+++ b/lib/data/models/vehicle.dart
@@ -5,7 +5,7 @@ import '../../export.dart';
@immutable
class Vehicle {
final double speed;
- final double engineSpeed;
+ final int engineSpeed;
final double insideTemperature;
final double outsideTemperature;
final int range;
@@ -94,7 +94,7 @@ class Vehicle {
Vehicle copyWith({
double? speed,
- double? engineSpeed,
+ int? engineSpeed,
double? insideTemperature,
double? outsideTemperature,
int? range,
@@ -166,7 +166,7 @@ class Vehicle {
factory Vehicle.fromMap(Map<String, dynamic> map) {
return Vehicle(
map['speed']?.toDouble() ?? 0.0,
- map['engineSpeed']?.toDouble() ?? 0.0,
+ map['engineSpeed']?.toInt() ?? 0,
map['insideTemperature']?.toDouble() ?? 0.0,
map['outsideTemperature']?.toDouble() ?? 0.0,
map['range']?.toInt() ?? 0,
@@ -204,13 +204,13 @@ class Vehicle {
return other is Vehicle &&
other.speed == speed &&
+ other.engineSpeed == engineSpeed &&
other.insideTemperature == insideTemperature &&
other.outsideTemperature == outsideTemperature &&
other.range == range &&
other.fuelLevel == fuelLevel &&
other.isChildLockActiveLeft == isChildLockActiveLeft &&
other.isChildLockActiveRight == isChildLockActiveRight &&
- other.engineSpeed == engineSpeed &&
other.frontLeftTire == frontLeftTire &&
other.frontRightTire == frontRightTire &&
other.rearLeftTire == rearLeftTire &&
@@ -228,13 +228,13 @@ class Vehicle {
@override
int get hashCode {
return speed.hashCode ^
+ engineSpeed.hashCode ^
insideTemperature.hashCode ^
outsideTemperature.hashCode ^
range.hashCode ^
fuelLevel.hashCode ^
isChildLockActiveLeft.hashCode ^
isChildLockActiveRight.hashCode ^
- engineSpeed.hashCode ^
frontLeftTire.hashCode ^
frontRightTire.hashCode ^
rearLeftTire.hashCode ^