HMI/App component updates
authorJustin Dickow <jjdickow@gmail.com>
Thu, 17 Jul 2014 17:37:23 +0000 (13:37 -0400)
committerJustin Dickow <jjdickow@gmail.com>
Thu, 17 Jul 2014 17:37:23 +0000 (13:37 -0400)
Authors

Andrew Melnik
Dmitriy Klimenko
Dmitriy Trunov
Nikolay Khlopkov
Polina Vyshnevska

Signed-off-by: Justin Dickow <jjdickow@gmail.com>
src/components/HMI/app/controller/sdl/AppController.js
src/components/HMI/app/controller/sdl/Controller.js
src/components/HMI/app/controller/sdl/RPCController.js
src/components/HMI/app/model/sdl/VehicleInfoModel.js
src/components/HMI/app/view/sdl/AlertPopUp.js
src/components/HMI/app/view/sdl/TTSPopUp.js
src/components/HMI/app/view/sdl/shared/keyboard.js
src/components/HMI/ffw/BasicCommunicationRPC.js

index a7dd625..cfe5e85 100644 (file)
@@ -67,7 +67,11 @@ SDL.SDLAppController = Em.Object.create({
 
             switch (element.commandID) {
                 case -1: {
-                    FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID);
+                    FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID, "DRIVER_DISTRACTION_VIOLATION");
+                    break;
+                }
+                case -2: {
+                    FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID, "USER_EXIT");
                     break;
                 }
                 default: {
@@ -85,10 +89,11 @@ SDL.SDLAppController = Em.Object.create({
             }
 
             return;
-        }
+        } else {
 
-        FFW.UI.onCommand(element.commandID, this.model.appID);
-        SDL.OptionsView.deactivate();
+            FFW.UI.onCommand(element.commandID, this.model.appID);
+            SDL.OptionsView.deactivate();
+        }
     },
 
     /**
index b4c913b..74847d3 100644 (file)
@@ -48,7 +48,7 @@ SDL.SDLController = Em.Object
             if ( SDL.SliderView.active
                 || SDL.InteractionChoicesView.active
                 || SDL.ScrollableMessage.active
-                || SDL.AudioPassThruPopUp.activate) {
+                || SDL.SDLModel.AudioPassThruState) {
 
                 return 'HMI_OBSCURED';
             }
@@ -65,6 +65,7 @@ SDL.SDLController = Em.Object
             }
         }.property('SDL.OptionsView.active',
             'SDL.SliderView.active',
+            'SDL.SDLModel.AudioPassThruState',
             'SDL.VRPopUp.VRActive',
             'SDL.AlertPopUp.active',
             'SDL.States.info.nonMedia.active',
@@ -72,8 +73,7 @@ SDL.SDLController = Em.Object
             'SDL.States.navigationApp.baseNavigation.active',
             'SDL.ScrollableMessage.active',
             'SDL.InteractionChoicesView.active',
-            'SDL.VRHelpListView.active',
-            'SDL.AudioPassThruPopUp.activate'),
+            'SDL.VRHelpListView.active'),
 
         /**
          * List of SDL application models
@@ -557,7 +557,7 @@ SDL.SDLController = Em.Object
                 "params": {
                     "menuParams":{
                         "parentID": 0,
-                        "menuName": "Exit",
+                        "menuName": "Exit 'DRIVER_DISTRACTION_VIOLATION'",
                         "position": 0
                     },
                     cmdID: -1
@@ -565,6 +565,20 @@ SDL.SDLController = Em.Object
             };
 
             SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
+
+            exitCommand = {
+                "id": -10,
+                "params": {
+                    "menuParams":{
+                        "parentID": 0,
+                        "menuName": "Exit 'USER_EXIT'",
+                        "position": 0
+                    },
+                    cmdID: -2
+                }
+            };
+
+            SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
         },
         /**
          * Unregister application
index 2c65bf9..d78be9e 100644 (file)
@@ -78,7 +78,22 @@ SDL.RPCController = Em.Object
 
                 resultStruct: {},
 
-               /**
+                /**
+                 * Validate method for request UpdateAppList
+                 *
+                 * @param {Object}
+                 *            params
+                 */
+                UpdateAppList: function(params) {
+
+                    this.resultStruct = {
+                        "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+                    };
+
+                    return this.resultStruct;
+                },
+
+                /**
                  * Validate method for request UpdateDeviceList
                  * 
                  * @param {Object}
@@ -1044,7 +1059,7 @@ SDL.RPCController = Em.Object
                         return this.resultStruct;
                     }
                     if ("nextTurnIcon" in params
-                        && ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
+                        && ((params.nextTurnIcon.imageType !== "DYNAMIC") && (params.nextTurnIcon.imageType !== "STATIC"))) {
                         this.resultStruct = {
                             "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
                             "resultMessage": "Unsupported image type!"
@@ -1236,16 +1251,7 @@ SDL.RPCController = Em.Object
 
                         return this.resultStruct;
                     }
-                    if (params.duration == null) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Parameter 'duration' does not exists!"
-                        };
-
-                        return this.resultStruct;
-                    }
-                    if (typeof params.duration != 'number') {
+                    if ('duration' in params && typeof params.duration != 'number') {
 
                         this.resultStruct = {
                             "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
index 8e256fe..73b90cc 100644 (file)
@@ -102,7 +102,6 @@ SDL.SDLVehicleInfoModel = Em.Object
             "fuelLevel": "VEHICLEDATA_FUELLEVEL",
             "fuelLevel_State": "VEHICLEDATA_FUELLEVEL_STATE",
             "instantFuelConsumption": "VEHICLEDATA_FUELCONSUMPTION",
-            "externalTemperature": "VEHICLEDATA_EXTERNTEMP",
             "prndl": "VEHICLEDATA_PRNDL",
             "tirePressure": "VEHICLEDATA_TIREPRESSURE",
             "odometer": "VEHICLEDATA_ODOMETER",
@@ -211,7 +210,6 @@ SDL.SDLVehicleInfoModel = Em.Object
             },
             'avgFuelEconomy': 0.1,
             'batteryVoltage': 12.5,
-            'externalTemperature': 40.0,
             'vin': '52-452-52-752',
             'prndl': 'PARK',
             'odometer': 23,
index 1266f05..30c4fac 100644 (file)
@@ -132,7 +132,7 @@ SDL.AlertPopUp = Em.ContainerView.create({
     /**
      * Deactivate PopUp
      */
-    deactivate: function() {
+    deactivate: function(reason) {
         this.set('active', false);
         clearTimeout(this.timer);
 
@@ -140,7 +140,11 @@ SDL.AlertPopUp = Em.ContainerView.create({
         this.set('content2', '');
         this.set('content3', '');
 
-        SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['SUCCESS'], this.alertRequestId);
+        if (reason == 'timeout' && this.softbuttons.buttons._childViews.length > 0) {
+            SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['ABORTED'], this.alertRequestId);
+        } else {
+            SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['SUCCESS'], this.alertRequestId);
+        }
 
         SDL.SDLController.onSystemContextChange();
     },
@@ -241,7 +245,7 @@ SDL.AlertPopUp = Em.ContainerView.create({
 
         clearTimeout(this.timer);
         this.timer = setTimeout(function() {
-            self.deactivate();
-        }, message.duration);
+            self.deactivate('timeout');
+        }, message.duration ? message.duration : 30000); //default timeout defined for Alert popUp
     }
 });
