summaryrefslogtreecommitdiffstats
path: root/lib/vehicle_signal/vehicle_signal_model.dart
blob: 90f76e71b2a91ef3f47c13ebe31ca36ef9d59e52 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// SPDX-License-Identifier: Apache-2.0

class VehicleSignal {
  VehicleSignal({
    required this.speed,
    required this.rpm,
    required this.fuelLevel,
    required this.coolantTemp,
    required this.isLeftIndicator,
    required this.isRightIndicator,
    required this.selectedGear,
    required this.isLowBeam,
    required this.isHighBeam,
    required this.isHazardLightOn,
    required this.travelledDistance,
    required this.isParkingOn,
    required this.performanceMode,
    required this.ambientAirTemp,
    required this.cruiseControlSpeed,
    required this.isCruiseControlActive,
    required this.isCruiseControlError,
    required this.isMILon,
    required this.isTrunkLocked,
    required this.isTrunkOpen,
    required this.isBatteryCharging,
    //steering switches
    required this.vehicleDistanceUnit,
    required this.isSteeringCruiseEnable,
    required this.isSteeringCruiseSet,
    required this.isSteeringCruiseResume,
    required this.isSteeringCruiseCancel,
    required this.isSteeringLaneWarning,
    required this.isSteeringInfo,
    // map coordinates
    required this.currLat,
    required this.currLng,
    required this.desLat,
    required this.desLng,
  });
  final double speed;
  final double rpm;
  final double fuelLevel;
  final double coolantTemp;
  final double cruiseControlSpeed;
  final bool isLeftIndicator;
  final bool isRightIndicator;
  final String selectedGear;
  final String performanceMode;
  final String ambientAirTemp;
  final bool isLowBeam;
  final bool isHighBeam;
  final bool isParkingOn;
  final bool isHazardLightOn;
  final bool isTrunkOpen;
  final bool isTrunkLocked;
  final bool isMILon;
  final bool isCruiseControlActive;
  final bool isCruiseControlError;
  final bool isBatteryCharging;
  final double travelledDistance;

  final String vehicleDistanceUnit;
  final bool isSteeringCruiseEnable;
  final bool isSteeringCruiseSet;
  final bool isSteeringCruiseResume;
  final bool isSteeringCruiseCancel;
  final bool isSteeringLaneWarning;
  final bool isSteeringInfo;

  final double currLat;
  final double currLng;
  final double desLat;
  final double desLng;

  VehicleSignal copyWith({
    double? speed,
    double? rpm,
    double? fuelLevel,
    double? coolantTemp,
    bool? isLeftIndicator,
    bool? isRightIndicator,
    String? selectedGear,
    String? performanceMode,
    String? ambientAirTemp,
    bool? isLowBeam,
    bool? isHighBeam,
    bool? isHazardLightOn,
    bool? isParkingOn,
    bool? isTrunkLocked,
    bool? isTrunkOpen,
    bool? isMILon,
    bool? isCruiseControlError,
    bool? isCruiseControlActive,
    bool? isBatteryCharging,
    double? travelledDistance,
    double? cruiseControlSpeed,
    // Steering
    String? vehicleDistanceUnit,
    bool? isSteeringCruiseEnable,
    bool? isSteeringCruiseSet,
    bool? isSteeringCruiseResume,
    bool? isSteeringCruiseCancel,
    bool? isSteeringLaneWarning,
    bool? isSteeringInfo,
    // map coordinates
    double? currLat,
    double? currLng,
    double? desLat,
    double? desLng,
  }) {
    return VehicleSignal(
      speed: speed ?? (this.speed),
      rpm: rpm ?? this.rpm,
      fuelLevel: fuelLevel ?? this.fuelLevel,
      coolantTemp: coolantTemp ?? this.coolantTemp,
      isLeftIndicator: isLeftIndicator ?? this.isLeftIndicator,
      isRightIndicator: isRightIndicator ?? this.isRightIndicator,
      selectedGear: selectedGear ?? this.selectedGear,
      isLowBeam: isLowBeam ?? this.isLowBeam,
      isHighBeam: isHighBeam ?? this.isHighBeam,
      isHazardLightOn: isHazardLightOn ?? this.isHazardLightOn,
      travelledDistance: travelledDistance ?? this.travelledDistance,
      isParkingOn: isParkingOn ?? this.isParkingOn,
      performanceMode: performanceMode ?? this.performanceMode,
      isTrunkLocked: isTrunkLocked ?? this.isTrunkLocked,
      isTrunkOpen: isTrunkOpen ?? this.isTrunkOpen,
      ambientAirTemp: ambientAirTemp ?? this.ambientAirTemp,
      isMILon: isMILon ?? this.isMILon,
      isCruiseControlActive:
          isCruiseControlActive ?? this.isCruiseControlActive,
      cruiseControlSpeed: cruiseControlSpeed ?? this.cruiseControlSpeed,
      isCruiseControlError: isCruiseControlError ?? this.isCruiseControlError,
      isBatteryCharging: isBatteryCharging ?? this.isBatteryCharging,
      isSteeringCruiseEnable:
          isSteeringCruiseEnable ?? this.isSteeringCruiseEnable,
      isSteeringCruiseSet: isSteeringCruiseSet ?? this.isSteeringCruiseSet,
      isSteeringCruiseResume:
          isSteeringCruiseResume ?? this.isSteeringCruiseResume,
      isSteeringCruiseCancel:
          isSteeringCruiseCancel ?? this.isSteeringCruiseCancel,
      isSteeringInfo: isSteeringInfo ?? this.isSteeringInfo,
      isSteeringLaneWarning:
          isSteeringLaneWarning ?? this.isSteeringLaneWarning,
      vehicleDistanceUnit: vehicleDistanceUnit ?? this.vehicleDistanceUnit,
      //
      currLat: currLat ?? this.currLat,
      currLng: currLng ?? this.currLng,
      desLat: desLat ?? this.desLat,
      desLng: desLng ?? this.desLng,
    );
  }
}