Skip to content

Commit f371912

Browse files
authored
Merge pull request #512 from smartdevicelink/release/1.5.0_RC
Release/1.5.0
2 parents 44891de + c34b900 commit f371912

File tree

69 files changed

+11643
-5256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+11643
-5256
lines changed

examples/js/hello-sdl/index.html

+27
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,33 @@
126126
.setFilePath(this._filePath));
127127
screenManager.changeLayout(new SDL.rpc.structs.TemplateConfiguration()
128128
.setTemplate(SDL.rpc.enums.PredefinedLayout.NON_MEDIA));
129+
130+
// add menus
131+
const menuListener = new SDL.manager.screen.menu.MenuSelectionListener()
132+
.setOnTriggered(triggerSource => {
133+
console.log(triggerSource);
134+
});
135+
const voice1 = ['Hello Menu One'];
136+
const mainCell1 = new SDL.manager.screen.menu.MenuCell('Hello Menu 1')
137+
.setIcon(new SDL.manager.file.filetypes.SdlArtwork('sdl-logo', SDL.rpc.enums.FileType.GRAPHIC_PNG)
138+
.setFilePath(this._filePath))
139+
.setVoiceCommands(voice1)
140+
.setMenuSelectionListener(menuListener);
141+
142+
// submenu cells
143+
const subCell1 = new SDL.manager.screen.menu.MenuCell('Submenu 1')
144+
.setMenuSelectionListener(menuListener);
145+
146+
const subCell2 = new SDL.manager.screen.menu.MenuCell('Submenu 2')
147+
.setMenuSelectionListener(menuListener);
148+
149+
const mainCell2 = new SDL.manager.screen.menu.MenuCell('Hello Menu 2')
150+
.setSubCells([subCell1, subCell2])
151+
._setCellId(4);
152+
153+
const cellList = [mainCell1, mainCell2];
154+
155+
screenManager.setMenu(cellList);
129156
}
130157

131158
async _onHmiStatusListener (onHmiStatus) {

examples/node/hello-sdl-tcp/index.js

+27
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,33 @@ class AppClient {
121121
.setFilePath(this._filePath));
122122
screenManager.changeLayout(new SDL.rpc.structs.TemplateConfiguration()
123123
.setTemplate(SDL.rpc.enums.PredefinedLayout.NON_MEDIA));
124+
125+
// add menus
126+
const menuListener = new SDL.manager.screen.menu.MenuSelectionListener()
127+
.setOnTriggered(triggerSource => {
128+
console.log(triggerSource);
129+
});
130+
const voice1 = ['Hello Menu One'];
131+
const mainCell1 = new SDL.manager.screen.menu.MenuCell('Hello Menu 1')
132+
.setIcon(new SDL.manager.file.filetypes.SdlArtwork('sdl-logo', SDL.rpc.enums.FileType.GRAPHIC_PNG)
133+
.setFilePath(this._filePath))
134+
.setVoiceCommands(voice1)
135+
.setMenuSelectionListener(menuListener);
136+
137+
// submenu cells
138+
const subCell1 = new SDL.manager.screen.menu.MenuCell('Submenu 1')
139+
.setMenuSelectionListener(menuListener);
140+
141+
const subCell2 = new SDL.manager.screen.menu.MenuCell('Submenu 2')
142+
.setMenuSelectionListener(menuListener);
143+
144+
const mainCell2 = new SDL.manager.screen.menu.MenuCell('Hello Menu 2')
145+
.setSubCells([subCell1, subCell2])
146+
._setCellId(4);
147+
148+
const cellList = [mainCell1, mainCell2];
149+
150+
screenManager.setMenu(cellList);
124151
}
125152

