diff options
Diffstat (limited to 'src/components/HMI')
40 files changed, 1230 insertions, 361 deletions
diff --git a/src/components/HMI/app/AppViews.js b/src/components/HMI/app/AppViews.js index 19f1b4879a..ec31c13399 100644 --- a/src/components/HMI/app/AppViews.js +++ b/src/components/HMI/app/AppViews.js @@ -37,9 +37,15 @@ SDL.AppViews = Em.ContainerView.extend( { elementId: 'app',
childViews: [
+ SDL.HomeView,
SDL.MediaView,
+ SDL.NavigationAppView,
SDL.InfoView,
+ SDL.PhoneView,
+ SDL.ClimateView,
+ SDL.NavigationView,
SDL.ControlButtons,
+ SDL.SettingsView,
SDL.TurnByTurnView,
SDL.TBTTurnList,
SDL.OptionsView,
@@ -48,7 +54,12 @@ SDL.AppViews = Em.ContainerView.extend( { SDL.VRHelpListView,
SDL.ScrollableMessage,
SDL.SliderView,
+ SDL.StatusClimateView,
+ SDL.StatusMediaView,
+ SDL.StatusNavigationView,
SDL.StatusInfoView,
+ SDL.StatusPhoneView,
+ SDL.TopControls,
SDL.BottomControls,
SDL.TTSPopUp,
SDL.AlertPopUp,
diff --git a/src/components/HMI/app/SDLApp.js b/src/components/HMI/app/SDLApp.js index c1f40ad588..bbe4644008 100644 --- a/src/components/HMI/app/SDLApp.js +++ b/src/components/HMI/app/SDLApp.js @@ -48,7 +48,7 @@ SDL = Em.Application.create( { helpMode: false,
// determine home view {string}
- homeView: 'info_view',
+ homeView: 'home',
/** Set language for localization */
localization: 'eng',
@@ -77,4 +77,4 @@ SDL = Em.Application.create( { /** container for all views */
SDL.views = SDL.AppViews.create().appendTo('body');
}
-});
+});
\ No newline at end of file diff --git a/src/components/HMI/app/controller/SettingsController.js b/src/components/HMI/app/controller/SettingsController.js index a9a5d1a004..d40d5827d9 100644 --- a/src/components/HMI/app/controller/SettingsController.js +++ b/src/components/HMI/app/controller/SettingsController.js @@ -206,9 +206,13 @@ SDL.SettingsController = Em.Object.create( { * @param {Object} message
*
*/
- permissionsFriendlyMessageUpdate: function(message, appID) {
+ permissionsFriendlyMessageUpdate: function(message) {
+
+
+ SDL.SettingsController.simpleParseUserFriendlyMessageData(message);
SDL.States.goToStates('settings.policies.appPermissions');
+
},
updateSDL: function() {
@@ -221,34 +225,23 @@ SDL.SettingsController = Em.Object.create( { AllowSDLFunctionality: function(messages) {
- var str = '';
-
- if (messages[0].line1) {
- str += messages[0].line1;
- }
-
- if (messages[0].line2) {
- str += messages[0].line2;
- }
-
- if (messages[0].textBody) {
- str += messages[0].textBody;
- }
-
- if (str) {
- SDL.PopUp.create().appendTo('body').popupActivate(messages[0].textBody, SDL.SettingsController.OnAllowSDLFunctionality);
+ if (messages.length > 0) {
+ SDL.SettingsController.simpleParseUserFriendlyMessageData(messages, SDL.SettingsController.OnAllowSDLFunctionality);
} else {
- SDL.PopUp.create().appendTo('body').popupActivate('WARNING!!!!!!!!!!!!!! There is no text from SDL in GetUserFriendlyMessage for DataConsent parameter!!! Please allow the device...', SDL.SettingsController.OnAllowSDLFunctionality);
+ SDL.PopUp.create().appendTo('body').popupActivate(
+ 'WARNING!!!!!!!!!!!!!! '
+ + 'There is no text from SDL in GetUserFriendlyMessage for DataConsent parameter!!! Please allow the device...',
+ SDL.SettingsController.OnAllowSDLFunctionality);
}
},
userFriendlyMessagePopUp: function(appId, messageCode) {
- FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.PopUp.create().appendTo('body').popupActivate(message)}, appId, messageCode);
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appId, messageCode);
},
- simpleParseUserFriendlyMessageData: function (messages) {
+ simpleParseUserFriendlyMessageData: function (messages, func) {
var tts = "",
text = "";
@@ -273,7 +266,7 @@ SDL.SettingsController = Em.Object.create( { if (text) {
- SDL.PopUp.create().appendTo('body').popupActivate(text);
+ SDL.PopUp.create().appendTo('body').popupActivate(text, func);
}
},
diff --git a/src/components/HMI/app/controller/sdl/AppController.js b/src/components/HMI/app/controller/sdl/AppController.js index 784e7e8d1c..9e0101dd03 100644 --- a/src/components/HMI/app/controller/sdl/AppController.js +++ b/src/components/HMI/app/controller/sdl/AppController.js @@ -144,6 +144,9 @@ SDL.SDLAppController = Em.Object.create({ */ onVRCommand: function (element) { + if (SDL.SDLModel.VRActive) { + SDL.SDLModel.toggleProperty('VRActive'); + } FFW.VR.onCommand(element.commandID, element.appID); }, diff --git a/src/components/HMI/app/controller/sdl/Controller.js b/src/components/HMI/app/controller/sdl/Controller.js index 76fbb7e059..e33656ecf4 100644 --- a/src/components/HMI/app/controller/sdl/Controller.js +++ b/src/components/HMI/app/controller/sdl/Controller.js @@ -55,7 +55,7 @@ SDL.SDLController = Em.Object */ sysContext: function() { - if (SDL.VRPopUp.VRActive) { + if (SDL.SDLModel.VRActive) { return 'VRSESSION'; } if (SDL.AlertPopUp.active) { @@ -78,7 +78,7 @@ SDL.SDLController = Em.Object }.property('SDL.OptionsView.active', 'SDL.SliderView.active', 'SDL.SDLModel.AudioPassThruState', - 'SDL.VRPopUp.VRActive', + 'SDL.SDLModel.VRActive', 'SDL.AlertPopUp.active', 'SDL.States.info.nonMedia.active', 'SDL.States.media.sdlmedia.active', @@ -200,6 +200,8 @@ SDL.SDLController = Em.Object SDL.VRHelpListView.deactivate(); } } + } else if (SDL.VRHelpListView.active) { + SDL.VRHelpListView.deactivate(); } }.observes('SDL.SDLModel.VRActive', 'SDL.SDLModel.interactionData.vrHelp'), @@ -287,7 +289,15 @@ SDL.SDLController = Em.Object */ activateVRPopUp: function() { + if (FFW.TTS.requestId) { + FFW.TTS.aborted = true; + SDL.TTSPopUp.DeactivateTTS(); + } + if (SDL.AlertPopUp.active) { + SDL.AlertPopUp.deactivate('ABORTED'); + } SDL.SDLModel.toggleProperty('VRActive'); + }, /** * Action for SoftButtons that closes popUp or window and opens @@ -414,6 +424,15 @@ SDL.SDLController = Em.Object FFW.BasicCommunication.ExitAllApplications(state); }, /** + * OnAwakeSDL from HMI returns SDL to normal operation + * after OnExitAllApplications(SUSPEND) + * + */ + onAwakeSDLNotificationSend: function() { + FFW.BasicCommunication.OnAwakeSDL(); + }, + + /** * Method to sent notification with selected reason of OnSystemRequest * * @param {String} @@ -458,6 +477,8 @@ SDL.SDLController = Em.Object if (choiceID && SDL.TTSPopUp.active && FFW.TTS.requestId == null) { SDL.TTSPopUp.DeactivateTTS(); } + + SDL.SDLModel.interactionData.helpPrompt = null; }, /** * Method to sent notification for Alert @@ -582,13 +603,28 @@ SDL.SDLController = Em.Object */ registerApplication: function(params, applicationType) { - SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[applicationType].create( { - appID: params.appID, - appName: params.appName, - deviceName: params.deviceName, - appType: params.appType - })); -/*Uncomment to show useless add command buttons + if (applicationType === undefined || applicationType === null) { + + SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[0].create( { //Magic number 0 - Default media model for not initialized applications + appID: params.appID, + appName: params.appName, + deviceName: params.deviceName, + isMedia: 0, + disabledToActivate: params.disabled ? true : false + })); + } else { + + SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[applicationType].create( { + appID: params.appID, + appName: params.appName, + deviceName: params.deviceName, + appType: params.appType, + isMedia: applicationType == 0 ? true : false, + initialized: true, + disabledToActivate: params.disabled ? true : false + })); + } + var exitCommand = { "id": -10, "params": { @@ -601,7 +637,7 @@ SDL.SDLController = Em.Object } }; - SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand); + SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand); exitCommand = { "id": -10, @@ -616,7 +652,6 @@ SDL.SDLController = Em.Object }; SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand); -*/ }, /** * Unregister application @@ -641,6 +676,10 @@ SDL.SDLController = Em.Object if (SDL.SDLModel.stateLimited == appID) { SDL.SDLModel.set('stateLimited', null); } + + if (SDL.VRHelpListView.active) { + this.showVRHelpItems(); + } }, /** * SDL Driver Distraction ON/OFF switcher @@ -735,6 +774,9 @@ SDL.SDLController = Em.Object */ onActivateSDLApp: function(element) { + if (SDL.SDLModel.VRActive) { + SDL.SDLModel.toggleProperty('VRActive'); + } FFW.BasicCommunication.ActivateApp(element.appID); }, /** @@ -834,6 +876,16 @@ SDL.SDLController = Em.Object } }, /** + * Method to send OnEmergencyEvent to SDL + * + * @param {String} + */ + OnEmergencyEventNotificationSend: function(element) { + + FFW.BasicCommunication.OnEmergencyEvent(element.enabled); + element.set('enabled', !element.enabled); + }, + /** * Method sent softButtons pressed and event status to RPC * * @param {String} @@ -859,21 +911,23 @@ SDL.SDLController = Em.Object if ((appID && SDL.SDLController.getApplicationModel(appID) != SDL.SDLAppController.model) || this.backgroundAlertAppID){ - if (SDL.SDLAppController.model - && SDL.SDLAppController.model.appID != appID - && this.backgroundAlertAppID == null) { + if (SDL.SDLAppController.model == null + || (SDL.SDLAppController.model.appID != appID + && this.backgroundAlertAppID == null)) { this.backgroundAlertAppID = appID; FFW.UI.OnSystemContext(sysContextValue, appID); - FFW.UI.OnSystemContext('HMI_OBSCURED', SDL.SDLAppController.model.appID); + if (SDL.SDLAppController.model) { + FFW.UI.OnSystemContext('HMI_OBSCURED', SDL.SDLAppController.model.appID); + } - } else if (SDL.SDLAppController.model + } else if (SDL.SDLAppController.model != null && SDL.SDLAppController.model.appID != appID && this.backgroundAlertAppID != null && SDL.SDLAppController.model.appID != this.backgroundAlertAppID) { FFW.UI.OnSystemContext('MAIN', this.backgroundAlertAppID); - FFW.UI.OnSystemContext(sysContextValue, SDL.SDLAppController.model.appID); + FFW.UI.OnSystemContext(sysContextValue, appID); } } else { if (SDL.SDLAppController.model) { diff --git a/src/components/HMI/app/controller/sdl/RPCController.js b/src/components/HMI/app/controller/sdl/RPCController.js index d7ab4b2d01..27dd2ec087 100644 --- a/src/components/HMI/app/controller/sdl/RPCController.js +++ b/src/components/HMI/app/controller/sdl/RPCController.js @@ -72,41 +72,21 @@ SDL.RPCController = Em.Object capabilitiesCheck: function(key, value) { if (key == "imageType" && value == "STATIC") { - SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE'; + SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value}; } if (key == "type" && value == "PRE_RECORDED") { - SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE'; + SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value}; } if (key == "type" && value == "SAPI_PHONEMES") { - SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE'; + SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value}; } if (key == "type" && value == "LHPLUS_PHONEMES") { - SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE'; + SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value}; } if (key == "type" && value == "SILENCE") { - SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE'; + SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value}; } - }, - - /** - * Method to check supported image type in request - * - * @param {Object} - * array - */ - checkImagesArray: function(array) { - - var error = false; - if (array instanceof Array) { - for ( var i = 0; i < array.length; i++) { - if (array[i].image && - ((array[i].image.imageType !== "DYNAMIC") && - (array[i].image.imageType !== "STATIC"))) { - - } - } - } - return error; + return value; }, /** @@ -1093,17 +1073,6 @@ SDL.RPCController = Em.Object return this.resultStruct; } - if ("softButtons" in params) { - if (SDL.RPCController - .checkImagesArray(params.softButtons)) { - this.resultStruct = { - "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"], - "resultMessage": "Unsupported image type!" - }; - - return this.resultStruct; - } - } if ("turnIcon" in params && ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) { this.resultStruct = { @@ -1183,17 +1152,6 @@ SDL.RPCController = Em.Object return this.resultStruct; } - if ("softButtons" in params) { - if (SDL.RPCController - .checkImagesArray(params.softButtons)) { - this.resultStruct = { - "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"], - "resultMessage": "Unsupported image type!" - }; - - return this.resultStruct; - } - } if ("turnList" in params) { for ( var i = 0; i < params.turnList.length; i++) { @@ -1277,17 +1235,6 @@ SDL.RPCController = Em.Object return this.resultStruct; } - if ("softButtons" in params) { - if (SDL.RPCController - .checkImagesArray(params.softButtons)) { - this.resultStruct = { - "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"], - "resultMessage": "Unsupported image type!" - }; - - return this.resultStruct; - } - } if (params.alertStrings == null) { this.resultStruct = { @@ -1422,17 +1369,6 @@ SDL.RPCController = Em.Object return this.resultStruct; } - if ("softButtons" in params) { - if (SDL.RPCController - .checkImagesArray(params.softButtons)) { - this.resultStruct = { - "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"], - "resultMessage": "Unsupported image type!" - }; - - return this.resultStruct; - } - } if ("graphic" in params && ((params.graphic.imageType !== "DYNAMIC") && (params.graphic.imageType !== "STATIC"))) { this.resultStruct = { @@ -1934,16 +1870,6 @@ SDL.RPCController = Em.Object return this.resultStruct; } - if ("vrHelp" in params) { - if (SDL.RPCController.checkImagesArray(params.vrHelp)) { - this.resultStruct = { - "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"], - "resultMessage": "Unsupported image type!" - }; - - return this.resultStruct; - } - } if (params.appID == null) { this.resultStruct = { @@ -2278,17 +2204,6 @@ SDL.RPCController = Em.Object return this.resultStruct; } - if ("softButtons" in params) { - if (SDL.RPCController - .checkImagesArray(params.softButtons)) { - this.resultStruct = { - "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"], - "resultMessage": "Unsupported image type!" - }; - - return this.resultStruct; - } - } if (params.messageText == null) { this.resultStruct = { @@ -2434,17 +2349,6 @@ SDL.RPCController = Em.Object ShowVrHelp: function(params) { if (params) { - if ("vrHelp" in params) { - if (SDL.RPCController - .checkImagesArray(params.vrHelp)) { - this.resultStruct = { - "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"], - "resultMessage": "Unsupported image type!" - }; - - return this.resultStruct; - } - } if ("appID" in params) { if (typeof params.appID != 'number') { diff --git a/src/components/HMI/app/model/media/CDModel.js b/src/components/HMI/app/model/media/CDModel.js index 43836cb6dc..9ded512c5d 100644 --- a/src/components/HMI/app/model/media/CDModel.js +++ b/src/components/HMI/app/model/media/CDModel.js @@ -40,4 +40,4 @@ SDL.CDModel = Em.Object.create( { this.set('active', true);
}
-});
+});
\ No newline at end of file diff --git a/src/components/HMI/app/model/sdl/AppModel.js b/src/components/HMI/app/model/sdl/AppModel.js index 6f93e2d668..682eee592b 100644 --- a/src/components/HMI/app/model/sdl/AppModel.js +++ b/src/components/HMI/app/model/sdl/AppModel.js @@ -62,6 +62,37 @@ SDL.SDLAppModel = Em.Object.extend({ appName: '', /** + * Flag to define if application was initialized (registered) correctly + * Has correct application type + * + * @type {Boolean} + */ + initialized: false, + + /** + * Media application flag + * If application was successfully initialized this flag it set into correct value + * + * @type {Boolean} + */ + isMedia: null, + + /** + * Flag to determine if app in application list can not be activated from HMI + * + * @type {Boolean} + */ + disabledToActivate: false, + + /** + * Application type + * If application was successfully initialized this parameter it set into correct value + * + * @type {String} + */ + appType: "", + + /** * Navigation streaming url */ navigationStream: null, diff --git a/src/components/HMI/app/model/sdl/MediaModel.js b/src/components/HMI/app/model/sdl/MediaModel.js index fa8d8e2a83..0feceb2119 100644 --- a/src/components/HMI/app/model/sdl/MediaModel.js +++ b/src/components/HMI/app/model/sdl/MediaModel.js @@ -333,13 +333,15 @@ SDL.SDLMediaModel = SDL.SDLAppModel.extend({ } } else { - //this.appInfo.set('alignment', "text-align:center"); + this.appInfo.set('alignment', "text-align:center"); } - if (params.graphic && params.graphic.value != '') { - this.appInfo.set('trackIcon', params.graphic.value); - } else { - this.appInfo.set('trackIcon', 'images/sdl/audio_icon.jpg'); + if (params.graphic != null) { + if (params.graphic.value != "") { + this.appInfo.set('trackIcon', params.graphic.value); + } else { + this.appInfo.set('trackIcon', 'images/sdl/audio_icon.jpg'); + } } if ("softButtons" in params) { diff --git a/src/components/HMI/app/model/sdl/Model.js b/src/components/HMI/app/model/sdl/Model.js index a902e649ec..d47ecf023b 100644 --- a/src/components/HMI/app/model/sdl/Model.js +++ b/src/components/HMI/app/model/sdl/Model.js @@ -593,7 +593,7 @@ SDL.SDLModel = Em.Object.create({ messageCodes.push("AppPermissionsRevoked"); - FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.SettingsController.simpleParseUserFriendlyMessageData(message)}, appID, messageCodes); + FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appID, messageCodes); }, @@ -826,10 +826,33 @@ SDL.SDLModel = Em.Object.create({ * * @param {Object} */ - startStream: function(params) { + startStream: function(request) { + + var text = "Would you like to start Video stream?"; + + SDL.PopUp.create().appendTo('body').popupActivate(text, function(result){ + if (result) { + + SDL.SDLController.getApplicationModel(request.params.appID).set('navigationStream', request.params.url); + SDL.SDLModel.playVideo(request.params.appID); + + FFW.Navigation.sendNavigationResult( + SDL.SDLModel.resultCode["SUCCESS"], + request.id, + request.method + ); + + } else if (result === false) { + + FFW.Navigation.sendError( + SDL.SDLModel.resultCode["REJECTED"], + request.id, + request.method, + "Ignored by USER!" + ); + } + }); - SDL.SDLController.getApplicationModel(params.appID).set('navigationStream', params.url); - SDL.SDLModel.playVideo(params.appID); }, /** @@ -866,8 +889,30 @@ SDL.SDLModel = Em.Object.create({ */ startAudioStream: function(params) { - SDL.SDLController.getApplicationModel(params.appID).set('navigationAudioStream', params.url); - SDL.StreamAudio.play(params.url); + var text = "Would you like to start Audio stream?"; + + SDL.PopUp.create().appendTo('body').popupActivate(text, function(result){ + if (result) { + + SDL.SDLController.getApplicationModel(params.appID).set('navigationAudioStream', params.url); + SDL.StreamAudio.play(params.url); + + FFW.Navigation.sendNavigationResult( + SDL.SDLModel.resultCode["SUCCESS"], + request.id, + request.method + ); + + } else if (result === false) { + + FFW.Navigation.sendError( + SDL.SDLModel.resultCode["REJECTED"], + request.id, + request.method, + "Ignored by USER!" + ); + } + }); }, /** @@ -947,11 +992,17 @@ SDL.SDLModel = Em.Object.create({ * * @type {String} lang */ - changeRegistrationUI: function (lang, appID) { + changeRegistrationUI: function (lang, appID, appName) { if (SDL.SDLController.getApplicationModel(appID)) { SDL.SDLController.getApplicationModel(appID).set('UILanguage', lang); } + + if (appName) { + SDL.SDLMediaController.currentAppId = 0; + SDL.SDLController.getApplicationModel(appID).appName = appName; + SDL.SDLMediaController.set('currentAppId', appID); + } }, /** @@ -975,31 +1026,55 @@ SDL.SDLModel = Em.Object.create({ */ onAppRegistered: function (params) { - var applicationType = 1; + var applicationType = null,//Default value - NonMediaModel see SDL.SDLController.applicationModels + app = SDL.SDLController.getApplicationModel(params.appID); + + if (app != undefined && app.initialized == false) { - if (SDL.SDLController.getApplicationModel(params.application.appID)) { + if (app.isMedia != params.isMediaApplication) { // If current not initialized model doe not matches the registered application type + this.convertModel(params); // then model should be changed + } else { + app.disabledToActivate = params.disabled; + } return; + } else if (app != undefined && app.initialized == true) { + console.error("Application with appID " + params.appID + " already registered!"); + return; // if application already registered and correctly initialized and BC.UpdateAppList came from SDL than nothing shoul happend } if (params.vrSynonyms) { - var message = {"cmdID": 0, "vrCommands": params.vrSynonyms, "appID": params.application.appID, "type": "Application"}; + var message = {"cmdID": 0, "vrCommands": params.vrSynonyms, "appID": params.appID, "type": "Application"}; this.addCommandVR(message); } - if (params.application.isMediaApplication) { + if (params.isMediaApplication === true) { + applicationType = 0; + } else if (params.isMediaApplication === false) { + + applicationType = 1; } - SDL.SDLController.registerApplication(params.application, applicationType); + SDL.SDLController.registerApplication(params, applicationType); - if (SDL.SDLModel.unRegisteredApps.indexOf(params.application.appID) >= 0) { - setTimeout(function(){ SDL.PopUp.create().appendTo('body').popupActivate("Connection with " + params.application.appName + " is re-established.")}, 1000); - this.unRegisteredApps.pop(params.application.appID); + if (SDL.SDLModel.unRegisteredApps.indexOf(params.appID) >= 0) { + setTimeout(function(){ SDL.PopUp.create().appendTo('body').popupActivate("Connection with " + params.appName + " is re-established.")}, 1000); + this.unRegisteredApps.pop(params.appID); } }, /** + * Method to convert existed model to registered type + */ + convertModel: function(params) { + + SDL.SDLModel.get('registeredApps').removeObjects(SDL.SDLModel.get('registeredApps').filterProperty('appID', params.appID)); + + this.onAppRegistered(params); + }, + + /** * Method to delete activation button from VR commands and delete device * parameters from model * @@ -1224,7 +1299,6 @@ SDL.SDLModel = Em.Object.create({ setTimeout(function(){ if (SDL.SDLModel.vrActiveRequests.vrPerformInteraction) { SDL.SDLModel.onPrompt(message.params.timeoutPrompt); - SDL.SDLModel.interactionData.helpPrompt = null; } }, message.params.timeout - 2000); //Magic numer is a platform depended HMI behavior: -2 seconds for timeout prompt diff --git a/src/components/HMI/app/model/sdl/NonMediaModel.js b/src/components/HMI/app/model/sdl/NonMediaModel.js index d9a14b32f2..42ac14bc0c 100644 --- a/src/components/HMI/app/model/sdl/NonMediaModel.js +++ b/src/components/HMI/app/model/sdl/NonMediaModel.js @@ -198,10 +198,12 @@ SDL.SDLNonMediaModel = SDL.SDLAppModel.extend({ this.appInfo.set('alignment', "text-align:center"); } - if (params.graphic) { - this.appInfo.set('mainImage', params.graphic.value); - } else { - this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg'); + if (params.graphic != null) { + if (params.graphic.value != "") { + this.appInfo.set('mainImage', params.graphic.value); + } else { + this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg'); + } } // Magic number is a count of Preset Buttons on HMI = 8 diff --git a/src/components/HMI/app/model/sdl/VehicleInfoModel.js b/src/components/HMI/app/model/sdl/VehicleInfoModel.js index f2b896190e..f9fe33d97c 100644 --- a/src/components/HMI/app/model/sdl/VehicleInfoModel.js +++ b/src/components/HMI/app/model/sdl/VehicleInfoModel.js @@ -132,10 +132,10 @@ SDL.SDLVehicleInfoModel = Em.Object 'width': 800, 'height': 480 }, - 'speed': 80.0, - 'fuelLevel': 0.2, + 'speed': 80.08E0, + 'fuelLevel': 0.2E0, 'fuelLevel_State': "UNKNOWN", - 'instantFuelConsumption': 2.2, + 'instantFuelConsumption': 2.2E0, 'tirePressure': { 'pressureTelltale': 'OFF', 'leftFront': { @@ -203,9 +203,9 @@ SDL.SDLVehicleInfoModel = Em.Object "highBeamsOn": false, "ambientLightSensorStatus": "NIGHT" }, - 'engineTorque': 2.5, - 'accPedalPosition': 10.5, - 'steeringWheelAngle': 1.2, + 'engineTorque': 2.5E0, + 'accPedalPosition': 10.5E0, + 'steeringWheelAngle': 1.2E0, 'myKey': { "e911Override": "NO_DATA_EXISTS" }, @@ -222,8 +222,8 @@ SDL.SDLVehicleInfoModel = Em.Object 'satRadioESN': "165165650", 'rainSensor': 165165650, 'gps': { - 'longitudeDegrees': 42, - 'latitudeDegrees': -83, + 'longitudeDegrees': 42.5E0, + 'latitudeDegrees': -83.3E0, 'utcYear': 2013, 'utcMonth': 2, 'utcDay': 14, @@ -231,15 +231,15 @@ SDL.SDLVehicleInfoModel = Em.Object 'utcMinutes': 16, 'utcSeconds': 54, 'compassDirection': 'SOUTHWEST', - 'pdop': 8, - 'hdop': 5, - 'vdop': 3, + 'pdop': 8.4E0, + 'hdop': 5.9E0, + 'vdop': 3.2E0, 'actual': false, 'satellites': 8, 'dimension': '2D', - 'altitude': 7, - 'heading': 173, - 'speed': 2 + 'altitude': 7.7E0, + 'heading': 173.99E0, + 'speed': 2.78E0 }, 'eCallInfo': { 'eCallNotificationStatus': 'NORMAL', diff --git a/src/components/HMI/app/view/WarningView.js b/src/components/HMI/app/view/WarningView.js index 1db0b6f6c0..8fa40b4547 100644 --- a/src/components/HMI/app/view/WarningView.js +++ b/src/components/HMI/app/view/WarningView.js @@ -88,7 +88,11 @@ SDL.warningView = Em.ContainerView appLoaded: function() {
var self = this;
- self.set('isReady', true);
+ /** Show OK Button after 2 second delay */
+ setTimeout(function() {
+
+ self.set('isReady', true);
+ }, 2000);
var components = Em.ContainerView.create({
@@ -317,8 +321,15 @@ SDL.warningView = Em.ContainerView var self = this;
- self._parentView.set('hide', true);
+ this._parentView.set('fade', this
+ .checkForCCS3AnimationSupport());
+
+ setTimeout(function() {
+
+ self._parentView.set('hide', true);
+ }, 1000);
+
SDL.RPCController.ConnectToSDL();
}
})
- });
+ });
\ No newline at end of file diff --git a/src/components/HMI/app/view/home/controlButtons.js b/src/components/HMI/app/view/home/controlButtons.js index cb3ff44ed5..3b32d47368 100644 --- a/src/components/HMI/app/view/home/controlButtons.js +++ b/src/components/HMI/app/view/home/controlButtons.js @@ -52,7 +52,8 @@ SDL.ControlButtons = Em.ContainerView 'appUILanguagesLabel', 'appTTSVRLanguagesLabel', 'appUILang', - 'appTTSVRLang' + 'appTTSVRLang', + 'phoneCall' ], /** @@ -575,4 +576,4 @@ SDL.ControlButtons = Em.ContainerView templateName: 'text' }) }) - }); + });
\ No newline at end of file diff --git a/src/components/HMI/app/view/home/statusMediaView.js b/src/components/HMI/app/view/home/statusMediaView.js index 4996b4ce1d..bc94c9e22f 100644 --- a/src/components/HMI/app/view/home/statusMediaView.js +++ b/src/components/HMI/app/view/home/statusMediaView.js @@ -96,4 +96,4 @@ SDL.StatusMediaView = Em.ContainerView SDL.States.goToStates(SDL.MediaController.activeState);
}
}
- });
+ });
\ No newline at end of file diff --git a/src/components/HMI/app/view/info/appsView.js b/src/components/HMI/app/view/info/appsView.js index c1d123c0b2..1e0b7dc9ff 100644 --- a/src/components/HMI/app/view/info/appsView.js +++ b/src/components/HMI/app/view/info/appsView.js @@ -73,7 +73,8 @@ SDL.InfoAppsView = Em.ContainerView appID: apps[i].appID,
classNames: 'list-item button',
iconBinding: 'SDL.SDLModel.registeredApps.' + appIndex
- + '.appIcon'
+ + '.appIcon',
+ disabled: apps[i].disabledToActivate
}));
}
diff --git a/src/components/HMI/app/view/infoView.js b/src/components/HMI/app/view/infoView.js index 8740bf455b..397553d9fa 100644 --- a/src/components/HMI/app/view/infoView.js +++ b/src/components/HMI/app/view/infoView.js @@ -47,9 +47,13 @@ SDL.InfoView = Em.ContainerView.create( { /** Settings components */
childViews:
[
+ 'leftMenu',
+ SDL.InfoServicesView,
+ SDL.InfoTravelLinkView,
+ SDL.InfoCalendarView,
SDL.InfoAppsView,
- SDL.DeviceListView,
- SDL.InfoNonMedia
+ SDL.InfoNonMedia,
+ SDL.DeviceListView
],
/** Left menu */
@@ -78,8 +82,12 @@ SDL.InfoView = Em.ContainerView.create( { childViews:
[
+ 'servicesButton',
+ 'travelLinkButton',
+ 'calendarButton',
'appsButton',
- 'sdlButton'
+ 'sdlButton',
+ 'goToCD'
],
servicesButton: SDL.Button.extend( {
@@ -179,4 +187,4 @@ SDL.InfoView = Em.ContainerView.create( { } )
} )
} )
-} );
+} );
\ No newline at end of file diff --git a/src/components/HMI/app/view/media/common/LeftMenuView.js b/src/components/HMI/app/view/media/common/LeftMenuView.js index ce44d8a85b..ba4495681f 100644 --- a/src/components/HMI/app/view/media/common/LeftMenuView.js +++ b/src/components/HMI/app/view/media/common/LeftMenuView.js @@ -40,6 +40,7 @@ SDL.LeftMenuView = Em.ContainerView.extend( { childViews:
[
'border',
+ 'cdButton',
'sdlButton'
],
/** Border decoration */
diff --git a/src/components/HMI/app/view/media/sdl/controllsView.js b/src/components/HMI/app/view/media/sdl/controllsView.js index b7b8f59d7f..8e73f0ba0e 100644 --- a/src/components/HMI/app/view/media/sdl/controllsView.js +++ b/src/components/HMI/app/view/media/sdl/controllsView.js @@ -38,7 +38,7 @@ SDL.SDLMediaControlls = Em.ContainerView.create( { [ 'info', 'Controls', - 'tuneButtons' // Uncomment to see preset buttons on sdl screen + 'tuneButtons' ], /** @@ -235,4 +235,4 @@ SDL.SDLMediaControlls = Em.ContainerView.create( { } ) } ) } ) -} ); +} );
\ No newline at end of file diff --git a/src/components/HMI/app/view/media/sdlmediaView.js b/src/components/HMI/app/view/media/sdlmediaView.js index a880de8a3f..78371e7ea7 100644 --- a/src/components/HMI/app/view/media/sdlmediaView.js +++ b/src/components/HMI/app/view/media/sdlmediaView.js @@ -98,7 +98,7 @@ SDL.sdlView = Em.ContainerView ], optionsButton: SDL.Button.extend( { - text: 'Menu', + text: 'Options', templateName: 'arrow', @@ -107,4 +107,4 @@ SDL.sdlView = Em.ContainerView }) }) }) - }); + });
\ No newline at end of file diff --git a/src/components/HMI/app/view/mediaView.js b/src/components/HMI/app/view/mediaView.js index c647f999f4..647b593065 100644 --- a/src/components/HMI/app/view/mediaView.js +++ b/src/components/HMI/app/view/mediaView.js @@ -46,4 +46,4 @@ SDL.MediaView = Em.ContainerView.create( { ],
/** Left Menu view component */
leftMenu: SDL.LeftMenuView
-} );
+} );
\ No newline at end of file diff --git a/src/components/HMI/app/view/sdl/AlertPopUp.js b/src/components/HMI/app/view/sdl/AlertPopUp.js index 20ba5c4fb1..0589da3649 100644 --- a/src/components/HMI/app/view/sdl/AlertPopUp.js +++ b/src/components/HMI/app/view/sdl/AlertPopUp.js @@ -140,7 +140,7 @@ SDL.AlertPopUp = Em.ContainerView.create({ this.set('content2', ''); this.set('content3', ''); - if (reason == 'timeout' && this.softbuttons.buttons._childViews.length > 0) { + if (reason == 'timeout' && this.softbuttons.buttons._childViews.length > 0 && reason === 'ABORTED') { SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['ABORTED'], this.alertRequestId); } else { SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['SUCCESS'], this.alertRequestId); diff --git a/src/components/HMI/app/view/sdl/ExitAppView.js b/src/components/HMI/app/view/sdl/ExitAppView.js index 4f423f06af..81e9c7ad5f 100644 --- a/src/components/HMI/app/view/sdl/ExitAppView.js +++ b/src/components/HMI/app/view/sdl/ExitAppView.js @@ -47,7 +47,9 @@ SDL.ExitApp = Em.ContainerView.create( { [ 'exitAppViewLabel', 'exitAppViewTitle', - 'exitAppViewSelect' + 'exitAppViewSelect', + 'onAwakeSDLLabel', + 'onAwakeSDLButton' ], /** @@ -104,6 +106,24 @@ SDL.ExitApp = Em.ContainerView.create( { } } ), + onAwakeSDLLabel: SDL.Label.extend( { + + elementId: 'onAwakeSDLLabel', + + classNames: 'onAwakeSDLLabel', + + content: 'onAwakeSDL notification send' + } ), + + onAwakeSDLButton: SDL.Button.extend( { + classNames: 'button onAwakeSDLButton', + text: 'Send onAwakeSDL', + action: 'onAwakeSDLNotificationSend', + target: 'SDL.SDLController', + buttonAction: true, + onDown: false + }), + /** * Trigger function that activates and deactivates tbtClientStateView */ diff --git a/src/components/HMI/app/view/sdl/PopUp.js b/src/components/HMI/app/view/sdl/PopUp.js index b4b429df23..6da36feb4f 100644 --- a/src/components/HMI/app/view/sdl/PopUp.js +++ b/src/components/HMI/app/view/sdl/PopUp.js @@ -114,16 +114,31 @@ SDL.PopUp = Em.ContainerView.extend({ } this.set('callback', null); + this.set('content', ''); this.remove(); }, - popupActivate: function(message, callback) { + /** + * HMI modal window popUp Activation method + * @param textBody - main text to be displayes on PopUp + * @param callback - Callback function handled result parameter made by user action, if null - popUp will be closed by timer + * @param indicator - popUp will not be closed by timer and + * should be deactivated manually by developer in code using method's returned parameter this. + * callback shuld be null if indicator is true + * @param label + * @param line1 + * @param line2 + * @returns {SDL.PopUp} - returns current instance of PopUp + */ + popupActivate: function(textBody, callback, indicator, label, line1, line2) { this.set('active', true); clearTimeout(this.timer); this.timer = null; - if (callback) { + if (indicator) { + this.set('buttons', true); + } else if (callback) { this.set('callback', callback); this.set('buttons', false); } else { @@ -135,8 +150,11 @@ SDL.PopUp = Em.ContainerView.extend({ 5000); } - this.set('content', message); + this.set('content', textBody); + this.set('label', label); + this.set('line1', line1); + this.set('line2', line2); - return ++this.popUpId; + return this; } });
\ No newline at end of file diff --git a/src/components/HMI/app/view/sdl/TTSPopUp.js b/src/components/HMI/app/view/sdl/TTSPopUp.js index 4fc0c7669c..ae45786f5c 100644 --- a/src/components/HMI/app/view/sdl/TTSPopUp.js +++ b/src/components/HMI/app/view/sdl/TTSPopUp.js @@ -45,7 +45,9 @@ SDL.TTSPopUp = Em.ContainerView.create( { 'popUp', 'message', 'okButton', - 'timerText' + 'timerText', + 'checkBoxLabel', + 'checkBox' ], requestId: null, @@ -86,6 +88,25 @@ SDL.TTSPopUp = Em.ContainerView.create( { disabledBinding: 'parentView.buttons' }), + checkBoxLabel: SDL.Label.extend({ + + elementId: 'checkBoxLabel', + + classNames: 'checkBoxLabel', + + content: 'Send response' + }), + + checkBox: Em.Checkbox.extend( { + + elementId: 'checkBoxTTS', + + classNames: 'checkBoxTTS', + + checked: true + + }), + timerText: SDL.Label.extend({ elementId: 'timerText', @@ -95,10 +116,11 @@ SDL.TTSPopUp = Em.ContainerView.create( { contentBinding: 'parentView.timerSeconds' }), + + resetTimeout: function () { this.set('timerSeconds', 10); FFW.TTS.OnResetTimeout(this.appID, "TTS.Speak"); - this.appID = null; }, ActivateTTS: function(msg, appID) { @@ -126,9 +148,14 @@ SDL.TTSPopUp = Em.ContainerView.create( { DeactivateTTS: function() { clearInterval(this.timer); this.set('active', false); - this.set('timerSeconds', 10); - SDL.SDLController.TTSResponseHandler(); - FFW.TTS.Stopped(); + this.appID = null; + this.set('timerSeconds', 5); + this.checkBox.set('checked', true); + + if (this.checkBox.checked) { + SDL.SDLController.TTSResponseHandler(); + FFW.TTS.Stopped(); + } }, /** diff --git a/src/components/HMI/app/view/sdl/VehicleInfoView.js b/src/components/HMI/app/view/sdl/VehicleInfoView.js index a42efac4d4..915d416d76 100644 --- a/src/components/HMI/app/view/sdl/VehicleInfoView.js +++ b/src/components/HMI/app/view/sdl/VehicleInfoView.js @@ -54,7 +54,8 @@ SDL.VehicleInfo = Em.ContainerView.create( { 'ecu1Data', 'ecu2Data', 'odometrTitle', - 'odometrInput' + 'odometrInput', + 'onAwakeSDLButton' ], /** @@ -187,6 +188,21 @@ SDL.VehicleInfo = Em.ContainerView.create( { } ), /** + * Button to send OnEmergencyEvent to SDL + */ + onAwakeSDLButton: SDL.Button.extend( { + classNames: 'button onEmergencyEvent', + textBinding: 'this.displayText', + action: 'OnEmergencyEventNotificationSend', + target: 'SDL.SDLController', + enabled: false, + onDown: false, + displayText: function () { + return this.enabled ? 'Send OnEmergencyEvent On' : 'Send OnEmergencyEvent Off'; + }.property('this.enabled') + }), + + /** * Trigger function that activates and deactivates VehicleInfo PopUp */ toggleActivity: function() { diff --git a/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js b/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js index d01165dd14..288031ab17 100644 --- a/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js +++ b/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js @@ -86,8 +86,10 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({ ], click: function() { - SDL.InteractionChoicesView.timerUpdate(); - SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction"); + if (this._parentView.active) { + SDL.InteractionChoicesView.timerUpdate(); + SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction"); + } }, naviChoises: Em.ContainerView.extend({ @@ -119,8 +121,10 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({ itemsOnPage: 5, items: [], click: function() { - SDL.InteractionChoicesView.timerUpdate(); - SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction"); + if (this._parentView.active) { + SDL.InteractionChoicesView.timerUpdate(); + SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction"); + } } }), @@ -143,7 +147,7 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({ * Method updates popup timer when data changes through keyboard */ timerUpdate: function (){ - if (this.timeout && this.input.value !== null) { + if (this.timeout) { clearTimeout(this.timer); var self = this; this.timer = setTimeout(function () { diff --git a/src/components/HMI/app/view/sdl/shared/turnByTurnView.js b/src/components/HMI/app/view/sdl/shared/turnByTurnView.js index 21d51ca6b1..1cb7ddfad0 100644 --- a/src/components/HMI/app/view/sdl/shared/turnByTurnView.js +++ b/src/components/HMI/app/view/sdl/shared/turnByTurnView.js @@ -79,29 +79,29 @@ SDL.TurnByTurnView = SDL.SDLAbstractView.create( { for ( var i = 0; i < naviParams.navigationTexts.length; i++) { switch (naviParams.navigationTexts[i].fieldName) { - case 'navigationText1': { - this.set('captionText.content', - naviParams.navigationTexts[i].fieldText); - break; - } - case 'navigationText2': { - this.set('navigationText2', - naviParams.navigationTexts[i].fieldText); - break; - } - case 'ETA': { - this.set('eta', naviParams.navigationTexts[i].fieldText); - break; - } - case 'totalDistance': { - this.set('totalDistance', - naviParams.navigationTexts[i].fieldText); - break; - } + case 'navigationText1': { + this.set('captionText.content', + naviParams.navigationTexts[i].fieldText); + break; + } + case 'navigationText2': { + this.set('navigationText2', + naviParams.navigationTexts[i].fieldText); + break; + } + case 'ETA': { + this.set('eta', naviParams.navigationTexts[i].fieldText); + break; + } + case 'totalDistance': { + this.set('totalDistance', + naviParams.navigationTexts[i].fieldText); + break; + } } } - this.softButtons.addItems(naviParams.softButtons); + this.softButtons.addItems(naviParams.softButtons, appID); if (naviParams.maneuverComplete) { this.set('maneuverComplete', naviParams.maneuverComplete); diff --git a/src/components/HMI/css/buttonControls.css b/src/components/HMI/css/buttonControls.css index b9d3146468..39ef852853 100644 --- a/src/components/HMI/css/buttonControls.css +++ b/src/components/HMI/css/buttonControls.css @@ -281,7 +281,9 @@ #buttonControls .ContainerControlls { left: 34px; - background: black no-repeat; + background: + url(../images/home/controlButtons/backGroundControllButtons.png) + no-repeat; width: 200px; height: 200px; } @@ -404,8 +406,8 @@ -webkit-transition: 0.2s; border-radius: 8px; background-color: #1D1D1D; -/* border: 1px solid #383737; - box-shadow: inset 5px 5px 10px #383737, inset -3px -3px 10px black;*/ + border: 1px solid #383737; + box-shadow: inset 5px 5px 10px #383737, inset -3px -3px 10px black; -webkit-transition: 0.2s; font-size: 38px; line-height: 42px; @@ -541,4 +543,4 @@ #app_controlButtons .phone_call_button.expand{ left: 156px; -} +}
\ No newline at end of file diff --git a/src/components/HMI/css/general.css b/src/components/HMI/css/general.css index f09c98c0df..1eab49e6e1 100644 --- a/src/components/HMI/css/general.css +++ b/src/components/HMI/css/general.css @@ -16,7 +16,7 @@ html, body { body { /*FONT FAMILY*/ - font-family: helvetica-neue; + font-family: sans-serif; /*Defaul font size*/ font-size: 16px; background-color: #000; @@ -43,7 +43,7 @@ div { .ffw-button { cursor: pointer; - background: black; + background: url(../images/common/button.png) repeat-x; } .ffw-button.pressed { @@ -131,7 +131,7 @@ div { height: 100px; z-index: 1; border-radius: 10 PX; - top: 330px; + top: 8px; -webkit-transition: opacity 1s ease-in-out; display: none; } @@ -162,6 +162,24 @@ div { font-size: 30px; } +#TTSPopUp .checkBoxLabel { + color: white; + top: 106px; + width: 72px; + height: 35px; + left: 25px; + background-color: rgb(90, 90, 90); + border-radius: 3px; + border: 1px solid rgb(255,255,255); + padding: 2px; +} + +#TTSPopUp .checkBoxTTS { + top: 118px; + position: absolute; + left: 8px; +} + #TTSPopUp .okButton { right: 52px; width: 113px; @@ -174,6 +192,7 @@ div { #TTSPopUp.active { opacity: 1; display: block; + z-index: 10000; } /* Diver Distraction PopUp */ @@ -577,6 +596,7 @@ div { #media { width: 800px; height: 480px; + background: url(../images/media/bg.png) no-repeat; } /****************************** FOR MEDIA VIEW************************************************/ @@ -792,7 +812,7 @@ margin-top: 90px; /* List item background */ .list-item.notpressed { - background: rgb(29, 6, 6); + background-image: url(../images/list/list_item_bg.png); } .list-item .highLighted { @@ -882,12 +902,12 @@ margin-top: 90px; /* List item button background */ .list-item.pressed { - background: DarkGray; + background-image: url(../images/list/list_item_pressed.png); } /** Background for pressed button */ .button.pressed { - background: DarkGray; + background-image: url(../images/list/list_item_pressed.png); } /* Hide function */ @@ -984,7 +1004,7 @@ margin-top: 90px; } .button { - background: rgb(29, 6, 6); + background-image: url(../images/list/list_item_bg.png); cursor: pointer; } @@ -1089,7 +1109,7 @@ margin-top: 90px; width: 800px; height: 480px; z-index: 12001; - background: black; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(218, 218, 218)), color-stop(0.3, rgb(0, 0, 0))); } #warning_view.fr .text { @@ -1111,6 +1131,7 @@ margin-top: 90px; font-size: 42px; font-weight: bold; top: 20px; + text-shadow: 1px 1px 3px white; color: #CC2A2A; } @@ -1136,7 +1157,6 @@ margin-top: 90px; } #warning_view .components{ - display: none; margin-top: 20px; width: 420px; } @@ -1288,7 +1308,7 @@ to { #wo_popup_denypopup_ok_button { width: 238px; height: 48px; - background: gray; + background: url(../images/common/bt_bg.png) repeat-x; cursor: pointer; position: relative; float: left; @@ -1328,7 +1348,7 @@ to { } #wo_popup_yes_button.pressed, #wo_popup_no_button.pressed, #wo_popup_denypopup_ok_button.pressed { - background: gray !important; + background: url(../images/common/bt_bg_pressed.png) repeat-x !important; } /* END Welcome Orientation View*/ diff --git a/src/components/HMI/css/info.css b/src/components/HMI/css/info.css index e212142cdb..34776e6cbf 100644 --- a/src/components/HMI/css/info.css +++ b/src/components/HMI/css/info.css @@ -6,7 +6,7 @@ width: 324px;
height: 48px;
cursor: pointer;
- background: gray;
+ background: url(../images/common/nav-status-bg.png) no-repeat;
z-index: 1;
}
@@ -668,4 +668,4 @@ border-radius: 2px;
top: 269px;
left: 303px;
-}
+}
\ No newline at end of file diff --git a/src/components/HMI/css/media.css b/src/components/HMI/css/media.css index e8d980479b..85688d5e6b 100644 --- a/src/components/HMI/css/media.css +++ b/src/components/HMI/css/media.css @@ -1,7 +1,7 @@ #media_leftmenu {
z-index: 301;
position: absolute;
- top: 0px;
+ top: 90px;
left: 0px;
width: 150px;
height: 300px;
@@ -55,7 +55,7 @@ left: 0px;
width: 153px;
height: 306px;
- background: black no-repeat;
+ background: url(../images/common/ls_border.png) no-repeat;
}
.media-ls-items {
@@ -73,7 +73,7 @@ }
.media-ls-item.active_state {
- background: black no-repeat !important;
+ background: url(../images/media/ls-item_bg_act.png) no-repeat !important;
}
.media-ls-item>.bg {
@@ -124,19 +124,19 @@ .main-preset-buttons-wraper {
position: relative;
- width: 800px;
+ width: 468px;
height: 100px;
float: left;
-/* left: 165px;*/
- top: 350px;
+ left: 165px;
+ top: 290px;
z-index: 503;
}
.main-preset-buttons-wraper .preset-items {
position: relative;
-/* width: 467px;
+ width: 467px;
height: 99px;
- border: 1px solid #393939;*/
+ border: 1px solid #393939;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
z-index: 1;
@@ -148,8 +148,7 @@ vertical-align: top;
border-right: 1px solid #393939;
border-bottom: 1px solid #393939;
- border-top: 1px solid #393939;
- width: 79px;
+ width: 92.6px;
height: 49px;
cursor: pointer;
}
@@ -315,20 +314,22 @@ {
width: 155px;
height: 98px;
+ border-right: 1px solid #393939;
cursor: pointer;
- background: black no-repeat;
+ background: url(../images/media/cd-prev-btn.png) no-repeat;
}
.bc-item-big.prevcd.pressed,.bc-item-big.prevusb.pressed,.bc-item-big.prevsd.pressed,.bc-item-big.prevblue.pressed
{
- background: gray no-repeat;
+ background: url(../images/media/cd-prev-btn_pressed.png) no-repeat;
}
.bc-item-big.playcd {
width: 157px;
height: 98px;
+ border-right: 1px solid #393939;
cursor: pointer;
- background: black no-repeat;
+ background: url(../images/media/cd_play_btn.png) no-repeat;
}
.playIcon {
@@ -346,7 +347,7 @@ .bc-item-big.playcd.pressed,.bc-item-big.playusb.pressed,.bc-item-big.playsd.pressed,.bc-item-big.playblue.pressed
{
- background: DarkGray no-repeat;
+ background: url(../images/media/cd_play_btn_pressed.png) no-repeat;
}
.bc-item-big.nextcd,.bc-item-big.nextusb,.bc-item-big.nextsd,.bc-item-big.nextblue
@@ -354,12 +355,12 @@ width: 154px;
height: 98px;
cursor: pointer;
- background: black no-repeat;
+ background: url(../images/media/cd-next-btn.png) no-repeat;
}
.bc-item-big.nextcd.pressed,.bc-item-big.nextusb.pressed,.bc-item-big.nextsd.pressed,.bc-item-big.nextblue.pressed
{
- background: DarkGray no-repeat;
+ background: url(../images/media/cd-next-btn_pressed.png) no-repeat;
}
#bt-bg {
@@ -395,12 +396,14 @@ left: 13px;
width: 468px;
height: 99px;
+ background: url("../images/media/btn_bg.png") repeat;
+ border: 1px solid #393939;
-webkit-border-radius: 3px;
}
#sdl_view_container .track-info {
left: 165px;
-/* top: 55px;*/
+ top: 55px;
}
#sdl_view_container .list-content {
@@ -458,7 +461,6 @@ }
.track-info>.device {
- display: none;
position: absolute;
top: 30px;
left: 10px;
@@ -469,7 +471,6 @@ }
.divider_o {
- display: none;
position: absolute;
top: 120px;
left: 0px;
@@ -521,7 +522,7 @@ }
#sdl_view_container .ffw_list_menu {
- /*top: 90px;*/
+ top: 90px;
left: 650px;
width: 140px;
-}
+}
\ No newline at end of file diff --git a/src/components/HMI/css/sdl.css b/src/components/HMI/css/sdl.css index 303ec2b019..e6bf641513 100644 --- a/src/components/HMI/css/sdl.css +++ b/src/components/HMI/css/sdl.css @@ -4,6 +4,7 @@ .ffw_list_menu { left: 440px; width: 158px; + border: 1px solid #393939; overflow: hidden; } @@ -14,7 +15,6 @@ .ffw_list_menu .ffw-button { position: relative; - z-index: 300; height: 49px; border-bottom: 1px solid #393939; line-height: 50px; @@ -70,7 +70,7 @@ } .sdl-window .back-button { - /*top: 80px;*/ + top: 80px; left: 5px; width: 48px; height: 48px; @@ -84,10 +84,10 @@ } #info_apps_deviceList_view .deviceListLabel,.sdl-window .caption-text { - /*top: 80px;*/ + top: 80px; left: 75px; width: 620px; - background: rgb(29, 6, 6); + background: #393939; overflow: hidden; text-overflow: ellipsis; line-height: 50px; @@ -183,7 +183,7 @@ height: 251px; border-radius: 2px; left: 75px; - top: 51px; + top: 150px; } /*#sdl_view_container .list-content,*/ @@ -228,7 +228,7 @@ left: 10px; width: 84px; height: 50px; - font-size: 12px; + font-size: 20px; line-height: 50px; overflow: hidden; text-overflow: ellipsis; @@ -236,7 +236,7 @@ } #sdl_view_container .preset-items { -/* width: 468px; */ + width: 468px; } #sdl_view_container .main-preset-buttons-wraper .preset-item.a3,#sdl_view_container .main-preset-buttons-wraper .preset-item.a6 @@ -245,17 +245,16 @@ } #sdl_view_container .player_controllsV2 { - - top: 200px !important; + top: 241px !important; height: 48px; } #sdl_view_container .player_controllsV2 .ffw-button { -/* height: 48px;*/ + height: 48px; } #sdl_view_container .player_controllsV2 img { -/* margin-top: -26px; */ + margin-top: -26px; } /* ScrollableMessage */ @@ -481,6 +480,7 @@ position: absolute; top: 90px; right: 10px; + border: 1px solid #393939; -webkit-border-radius: 2px; width: 109px; height: 109px; @@ -490,6 +490,7 @@ position: absolute; top: 70px; right: 10px; + border: 1px solid #393939; -webkit-border-radius: 2px; width: 109px; height: 109px; @@ -600,6 +601,25 @@ background: #393939; } +#exitAppView .onAwakeSDLLabel{ + top: 200px; + width: 600px; + left: 40px; + height: 20px; + padding: 10px; + background: #535353; +} + +#exitAppView .onAwakeSDLButton{ + right: 268px; + top: 250px; + width: 150px; + height: 19px; + padding: 10px; + border-radius: 4px; + border: 1px solid white; +} + #VehicleInfo .odometrTitle{ top: 180px; width: 290px; @@ -625,6 +645,22 @@ padding-right: 10px; } +#VehicleInfo .onEmergencyEvent{ + width: 265px; + position: absolute; + top: 301px; + left: 207px; + height: 28px; + border: 1px solid #333; + border-radius: 2px; + cursor: pointer; + font-size: 18px; + color: #FFF; + padding-left: 10px; + padding-right: 10px; + line-height: 28px; +} + #VehicleInfo .ecu1Title { top: 180px; width: 290px; @@ -1215,4 +1251,4 @@ #media_app_options_view .list-content { width: 578px; -} +}
\ No newline at end of file diff --git a/src/components/HMI/ffw/BasicCommunicationRPC.js b/src/components/HMI/ffw/BasicCommunicationRPC.js index 0fd63b0fc1..fb15457cb6 100644 --- a/src/components/HMI/ffw/BasicCommunicationRPC.js +++ b/src/components/HMI/ffw/BasicCommunicationRPC.js @@ -208,7 +208,7 @@ FFW.BasicCommunication = FFW.RPCObserver if (response.id in SDL.SDLModel.userFriendlyMessagePull) { var callbackObj = SDL.SDLModel.userFriendlyMessagePull[response.id]; - callbackObj.callbackFunc(response.result.messages, callbackObj.appID); + callbackObj.callbackFunc(response.result.messages); delete SDL.SDLModel.userFriendlyMessagePull[response.id]; } } @@ -219,7 +219,16 @@ FFW.BasicCommunication = FFW.RPCObserver if (response.id in SDL.SDLModel.activateAppRequestsList) { - var appID = SDL.SDLModel.activateAppRequestsList[response.id]; + var appID = SDL.SDLModel.activateAppRequestsList[response.id].appID, + popUp = SDL.SDLModel.activateAppRequestsList[response.id].popUp; + + popUp.deactivate(); + + if (response.error && response.error.code === SDL.SDLModel.resultCode["APPLICATION_NOT_REGISTERED"]) { + + SDL.PopUp.create().appendTo('body').popupActivate("Activation FAILED!"); + return; + } if (!response.result.isSDLAllowed) { @@ -345,7 +354,7 @@ FFW.BasicCommunication = FFW.RPCObserver if (notification.params.isAppPermissionsRevoked) { - SDL.SDLModel.setAppPermissions(notification.params.appID, response.result.appRevokedPermissions); + SDL.SDLModel.setAppPermissions(notification.params.appID, notification.params.appRevokedPermissions); } if (notification.params.appRevoked) { @@ -360,7 +369,7 @@ FFW.BasicCommunication = FFW.RPCObserver } if (notification.method == this.onAppRegisteredNotification) { - SDL.SDLModel.onAppRegistered(notification.params); + SDL.SDLModel.onAppRegistered(notification.params.application); this.OnFindApplications(); } @@ -418,9 +427,23 @@ FFW.BasicCommunication = FFW.RPCObserver } if (request.method == "BasicCommunication.UpdateAppList") { + var message = "Was found " + request.params.applications.length + " apps"; + + SDL.PopUp.create().appendTo('body').popupActivate(message); + + for(var app in request.params.applications) { + + if (request.params.applications.hasOwnProperty(app)) { + SDL.SDLModel.onAppRegistered(request.params.applications[app]); + } + //SDL.SDLController.registerApplication(request.params.applications[app], request.params.applications[app].isMediaApplication !== undefined ? request.params.applications[app].isMediaApplication : null); + } + this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); + + SDL.InfoAppsView.showAppList(); } if (request.method == "BasicCommunication.SystemRequest") { @@ -494,7 +517,10 @@ FFW.BasicCommunication = FFW.RPCObserver var itemIndex = this.client.generateId(); - SDL.SDLModel.activateAppRequestsList[itemIndex] = appID; + SDL.SDLModel.activateAppRequestsList[itemIndex] = { + "appID": appID, + "popUp": SDL.PopUp.create().appendTo('body').popupActivate("Activation in progress...", null, true) + }; Em.Logger.log("FFW.SDL.OnAppActivated: Request from HMI!"); @@ -1000,6 +1026,24 @@ FFW.BasicCommunication = FFW.RPCObserver }, /** + * OnAwakeSDL from HMI returns SDL to normal operation + * after OnExitAllApplications(SUSPEND) + */ + OnAwakeSDL: function() { + + Em.Logger.log("FFW.BasicCommunication.OnAwakeSDL"); + + // send request + var JSONMessage = { + "jsonrpc": "2.0", + "method": "BasicCommunication.OnAwakeSDL" + }; + this.client.send(JSONMessage); + }, + + + + /** * Used by HMI when User chooses to exit application. * * @params {Number} @@ -1151,6 +1195,25 @@ FFW.BasicCommunication = FFW.RPCObserver }, /** + * Notifies if audio state was changed + * + * @param {Boolean} enabled + */ + OnEmergencyEvent: function(enabled) { + + Em.Logger.log("FFW.BasicCommunication.OnEmergencyEvent"); + + // send repsonse + var JSONMessage = { + "jsonrpc": "2.0", + "method": "BasicCommunication.OnEmergencyEvent", + "params": { + "enabled": enabled + } + }; + this.client.send(JSONMessage); + }, + /** * Send error response from onRPCRequest * * @param {Number} diff --git a/src/components/HMI/ffw/NavigationRPC.js b/src/components/HMI/ffw/NavigationRPC.js index 5f594079a1..463dbfe976 100644 --- a/src/components/HMI/ffw/NavigationRPC.js +++ b/src/components/HMI/ffw/NavigationRPC.js @@ -172,6 +172,24 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.AlertManeuver": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("softButtons" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); @@ -180,6 +198,12 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.ShowConstantTBT": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } + SDL.SDLModel.tbtActivate(request.params); this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, @@ -189,6 +213,24 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.UpdateTurnList": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("turnList" in request.params || "softButtons" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.SDLModel.tbtTurnListUpdate(request.params); this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, @@ -198,11 +240,7 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.StartAudioStream": { - SDL.SDLModel.startAudioStream(request.params); - - this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], - request.id, - request.method); + SDL.SDLModel.startAudioStream(request); break; } @@ -218,11 +256,7 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.StartStream": { - SDL.SDLModel.startStream(request.params); - - this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], - request.id, - request.method); + SDL.SDLModel.startStream(request); break; } @@ -238,6 +272,12 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.SendLocation": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } + this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); @@ -292,6 +332,14 @@ FFW.Navigation = FFW.RPCObserver.create( { */ sendNavigationResult: function(resultCode, id, method) { + if (this.errorResponsePull[id]) { + + this.sendError(this.errorResponsePull[id].code, id, method, + "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed."); + this.errorResponsePull[id] = null; + return; + } + Em.Logger.log("FFW.UI." + method + "Response"); if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { diff --git a/src/components/HMI/ffw/RPCClient.js b/src/components/HMI/ffw/RPCClient.js index 954dfbe17e..5df06334d2 100644 --- a/src/components/HMI/ffw/RPCClient.js +++ b/src/components/HMI/ffw/RPCClient.js @@ -129,34 +129,19 @@ FFW.RPCClient = Em.Object Em.Logger.log("Message received: " + evt.data);
- var jsonObj = JSON.parse(evt.data);
-
- JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
-
- if (jsonObj.method == 'UI.Show' && SDL.RPCController.capabilityCheckResult == 'UNSUPPORTED_RESOURCE' && Object.size(jsonObj.params) != 3 && jsonObj.params.showStrings.length != 0) {
-
- this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["WARNINGS"];
-
- Em.Logger.error('Image of STATIC type is not supported on HMI. Other information was successfully displayed');
+ var jsonObj = JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
+ if (SDL.RPCController.capabilityCheckResult != null) {
+ this.observer.errorResponsePull[jsonObj.id] = SDL.RPCController.capabilityCheckResult;
SDL.RPCController.capabilityCheckResult = null;
- } else {
-
- switch (SDL.RPCController.capabilityCheckResult) {
- case 'UNSUPPORTED_RESOURCE': {
-
- this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["UNSUPPORTED_RESOURCE"];
-
- Em.Logger.error('Unsupported incoming resource! In method ' + jsonObj.method);
-
- SDL.RPCController.capabilityCheckResult = null;
-
- break;
- }
- }
+ this.observer.checkImage(jsonObj.params);
+ this.observer.checkSoftButtons(jsonObj.params);
+ this.observer.checkChoice(jsonObj.params);
+ this.observer.checkChunk(jsonObj.params);
+ this.observer.checkHelpItems(jsonObj.params);
+ this.observer.checkTurnList(jsonObj.params);
}
-
// handle component registration
if (jsonObj.id == this.registerRequestId && jsonObj.method == null && typeof jsonObj.result == 'number') {
if (jsonObj.error == null) {
@@ -289,22 +274,6 @@ FFW.RPCClient = Em.Object if (this.socket.readyState == this.socket.OPEN) {
- if (this.observer.errorResponsePull[obj.id] && this.observer.errorResponsePull[obj.id] !== 0 && obj.result) {
- var method = obj.result.method;
-
- delete obj.result;
-
- obj.error = {
- "code": this.observer.errorResponsePull[obj.id],
- "message": this.observer.errorResponsePull[obj.id] == 21 ? "Image of STATIC type is not supported on HMI. Other information was successfully displayed" : "Unsupported incoming resource!",
- "data": {
- "method": method
- }
- }
-
- delete this.observer.errorResponsePull[obj.id];
- }
-
var strJson = JSON.stringify(obj);
Em.Logger.log(strJson);
diff --git a/src/components/HMI/ffw/RPCObserver.js b/src/components/HMI/ffw/RPCObserver.js index 6f598cbeb0..76b002aa8b 100644 --- a/src/components/HMI/ffw/RPCObserver.js +++ b/src/components/HMI/ffw/RPCObserver.js @@ -71,11 +71,244 @@ FFW.RPCObserver = Em.Object // parse JSON string and set necessary properties
},
- onRPCRequest: function(request) {
+ onRPCRequest: function(request, error) {
// parse JSON string and send back necessary data
},
+ /**
+ * Check for unsupported image type
+ * Return false if unsupported image type was found and delete unsupported resource
+ * @param params
+ * @returns {boolean}
+ */
+ checkImage: function(params){
+ if ("graphic" in params) {
+ if (params.graphic.imageType === "STATIC") {
+ delete params.graphic;
+ return false;
+ }
+ }
+ if ("secondaryGraphic" in params) {
+ if (params.secondaryGraphic.imageType === "STATIC") {
+ delete params.secondaryGraphic;
+ return false;
+ }
+ }
+ if ("image" in params) {
+ if (params.image.imageType === "STATIC") {
+ delete params.image;
+ return false;
+ }
+ }
+ if ("secondaryImage" in params) {
+ if (params.image.imageType === "STATIC") {
+ delete params.image;
+ return false;
+ }
+ }
+ if ("turnIcon" in params) {
+ if (params.turnIcon.imageType === "STATIC") {
+ delete params.turnIcon;
+ return false;
+ }
+ }
+ if ("nextTurnIcon" in params) {
+ if (params.nextTurnIcon.imageType === "STATIC") {
+ delete params.nextTurnIcon;
+ return false;
+ }
+ }
+ if ("cmdIcon" in params) {
+ if (params.cmdIcon.imageType === "STATIC") {
+ delete params.cmdIcon;
+ return false;
+ }
+ }
+ if ("menuIcon" in params) {
+ if (params.menuIcon.imageType === "STATIC") {
+ delete params.menuIcon;
+ return false;
+ }
+ }
+ if ("syncFileName" in params) {
+ if (params.syncFileName.imageType === "STATIC") {
+ delete params.syncFileName;
+ return false;
+ }
+ }
+ if ("locationImage" in params) {
+ if (params.locationImage.imageType === "STATIC") {
+ delete params.locationImage;
+ return false;
+ }
+ }
+ return true;
+ },
+
+ /**
+ * Check for unsupported image type
+ * If unsupported image type was found delete unsupported resource
+ * @param params
+ */
+ checkSoftButtons: function(params){
+
+ if ("softButtons" in params) {
+ for (var i = params.softButtons.length-1; i >= 0 ; i--) {
+ if (!this.checkImage(params.softButtons[i])) {
+ if (!("text" in params.softButtons[i])) {
+
+ params.softButtons.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.softButtons.length == 0) {
+ delete params.softButtons;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported image type
+ * If unsupported image type was found delete unsupported resource
+ * @param params
+ */
+ checkTurnList: function(params){
+
+ if ("turnList" in params) {
+ for (var i = params.turnList.length-1; i >= 0 ; i--) {
+ if (!this.checkImage(params.turnList[i])) {
+ if (!("navigationText" in params.turnList[i])) {
+
+ params.turnList.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.turnList.length == 0) {
+ delete params.turnList;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported tts type
+ * If unsupported tts type was found delete unsupported resource
+ * @param params
+ */
+ checkChunk: function(params){
+
+ if ("ttsName" in params) {
+ for (var i = params.ttsName.length-1; i >= 0 ; i--) {
+ if (params.ttsName[i].type != "TEXT") {
+
+ params.ttsName.splice(i, 1);
+ }
+ }
+
+ if (params.ttsName.length == 0) {
+ delete params.ttsName;
+ }
+ }
+ if ("helpPrompt" in params) {
+ for (var i = params.helpPrompt.length-1; i >= 0 ; i--) {
+ if (params.helpPrompt[i].type != "TEXT") {
+
+ params.helpPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.helpPrompt.length == 0) {
+ delete params.helpPrompt;
+ }
+ }
+ if ("initialPrompt" in params) {
+ for (var i = params.initialPrompt.length-1; i >= 0 ; i--) {
+ if (params.initialPrompt[i].type != "TEXT") {
+
+ params.initialPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.initialPrompt.length == 0) {
+ delete params.initialPrompt;
+ }
+ }
+ if ("timeoutPrompt" in params) {
+ for (var i = params.timeoutPrompt.length-1; i >= 0 ; i--) {
+ if (params.timeoutPrompt[i].type != "TEXT") {
+
+ params.timeoutPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.timeoutPrompt.length == 0) {
+ delete params.timeoutPrompt;
+ }
+ }
+ if ("ttsChunks" in params) {
+ for (var i = params.ttsChunks.length-1; i >= 0 ; i--) {
+ if (params.ttsChunks[i].type != "TEXT") {
+
+ params.ttsChunks.splice(i, 1);
+ }
+ }
+
+ if (params.ttsChunks.length == 0) {
+ delete params.ttsChunks;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported choiceSet type
+ * If unsupported choiceSet type was found delete unsupported resource
+ * @param params
+ */
+ checkChoice: function(params){
+
+ if ("choiceSet" in params) {
+ for (var i = params.choiceSet.length-1; i >= 0 ; i--) {
+ if (this.checkImage(params.choiceSet[i])) {
+ if (!("menuName" in params.choiceSet[i])
+ || !("secondaryText" in params.choiceSet[i])
+ || !("tertiaryText" in params.choiceSet[i])) {
+
+ params.choiceSet.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.choiceSet.length == 0) {
+ delete params.choiceSet;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported vrHelp type
+ * If unsupported vrHelp type was found delete unsupported resource
+ * @param params
+ */
+ checkHelpItems: function(params){
+
+ if ("vrHelp" in params) {
+ for (var i = params.vrHelp.length-1; i >= 0 ; i--) {
+ if (this.checkImage(params.vrHelp[i])) {
+ if (!("text" in params.vrHelp[i])) {
+
+ params.vrHelp.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.vrHelp.length == 0) {
+ delete params.vrHelp;
+ }
+ }
+ },
+
validationCheck: function(request) {
if (request && request.method) {
diff --git a/src/components/HMI/ffw/TTSRPC.js b/src/components/HMI/ffw/TTSRPC.js index 6939aa4938..0e0b92acd4 100644 --- a/src/components/HMI/ffw/TTSRPC.js +++ b/src/components/HMI/ffw/TTSRPC.js @@ -151,6 +151,24 @@ FFW.TTS = FFW.RPCObserver.create( { switch (request.method) { case "TTS.Speak": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("ttsChunks" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + if (SDL.TTSPopUp.active) { FFW.TTS.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, "TTS.Speak", "TTS in progress. Rejected."); } else { @@ -162,6 +180,25 @@ FFW.TTS = FFW.RPCObserver.create( { } case "TTS.SetGlobalProperties": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("helpPrompt" in request.params + || "timeoutPrompt" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.SDLModel.setProperties(request.params); this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"], @@ -248,6 +285,25 @@ FFW.TTS = FFW.RPCObserver.create( { } case "TTS.ChangeRegistration": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("ttsName" in request.params + || "language" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.SDLModel.changeRegistrationTTSVR(request.params.language, request.params.appID); this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"], @@ -328,6 +384,14 @@ FFW.TTS = FFW.RPCObserver.create( { */ sendTTSResult: function(resultCode, id, method) { + if (this.errorResponsePull[id]) { + + this.sendError(this.errorResponsePull[id].code, id, method, + "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed."); + this.errorResponsePull[id] = null; + return; + } + Em.Logger.log("FFW." + method + "Response"); if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { diff --git a/src/components/HMI/ffw/UIRPC.js b/src/components/HMI/ffw/UIRPC.js index 43ee73a850..5feb304d20 100644 --- a/src/components/HMI/ffw/UIRPC.js +++ b/src/components/HMI/ffw/UIRPC.js @@ -168,6 +168,25 @@ FFW.UI = FFW.RPCObserver.create({ case "UI.Alert": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if (request.params.alertStrings.length > 0 + || "softButtons" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + if (SDL.SDLModel.onUIAlert(request.params, request.id)) { SDL.SDLController.onSystemContextChange(request.params.appID); } @@ -177,6 +196,28 @@ FFW.UI = FFW.RPCObserver.create({ case "UI.Show": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if (request.params.showStrings.length > 0 + || "graphic" in request.params + || "secondaryGraphic" in request.params + || "softButtons" in request.params + || "customPresets" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.TurnByTurnView.deactivate(); SDL.SDLController.getApplicationModel(request.params.appID).onSDLUIShow(request.params); this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); @@ -185,14 +226,29 @@ FFW.UI = FFW.RPCObserver.create({ } case "UI.SetGlobalProperties": { - SDL.SDLModel.setProperties(request.params); - this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { - break; - } - case "UI.ResetGlobalProperties": - { + //Check if there is any available data to process the request + if ("menuTitle" in request.params + || "keyboardProperties" in request.params + || "vrHelp" in request.params + || "menuIcon" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + + SDL.SDLModel.setProperties(request.params); this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); @@ -201,6 +257,25 @@ FFW.UI = FFW.RPCObserver.create({ case "UI.AddCommand": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("cmdIcon" in request.params + || "menuParams" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.SDLController.getApplicationModel(request.params.appID).addCommand(request); break; @@ -230,6 +305,28 @@ FFW.UI = FFW.RPCObserver.create({ case "UI.PerformInteraction": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("choiceSet" in request.params + && request.params + && request.params.interactionLayout != "KEYBOARD") { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, + request.id, + request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + if (SDL.SDLModel.uiPerformInteraction(request)) { SDL.SDLController.onSystemContextChange(); } @@ -243,7 +340,10 @@ FFW.UI = FFW.RPCObserver.create({ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { this.sendUIResult(resultCode, request.id, request.method); } else { - this.sendError(resultCode, request.id, request.method, 'Request is ignored, because the intended result is already in effect.'); + this.sendError(resultCode, + request.id, + request.method, + 'Request is ignored, because the intended result is already in effect.'); } break; @@ -270,10 +370,13 @@ FFW.UI = FFW.RPCObserver.create({ { if (request.params.appName) { - SDL.SDLController.getApplicationModel(request.params.appID).set('appName', request.params.appName); + SDL.SDLController.getApplicationModel(request.params.appID).set('appName', + request.params.appName); } - SDL.SDLModel.changeRegistrationUI(request.params.language, request.params.appID); + SDL.SDLModel.changeRegistrationUI(request.params.language, + request.params.appID, + request.params.appName); this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); break; @@ -492,6 +595,30 @@ FFW.UI = FFW.RPCObserver.create({ "characterSet": "TYPE2SET", "width": 500, "rows": 1 + }, + { + "name": "locationName", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "locationDescription", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "addressLines", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "phoneNumber", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 } ], "imageFields": [ @@ -772,6 +899,20 @@ FFW.UI = FFW.RPCObserver.create({ case "UI.SetAppIcon": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if (!("syncFileName" in request.params)) { + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.SDLModel.onSDLSetAppIcon(request.params, request.id, request.method); break; @@ -780,7 +921,11 @@ FFW.UI = FFW.RPCObserver.create({ { if (this.performAudioPassThruRequestID > 0) { - this.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'PerformAudioPassThru request aborted!'); + this.sendError( + SDL.SDLModel.resultCode["REJECTED"], + request.id, + request.method, + 'PerformAudioPassThru request aborted!'); } else { this.performAudioPassThruRequestID = request.id; @@ -1020,6 +1165,30 @@ FFW.UI = FFW.RPCObserver.create({ "characterSet": "TYPE2SET", "width": 500, "rows": 1 + }, + { + "name": "locationName", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "locationDescription", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "addressLines", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "phoneNumber", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 } ], "imageFields": [ @@ -1320,6 +1489,14 @@ FFW.UI = FFW.RPCObserver.create({ */ sendUIResult: function (resultCode, id, method) { + if (this.errorResponsePull[id]) { + + this.sendError(this.errorResponsePull[id].code, id, method, + "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed."); + this.errorResponsePull[id] = null; + return; + } + Em.Logger.log("FFW." + method + "Response"); if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { @@ -1351,16 +1528,8 @@ FFW.UI = FFW.RPCObserver.create({ switch (resultCode) { case SDL.SDLModel.resultCode["SUCCESS"]: { - // send repsonse - var JSONMessage = { - "jsonrpc": "2.0", - "id": id, - "result": { - "code": resultCode, // type (enum) from SDL protocol - "method": 'UI.Alert' - } - }; - this.client.send(JSONMessage); + + this.sendUIResult(resultCode, id, 'UI.Alert'); break; } @@ -1394,6 +1563,7 @@ FFW.UI = FFW.RPCObserver.create({ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { + this.sendUIResult(resultCode, id, 'UI.Alert'); // send repsonse var JSONMessage = { "jsonrpc": "2.0", @@ -1530,6 +1700,35 @@ FFW.UI = FFW.RPCObserver.create({ Em.Logger.log("FFW.UI.PerformInteractionResponse"); + if (this.errorResponsePull[requestID]) { + + // send repsonse + var JSONMessage = { + "jsonrpc": "2.0", + "id": requestID, + "error": { + "code": this.errorResponsePull[requestID].code, + "message": "Unsupported " + this.errorResponsePull[requestID].type + + " type. Available data in request was processed.", + "data": { + "method": "UI.PerformInteraction" + } + } + }; + + if (commandID) { + JSONMessage.error.data.choiceID = commandID; + } + + if (manualTextEntry != null) { + JSONMessage.error.data.manualTextEntry = manualTextEntry; + } + + this.client.send(JSONMessage); + this.errorResponsePull[requestID] = null; + return; + } + if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { // send repsonse var JSONMessage = { diff --git a/src/components/HMI/ffw/VRRPC.js b/src/components/HMI/ffw/VRRPC.js index 680c9a87dc..ce8188b6c0 100644 --- a/src/components/HMI/ffw/VRRPC.js +++ b/src/components/HMI/ffw/VRRPC.js @@ -247,6 +247,27 @@ FFW.VR = FFW.RPCObserver.create( { case "VR.PerformInteraction": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("helpPrompt" in request.params + || "initialPrompt" in request.params + || "timeoutPrompt" in request.params + || "grammarID" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.SDLModel.vrPerformInteraction(request); break; @@ -320,6 +341,30 @@ FFW.VR = FFW.RPCObserver.create( { Em.Logger.log("FFW.VR.PerformInteractionResponse"); + if (this.errorResponsePull[requestID]) { + + // send repsonse + var JSONMessage = { + "jsonrpc": "2.0", + "id": requestID, + "error": { + "code": this.errorResponsePull[requestID].code, + "message": "Unsupported " + this.errorResponsePull[requestID].type + " type. Available data in request was processed.", + "data": { + "method": "VR.PerformInteraction" + } + } + }; + + if (commandID) { + JSONMessage.error.data.choiceID = commandID; + } + + this.client.send(JSONMessage); + this.errorResponsePull[requestID] = null; + return; + } + if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { // send repsonse var JSONMessage = { @@ -366,6 +411,14 @@ FFW.VR = FFW.RPCObserver.create( { */ sendVRResult: function(resultCode, id, method) { + if (this.errorResponsePull[id]) { + + this.sendError(this.errorResponsePull[id].code, id, method, + "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed."); + this.errorResponsePull[id] = null; + return; + } + Em.Logger.log("FFW." + method + "Response"); if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { |