Updated Modello Common libraries 67/32667/1
authorAlice Liu <alice.liu@intel.com>
Mon, 22 Dec 2014 10:18:48 +0000 (18:18 +0800)
committerAlice Liu <alice.liu@intel.com>
Mon, 22 Dec 2014 10:18:48 +0000 (18:18 +0800)
Package version up (3.0.40).

Change-Id: I867afbb24cda3998bb17c18cfb97f959df5c7acd
Signed-off-by: Alice Liu <alice.liu@intel.com>
package/changelog
package/pkginfo.manifest
web-ui-fw/0.0.2/0.0.2_Common/original/css/car/car.css
web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-CondensedBold.ttf [deleted file]
web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Light.ttf [deleted file]
web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Regular.ttf [deleted file]
web-ui-fw/0.0.2/0.0.2_Common/original/js/services/carIndicator.js

index 4980d75..083e549 100644 (file)
@@ -1,3 +1,7 @@
+* 3.0.40
+- Updated Modello Common libraries
+== Alice Liu <alice.liu@intel.com> 2014-12-22
+
 * 3.0.39
 - Updated auto completion for Mediaserver, Locale
 and Vehicle modules
index 1de338e..ce13dab 100644 (file)
@@ -1,4 +1,4 @@
-Version:3.0.39
+Version:3.0.40
 Maintainer: Wenchao Wang<wenchao.wang@intel.com>
 
 Package:ivi-3.0-web-add-ons
index fd608fe..c0bec23 100644 (file)
@@ -2,32 +2,23 @@
 
 /* This is theme aimed for Intel Coulomb 2012 */
 @font-face {
-       font-family: HelveticaNeue;
-       src: url('./fonts/HelveticaNeue-Regular.ttf')  format('truetype'),
-            url('./fonts/HelveticaNeue-Regular.eot?#iefix') format('embedded-opentype'),
-            url('./fonts/HelveticaNeue-Regular.woff') format('woff'),
-            url('./fonts/HelveticaNeue-Regular.svg#svgFontName') format('svg'),
-            local("HelveticaNeue");
+       font-family: Roboto;
+       src: url('./fonts/Roboto-Regular.ttf')  format('truetype'),
+            local("Roboto");
 }
 
 @font-face {
-       font-family: HelveticaNeue;
-       src: url('./fonts/HelveticaNeue-CondensedBold.ttf')  format('truetype'),
-            url('./fonts/HelveticaNeue-CondensedBold.eot?#iefix') format('embedded-opentype'),
-            url('./fonts/HelveticaNeue-CondensedBold.woff') format('woff'),
-            url('./fonts/HelveticaNeue-CondensedBold.svg#svgFontName') format('svg'),
-            local("HelveticaNeue");
+       font-family: Roboto;
+       src: url('./fonts/Roboto-Bold.ttf')  format('truetype'),
+            local("Roboto");
 
        font-weight: bold;
 }
 
 @font-face {
-       font-family: HelveticaNeue;
-       src: url('./fonts/HelveticaNeue-Light.ttf')  format('truetype'),
-            url('./fonts/HelveticaNeue-Light.eot?#iefix') format('embedded-opentype'),
-            url('./fonts/HelveticaNeue-Light.woff') format('woff'),
-            url('./fonts/HelveticaNeue-Light.svg#svgFontName') format('svg'),
-            local("HelveticaNeue");
+       font-family: Roboto;
+       src: url('./fonts/Roboto-Light.ttf')  format('truetype'),
+            local("Roboto");
 
        font-weight: 100;
 }