126153
async _onHmiStatusListener (onHmiStatus) {

examples/node/hello-sdl/AppClient.js

+29-1
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,37 @@ class AppClient {
105105
this._isButtonSubscriptionRequested = false;
106106
}
107107

108-
_onConnected () {
108+
async _onConnected () {
109109
this._managersReady = true;
110110
this._checkReadyState();
111+
const screenManager = this._sdlManager.getScreenManager();
112+
113+
// add menus
114+
const menuListener = new SDL.manager.screen.menu.MenuSelectionListener()
115+
.setOnTriggered(triggerSource => {
116+
console.log(triggerSource);
117+
});
118+
const voice1 = ['Hello Menu One'];
119+
const mainCell1 = new SDL.manager.screen.menu.MenuCell('Hello Menu 1')
120+
.setIcon(new SDL.manager.file.filetypes.SdlArtwork('sdl-logo', SDL.rpc.enums.FileType.GRAPHIC_PNG)
121+
.setFilePath(this._filePath))
122+
.setVoiceCommands(voice1)
123+
.setMenuSelectionListener(menuListener);
124+
125+
// submenu cells
126+
const subCell1 = new SDL.manager.screen.menu.MenuCell('Submenu 1')
127+
.setMenuSelectionListener(menuListener);
128+
129+
const subCell2 = new SDL.manager.screen.menu.MenuCell('Submenu 2')
130+
.setMenuSelectionListener(menuListener);
131+
132+
const mainCell2 = new SDL.manager.screen.menu.MenuCell('Hello Menu 2')
133+
.setSubCells([subCell1, subCell2])
134+
._setCellId(4);
135+
136+
const cellList = [mainCell1, mainCell2];
137+
138+
screenManager.setMenu(cellList);
111139
}
112140

113141
_onHmiStatusListener (onHmiStatus) {

examples/webengine/hello-sdl/index.html

+27
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,33 @@
131131
.setFilePath(sdlManifest.appIcon));
132132
screenManager.changeLayout(new SDL.rpc.structs.TemplateConfiguration()
133133
.setTemplate(SDL.rpc.enums.PredefinedLayout.NON_MEDIA));
134+
135+
// add menus
136+
const menuListener = new SDL.manager.screen.menu.MenuSelectionListener()
137+
.setOnTriggered(triggerSource => {
138+
console.log(triggerSource);
139+
});
140+
const voice1 = ['Hello Menu One'];
141+
const mainCell1 = new SDL.manager.screen.menu.MenuCell('Hello Menu 1')
142+
.setIcon(new SDL.manager.file.filetypes.SdlArtwork('sdl-logo', SDL.rpc.enums.FileType.GRAPHIC_PNG)
143+
.setFilePath(sdlManifest.appIcon))
144+
.setVoiceCommands(voice1)
145+
.setMenuSelectionListener(menuListener);
146+
147+
// submenu cells
148+
const subCell1 = new SDL.manager.screen.menu.MenuCell('Submenu 1')
149+
.setMenuSelectionListener(menuListener);
150+
151+
const subCell2 = new SDL.manager.screen.menu.MenuCell('Submenu 2')
152+
.setMenuSelectionListener(menuListener);
153+
154+
const mainCell2 = new SDL.manager.screen.menu.MenuCell('Hello Menu 2')
155+
.setSubCells([subCell1, subCell2])
156+
._setCellId(4);
157+
158+
const cellList = [mainCell1, mainCell2];
159+
160+
screenManager.setMenu(cellList);
134161
}
135162

136163
async _onSystemCapabilityUpdatedRpcListener (capabilityMessage) {

generator/mapping.json

+24
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,30 @@
7171
},
7272
"TemplateConfiguration": {
7373
"script": "templates/scripts/TemplateConfiguration.js"
74+
},
75+
"TireStatus": {
76+
"script": "templates/scripts/TireStatus.js",
77+
"pressureTelltale": {
78+
"-methods": {}
79+
},
80+
"leftFront": {
81+
"-methods": {}
82+
},
83+
"rightFront": {
84+
"-methods": {}
85+
},
86+
"leftRear": {
87+
"-methods": {}
88+
},
89+
"rightRear": {
90+
"-methods": {}
91+
},
92+
"innerLeftRear": {
93+
"-methods": {}
94+
},
95+
"innerRightRear": {
96+
"-methods": {}
97+
}
7498
}
7599
},
76100
"functions": {
+193
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
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

Comments
 (0)