1
+ /**
2
+ * Set the PressureTelltale
3
+ * @since SmartDeviceLink 2.0.0
4
+ * @param {WarningLightStatus } telltale - Status of the Tire Pressure Telltale. See WarningLightStatus. - The desired PressureTelltale.
5
+ * @returns {TireStatus } - The class instance for method chaining.
6
+ */
7
+ setPressureTelltale ( telltale ) {
8
+ this . _validateType ( WarningLightStatus , telltale ) ;
9
+ this . setParameter ( TireStatus . KEY_PRESSURE_TELLTALE , telltale ) ;
10
+ return this ;
11
+ }
12
+
13
+ /**
14
+ * Get the PressureTelltale
15
+ * @returns {WarningLightStatus } - the KEY_PRESSURE_TELLTALE value
16
+ */
17
+ getPressureTelltale ( ) {
18
+ let warningLightStatus = this . getObject ( WarningLightStatus , TireStatus . KEY_PRESSURE_TELLTALE ) ;
19
+ if ( warningLightStatus === null ) {
20
+ warningLightStatus = WarningLightStatus . WLS_NOT_USED ;
21
+ this . setParameter ( TireStatus . KEY_PRESSURE_TELLTALE , warningLightStatus ) ;
22
+ console . warn ( 'TireStatus\'s pressureTelltale was null and will be set to WarningLightStatus.WLS_NOT_USED. In the future, this will change to be nullable.' ) ;
23
+ }
24
+ return warningLightStatus ;
25
+ }
26
+
27
+ /**
28
+ * Set the LeftFront
29
+ * @since SmartDeviceLink 2.0.0
30
+ * @param {SingleTireStatus } front - The status of the left front tire. - The desired LeftFront.
31
+ * @returns {TireStatus } - The class instance for method chaining.
32
+ */
33
+ setLeftFront ( front ) {
34
+ this . _validateType ( SingleTireStatus , front ) ;
35
+ this . setParameter ( TireStatus . KEY_LEFT_FRONT , front ) ;
36
+ return this ;
37
+ }
38
+
39
+ /**
40
+ * Get the LeftFront
41
+ * @returns {SingleTireStatus } - the KEY_LEFT_FRONT value
42
+ */
43
+ getLeftFront ( ) {
44
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_LEFT_FRONT ) ;
45
+ if ( tireStatus === null ) {
46
+ tireStatus = new SingleTireStatus ( {
47
+ status : 'UNKNOWN' ,
48
+ } ) ;
49
+ this . setParameter ( TireStatus . KEY_LEFT_FRONT , tireStatus ) ;
50
+ console . warn ( 'TireStatus\'s leftFront was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
51
+ }
52
+ return tireStatus ;
53
+ }
54
+
55
+ /**
56
+ * Set the RightFront
57
+ * @since SmartDeviceLink 2.0.0
58
+ * @param {SingleTireStatus } front - The status of the right front tire. - The desired RightFront.
59
+ * @returns {TireStatus } - The class instance for method chaining.
60
+ */
61
+ setRightFront ( front ) {
62
+ this . _validateType ( SingleTireStatus , front ) ;
63
+ this . setParameter ( TireStatus . KEY_RIGHT_FRONT , front ) ;
64
+ return this ;
65
+ }
66
+
67
+ /**
68
+ * Get the RightFront
69
+ * @returns {SingleTireStatus } - the KEY_RIGHT_FRONT value
70
+ */
71
+ getRightFront ( ) {
72
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_RIGHT_FRONT ) ;
73
+ if ( tireStatus === null ) {
74
+ tireStatus = new SingleTireStatus ( {
75
+ status : 'UNKNOWN' ,
76
+ } ) ;
77
+ this . setParameter ( TireStatus . KEY_RIGHT_FRONT , tireStatus ) ;
78
+ console . warn ( 'TireStatus\'s rightFront was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
79
+ }
80
+ return tireStatus ;
81
+ }
82
+
83
+ /**
84
+ * Set the LeftRear
85
+ * @since SmartDeviceLink 2.0.0
86
+ * @param {SingleTireStatus } rear - The status of the left rear tire. - The desired LeftRear.
87
+ * @returns {TireStatus } - The class instance for method chaining.
88
+ */
89
+ setLeftRear ( rear ) {
90
+ this . _validateType ( SingleTireStatus , rear ) ;
91
+ this . setParameter ( TireStatus . KEY_LEFT_REAR , rear ) ;
92
+ return this ;
93
+ }
94
+
95
+ /**
96
+ * Get the LeftRear
97
+ * @returns {SingleTireStatus } - the KEY_LEFT_REAR value
98
+ */
99
+ getLeftRear ( ) {
100
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_LEFT_REAR ) ;
101
+ if ( tireStatus === null ) {
102
+ tireStatus = new SingleTireStatus ( {
103
+ status : 'UNKNOWN' ,
104
+ } ) ;
105
+ this . setParameter ( TireStatus . KEY_LEFT_REAR , tireStatus ) ;
106
+ console . warn ( 'TireStatus\'s leftRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
107
+ }
108
+ return tireStatus ;
109
+ }
110
+
111
+ /**
112
+ * Set the RightRear
113
+ * @since SmartDeviceLink 2.0.0
114
+ * @param {SingleTireStatus } rear - The status of the right rear tire. - The desired RightRear.
115
+ * @returns {TireStatus } - The class instance for method chaining.
116
+ */
117
+ setRightRear ( rear ) {
118
+ this . _validateType ( SingleTireStatus , rear ) ;
119
+ this . setParameter ( TireStatus . KEY_RIGHT_REAR , rear ) ;
120
+ return this ;
121
+ }
122
+
123
+ /**
124
+ * Get the RightRear
125
+ * @returns {SingleTireStatus } - the KEY_RIGHT_REAR value
126
+ */
127
+ getRightRear ( ) {
128
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_RIGHT_REAR ) ;
129
+ if ( tireStatus === null ) {
130
+ tireStatus = new SingleTireStatus ( {
131
+ status : 'UNKNOWN' ,
132
+ } ) ;
133
+ this . setParameter ( TireStatus . KEY_RIGHT_REAR , tireStatus ) ;
134
+ console . warn ( 'TireStatus\'s rightRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
135
+ }
136
+ return tireStatus ;
137
+ }
138
+
139
+ /**
140
+ * Set the InnerLeftRear
141
+ * @since SmartDeviceLink 2.0.0
142
+ * @param {SingleTireStatus } rear - The status of the inner left rear. - The desired InnerLeftRear.
143
+ * @returns {TireStatus } - The class instance for method chaining.
144
+ */
145
+ setInnerLeftRear ( rear ) {
146
+ this . _validateType ( SingleTireStatus , rear ) ;
147
+ this . setParameter ( TireStatus . KEY_INNER_LEFT_REAR , rear ) ;
148
+ return this ;
149
+ }
150
+
151
+ /**
152
+ * Get the InnerLeftRear
153
+ * @returns {SingleTireStatus } - the KEY_INNER_LEFT_REAR value
154
+ */
155
+ getInnerLeftRear ( ) {
156
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_INNER_LEFT_REAR ) ;
157
+ if ( tireStatus === null ) {
158
+ tireStatus = new SingleTireStatus ( {
159
+ status : 'UNKNOWN' ,
160
+ } ) ;
161
+ this . setParameter ( TireStatus . KEY_INNER_LEFT_REAR , tireStatus ) ;
162
+ console . warn ( 'TireStatus\'s innerLeftRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
163
+ }
164
+ return tireStatus ;
165
+ }
166
+
167
+ /**
168
+ * Set the InnerRightRear
169
+ * @since SmartDeviceLink 2.0.0
170
+ * @param {SingleTireStatus } rear - The status of the inner right rear. - The desired InnerRightRear.
171
+ * @returns {TireStatus } - The class instance for method chaining.
172
+ */
173
+ setInnerRightRear ( rear ) {
174
+ this . _validateType ( SingleTireStatus , rear ) ;
175
+ this . setParameter ( TireStatus . KEY_INNER_RIGHT_REAR , rear ) ;
176
+ return this ;
177
+ }
178
+
179
+ /**
180
+ * Get the InnerRightRear
181
+ * @returns {SingleTireStatus } - the KEY_INNER_RIGHT_REAR value
182
+ */
183
+ getInnerRightRear ( ) {
184
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_INNER_RIGHT_REAR ) ;
185
+ if ( tireStatus === null ) {
186
+ tireStatus = new SingleTireStatus ( {
187
+ status : 'UNKNOWN' ,
188
+ } ) ;
189
+ this . setParameter ( TireStatus . KEY_INNER_RIGHT_REAR , tireStatus ) ;
190
+ console . warn ( 'TireStatus\'s innerRightRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
191
+ }
192
+ return tireStatus ;
193
+ }
0 commit comments