diff options
Diffstat (limited to 'src/components/HMI/app/controller')
4 files changed, 94 insertions, 140 deletions
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') { |