@@ -41,7 +32,7 @@ html {
 }
 
 body {
-       font-family: HelveticaNeue;
+       font-family: Roboto;
        -webkit-font-smoothing: antialiased;
        position: absolute !important;
        height: 1280px !important;
diff --git a/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-CondensedBold.ttf b/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-CondensedBold.ttf
deleted file mode 100644 (file)
index e11e2ec..0000000
Binary files a/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-CondensedBold.ttf and /dev/null differ
diff --git a/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Light.ttf b/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Light.ttf
deleted file mode 100644 (file)
index 596b579..0000000
Binary files a/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Light.ttf and /dev/null differ
diff --git a/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Regular.ttf b/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Regular.ttf
deleted file mode 100644 (file)
index 0bf55ad..0000000
Binary files a/web-ui-fw/0.0.2/0.0.2_Common/original/css/car/fonts/HelveticaNeue-Regular.ttf and /dev/null differ
index 99d33a6..ceddc13 100644 (file)
@@ -98,6 +98,12 @@ function parseInteger(value) {
        return parseInt(value, 10);
 }
 
+function kmhToMph(value) {
+       "use strict";
+       var kmh = parseInteger(value);
+       return Math.round(kmh * 0.621371);
+}
+
 function parseTirePressure(value) {
        "use strict";
        var floatValue = parseFloat(value).toFixed(2);
@@ -201,14 +207,14 @@ CarIndicator.prototype._mappingTable = {
        "FrontDefrost" : {
                attributeName : "defrostWindow",
                callBackPropertyName : "frontDefrost",
-               interfaceName : "defrost"
-               //zone : new Zone(["Front"])
+               interfaceName : "defrost",
+               zone : new Zone(["front"])
        },
        "RearDefrost" : {
                attributeName : "defrostWindow",
                callBackPropertyName : "rearDefrost",
-               interfaceName : "defrost"
-               //zone : new Zone(["Rear"])
+               interfaceName : "defrost",
+               zone : new Zone(["rear"])
        },
        "FanSpeed" : {
                attributeName : "fanSpeedLevel",
@@ -220,15 +226,15 @@ CarIndicator.prototype._mappingTable = {
                attributeName : "targetTemperature",
                callBackPropertyName : "targetTemperatureRight",
                interfaceName : "climateControl",
-               conversionFunction : parseInteger
-               //zone : new Zone(["Right"])
+               conversionFunction : parseInteger,
+               zone : new Zone(["front", "right"])
        },
        "TargetTemperatureLeft" : {
                attributeName : "targetTemperature",
                callBackPropertyName : "targetTemperatureLeft",
                interfaceName : "climateControl",
-               conversionFunction : parseInteger
-               //zone : new Zone(["Left"])
+               conversionFunction : parseInteger,
+               zone : new Zone(["front", "left"])
        },
        "Hazard" : {
                attributeName : "hazard",
@@ -243,14 +249,14 @@ CarIndicator.prototype._mappingTable = {
        "SeatHeaterRight" : {
                attributeName : "seatHeater",
                callBackPropertyName : "seatHeaterRight",
-               interfaceName : "climateControl"
-               //zone : new Zone(["Right"])
+               interfaceName : "climateControl",
+               zone : new Zone(["front", "right"])
        },
        "SeatHeaterLeft" : {
                attributeName : "seatHeater",
                callBackPropertyName : "seatHeaterLeft",
-               interfaceName : "climateControl"
-               //zone : new Zone(["Left"])
+               interfaceName : "climateControl",
+               zone : new Zone(["front", "left"])
        },
        "Parking" : {
                attributeName : "parking",
@@ -268,7 +274,7 @@ CarIndicator.prototype._mappingTable = {
                interfaceName : "climateControl"
        },
        "AirflowDirection" : {
-               attributeName : "airflowDirection",
+               attributeName : "airflowDirectionW3C",
                callBackPropertyName : "airflowDirection",
                interfaceName : "climateControl",
                conversionFunction : parseInteger
@@ -317,10 +323,10 @@ CarIndicator.prototype._mappingTable = {
                }
        },
        "VehicleSpeed" : {
-               attributeName : "vehicleSpeed",
+               attributeName : "speed",
                callBackPropertyName : "speed",
                interfaceName : "vehicleSpeed",
-               conversionFunction : parseInteger
+               conversionFunction : kmhToMph
        },
        "Odometer" : {
                attributeName : "odometer",
@@ -409,25 +415,17 @@ CarIndicator.prototype._mappingTable = {
                callBackPropertyName : "FrontBlwrSpeedCmd",
                //interfaceName : "FrontBlwrSpeedCmd"
        },
-       "HeatedSeatFRModeRequest" : {
-               attributeName : "HeatedSeatFRModeRequest",
-               callBackPropertyName : "HeatedSeatFRModeRequest",
-               //interfaceName : "HeatedSeatFRModeRequest"
-       },
        "HeatedSeatFRRequest" : {
-               attributeName : "HeatedSeatFRRequest",
+               attributeName : "seatHeater",
                callBackPropertyName : "HeatedSeatFRRequest",
-               //interfaceName : "HeatedSeatFRRequest"
-       },
-       "HeatedSeatFLModeRequest" : {
-               attributeName : "HeatedSeatFLModeRequest",
-               callBackPropertyName : "HeatedSeatFLModeRequest",
-               //interfaceName : "HeatedSeatFLModeRequest"
+               interfaceName : "climateControl",
+               zone : new Zone(["front", "right"])
        },
        "HeatedSeatFLRequest" : {
-               attributeName : "HeatedSeatFLRequest",
+               attributeName : "seatHeater",
                callBackPropertyName : "HeatedSeatFLRequest",
-               //interfaceName : "HeatedSeatFLRequest"
+               interfaceName : "climateControl",
+               zone : new Zone(["front", "left"])
        },
        "FLHSDistrCmd" : {
                attributeName : "FLHSDistrCmd",
@@ -532,13 +530,14 @@ CarIndicator.prototype.onDataUpdate = function(data, self, lisenersID) {
                                        for ( var element in self._mappingTable) {
                                                if (self._mappingTable.hasOwnProperty(element) && self._mappingTable[element].interfaceName !== undefined) {
                                                        if (self._mappingTable[element].interfaceName.toLowerCase() === data.interfaceName.toLowerCase() &&
-                                                               self._mappingTable[element].attributeName.toLowerCase() === property.toLowerCase()) {
-                                                               /* jshint bitwise: false */
-                                                               if (!(zone ^ self._mappingTable[element].zone)) {
-                                                                       /* jshint bitwise: true */
+                                                               self._mappingTable[element].attributeName.toLowerCase() === property.toLowerCase() &&
+                                                               ((!self._mappingTable[element].zone && (!data.zone || data.zone.value.length === 0)) ||
+                                                                       ((self._mappingTable[element].zone && data.zone) &&
+                                                                               (typeof(self._mappingTable[element].zone.equals) === typeof(data.zone.equals)) &&
+                                                                               self._mappingTable[element].zone.equals(data.zone)))
+                                                               ) {
                                                                        mapping = self._mappingTable[element];
                                                                        break;
-                                                               }
                                                        }
                                                }
                                        }
@@ -684,7 +683,7 @@ CarIndicator.prototype.getStatus = function(callback) {
  * @param text_status {string} new status .
  * @param callback {function} callback function.
  */
-CarIndicator.prototype.setStatus = function(indicator, newValue, callback, zone) {
+CarIndicator.prototype.setStatus = function(indicator, newValue, zone) {
        "use strict";
        var mappingElement, mappingProperty;
        for ( var element in this._mappingTable) {
@@ -698,23 +697,27 @@ CarIndicator.prototype.setStatus = function(indicator, newValue, callback, zone)
                }
        }
 
-       // this.status[indicator] = status === "true";
        if (mappingProperty !== undefined) {
                var objectName = mappingElement.interfaceName;
-               var propertyZone = parseInt(mappingElement.zone, 2);
-               var propertyValue = {};
-               propertyValue[mappingProperty] = newValue;
-               propertyValue.zone = propertyZone;
+               var zoneValue = (mappingElement.zone && mappingElement.zone.value) ? mappingElement.zone.value : undefined;
 
                if (typeof (navigator.vehicle) !== 'undefined') {
-                       navigator.vehicle.set(objectName, propertyValue, function(msg) {
-                               console.error("Set error: " + msg);
-                       });
+                       if (typeof (navigator.vehicle[objectName]) !== 'undefined' && typeof (navigator.vehicle[objectName].set) !== 'undefined') {
+                               console.log("trying to set: " + objectName + "." + mappingProperty + " in zone " + zoneValue + " to " + newValue);
+                               var value = {};
+                               value[mappingProperty] = newValue;
+                               navigator.vehicle[objectName].set(value, mappingElement.zone).then(function() {
+                                   console.log("Set success!");
+                               }, function(error) {
+                                   console.log("Set failed! " + error.message);
+                               });
+                       }
+                       else
+                               console.error("Can't set status for " + objectName + " because it doesn't exist " + indicator);
+
                } else {
                        console.warn("Vehicle API is not available.");
                }
        }
-       if (!!callback) {
-               callback();
-       }
+
 };