\ No newline at end of file
index 0fb11ee..5024cb4 100644 (file)
@@ -82,7 +82,7 @@ SDL.TTSPopUp = Em.ContainerView.create( {
         this.timer = setTimeout(function() {
 
             self.DeactivateTTS();
-        }, 2000); // 2 second timeout for TTS popUp
+        }, 5000); // timeout for TTS popUp in milliseconds
         FFW.TTS.Started();
     },
 
@@ -102,4 +102,4 @@ SDL.TTSPopUp = Em.ContainerView.create( {
 
         //FFW.TTS.set('isReady', true);
     }
-});
\ No newline at end of file
+});
index 7d8a39a..e47cc59 100644 (file)
@@ -104,7 +104,9 @@ SDL.Keyboard = SDL.SDLAbstractView.create({
                 break;
             }
             case "Search": {
-                this.target.set('value', "");
+                if (this.target.value == null) {
+                    this.target.set('value', "");
+                }
                 this.target.search();
                 this.deactivate();
                 break;
index fd1627b..793ff32 100644 (file)
@@ -403,9 +403,13 @@ FFW.BasicCommunication = FFW.RPCObserver
                         request.method);
                 }
                 if (request.method == "BasicCommunication.UpdateAppList") {
-                    if (SDL.States.info.active) {
-                        SDL.SDLController.onGetAppList(request.params.applications);
-                    }
+
+                    var message = "Was found " + request.params.applications.length + " apps";
+
+                    SDL.PopUp.popupActivate(message);
+//                    if (SDL.States.info.active) {
+//                        SDL.SDLController.onGetAppList(request.params.applications);
+//                    }
                     this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
                         request.id,
                         request.method);
@@ -422,7 +426,7 @@ FFW.BasicCommunication = FFW.RPCObserver
                 }
                 if (request.method == "BasicCommunication.ActivateApp") {
 
-                    if ( SDL.SDLAppController.model && SDL.SDLAppController.model.appID != request.params.appID) {
+                    if ((SDL.SDLAppController.model && SDL.SDLAppController.model.appID != request.params.appID) || (request.params.level == "NONE" || request.params.level == "BACKGROUND")) {
                         SDL.States.goToStates('info.apps');
                     }
 
@@ -948,7 +952,7 @@ FFW.BasicCommunication = FFW.RPCObserver
          *
          * @params {Number}
          */
-        ExitApplication: function(appID) {
+        ExitApplication: function(appID, reason) {
 
             Em.Logger.log("FFW.BasicCommunication.OnExitApplication");
 
@@ -958,6 +962,7 @@ FFW.BasicCommunication = FFW.RPCObserver
                 "jsonrpc": "2.0",
                 "method": "BasicCommunication.OnExitApplication",
                 "params": {
+                    "reason": reason,
                     "appID": appID
                 }
             };