summaryrefslogtreecommitdiffstats
path: root/lib/Kuksa-server/vehicle_class.dart
blob: c2f2ac2d57014b57401a5b7b699721ee23695072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SPDX-License-Identifier: Apache-2.0
class VehicleSignal {
  VehicleSignal({
    required this.speed,
    required this.rpm,
    required this.fuelLevel,
    required this.frontLeftTP,
    required this.frontRightTP,
    required this.rearLeftTP,
    required this.rearRightTP,
    required this.isBatteryCharging,
    required this.isChildLockActiveLeft,
    required this.isChildLockActiveRight,
    required this.currentLatitude,
    required this.currentLongitude,
    required this.fuelRate,
    required this.insideTemperature,
    required this.outsideTemperature,
  });

  final double speed;
  final double rpm;
  final double fuelLevel;
  final double frontLeftTP;
  final double frontRightTP;
  final double rearLeftTP;
  final double rearRightTP;
  final bool isChildLockActiveLeft;
  final bool isChildLockActiveRight;
  final double currentLongitude;
  final double currentLatitude;
  final double fuelRate;
  final int insideTemperature;
  final int outsideTemperature;

  final bool isBatteryCharging;

  VehicleSignal copyWith({
    double? speed,
    double? rpm,
    double? fuelLevel,
    double? frontLeftTP,
    double? frontRightTP,
    double? rearLeftTP,
    double? rearRightTP,
    bool? isBatteryCharging,
    bool? isChildLockActiveLeft,
    bool? isChildLockActiveRight,
    double? currentLongitude,
    double? currentLatitude,
    double? fuelRate,
    int? insideTemperature,
    int? outsideTemperature,
  }) {
    return VehicleSignal(
      speed: speed ?? this.speed,
      rpm: rpm ?? this.rpm,
      fuelLevel: fuelLevel ?? this.fuelLevel,
      frontLeftTP: frontLeftTP ?? this.frontLeftTP,
      frontRightTP: frontRightTP ?? this.frontRightTP,
      rearLeftTP: rearLeftTP ?? this.rearLeftTP,
      rearRightTP: rearRightTP ?? this.rearRightTP,
      isChildLockActiveLeft:
          isChildLockActiveLeft ?? this.isChildLockActiveLeft,
      isChildLockActiveRight:
          isChildLockActiveRight ?? this.isChildLockActiveRight,
      isBatteryCharging: isBatteryCharging ?? this.isBatteryCharging,
      currentLatitude: currentLatitude ?? this.currentLatitude,
      currentLongitude: currentLongitude ?? this.currentLongitude,
      fuelRate: fuelRate ?? this.fuelRate,
      insideTemperature: insideTemperature ?? this.insideTemperature,
      outsideTemperature: outsideTemperature ?? this.outsideTemperature,
    );
  }
}