updated to use new vehicle api 14/26514/1 accepted/tizen_3.0.m14.3_ivi accepted/tizen_3.0_ivi accepted/tizen_ivi tizen tizen_3.0.m14.3_ivi tizen_3.0_ivi accepted/tizen/ivi/20140901.103810 submit/tizen/20140825.215432 tizen_3.0.m14.3_ivi_release tizen_3.0_ivi_release
authorKevron Rees <kevron.m.rees@intel.com>
Mon, 25 Aug 2014 20:03:42 +0000 (13:03 -0700)
committerKevron Rees <kevron.m.rees@intel.com>
Mon, 25 Aug 2014 21:27:59 +0000 (14:27 -0700)
Change-Id: Ibe0c0adf0dfa8a50b6c2e2f0c6d1dd7058f7f835

business.js
config.xml
packaging/GhostCluster.changes
packaging/GhostCluster.spec

index 9fc521a..8ad84e0 100644 (file)
@@ -40,13 +40,6 @@ window.onload = function()
 {
     var vehicle = tizen.vehicle
 
-    var vehicleSpeed = vehicle.get("VehicleSpeed");
-    if(vehicleSpeed != undefined)
-        console.log("Vehicle speed: " + vehicleSpeed.vehicleSpeed);
-
-    vehicle.set("MachineGunTurretStatus", { "machineGunTurretStatus" : true, "zone" : 0 },
-                function(error) { console.log("set() error " + error); });
-
     var velocityUnits = $('#velocityUnits');
     velocityUnits.click(function() {
                               if(velocityUnits.text() === "MPH")
@@ -56,9 +49,9 @@ window.onload = function()
                               else velocityUnits.text("MPH");
                         });
 
-   vehicle.subscribe("VehicleSpeed",function(data) {
-                                 console.log("Vehicle data" + data.vehicleSpeed);
-                                  adjvalue = data.vehicleSpeed;
+   vehicle.vehicleSpeed.subscribe(function(data) {
+                                 console.log("Vehicle data" + data.speed);
+                                  adjvalue = data.speed;
                                   curVss = adjvalue;
                                   var velocityUnits = $('#velocityUnits');
 
@@ -70,16 +63,16 @@ window.onload = function()
                                   calcAverageVelocity(adjvalue);
                               });
 
-   vehicle.subscribe("EngineSpeed", function(data) {
-                                  var value = data.engineSpeed;
+   vehicle.engineSpeed.subscribe(function(data) {
+                                  var value = data.speed;
                                   if(value > 10000) value =10000;
                                   var needleDegs = value / 10000 * 180;
                                   $('#rpms').text(value);
                                   $('#rpmNeedle').css("-webkit-transform","rotate("+needleDegs+"deg)");
                               });
 
-    vehicle.subscribe("Transmission",function(data) {
-                                  value = data.gearPosition;
+    vehicle.transmission.subscribe(function(data) {
+                                  value = data.gear;
                                   if(value == 128)
                                       $('#gear').text('Reverse');
                                   else if(value == 0)
@@ -88,34 +81,25 @@ window.onload = function()
 
                               });
 
-    vehicle.subscribe("SteeringWheelAngle", function(data) {
-                                  value = data.steeringWheelAngle;
+    vehicle.steeringWheel.subscribe(function(data) {
+                                  value = data.angle;
                                   $('#wheel').css("-webkit-transform","rotate("+value+"deg)");
                                   $('#machinegun').css("-webkit-transform","rotate("+value+"deg)");
                               });
 
-    vehicle.subscribe("ThrottlePosition", function(data) {
-                                  value = data.throttlePosition;
+    vehicle.throttlePosition.subscribe(function(data) {
+                                  value = data.value;
                                   var needleDegs = (value / 100 * 180) + 270
 
                                   $('#throttleNeedle').css("-webkit-transform","rotate("+needleDegs+"deg)");
 
                               });
 
-    vehicle.subscribe("EngineCoolantTemperature", function(data) {
-                                  value = data.engineCoolantTemperature;
+    vehicle.engineCoolant.subscribe(function(data) {
+                                  value = data.temperature;
                                   var needleDegs = (value / 180 * 70) + 270
 
                                   $('#engineCoolantNeedle').css("-webkit-transform","rotate("+needleDegs+"deg)");
 
                               });
-
-    vehicle.subscribe("MachineGunTurretStatus", function(data) {
-                                  value = data.machineGunTurretStatus;
-                                  if(value === "1")
-                                      $('#machineGunTurretPopup').popup('open');
-                                  else $('#machineGunTurretPopup').popup('close');
-
-                              });
-
 }
index b09bf32..8ebe83f 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/GhostCluster" version="1.0.0" viewmodes="maximized">
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/GhostCluster" version="1.0.0" viewmodes="fullscreen">
     <tizen:application id="GV3ySIINq7.GhostCluster" package="GV3ySIINq7" required_version="2.1"/>
     <content src="index.html"/>
     <icon src="GhostCluster.png"/>
index 2952d60..31d9f1a 100644 (file)
@@ -1,3 +1,6 @@
+* Mon Aug 25 2014 <kevron.m.rees@intel.com>
+- Updated to use new Vehicle API
+
 * Fri Jul 19 2014 <kevron.m.rees@intel.com>
 - Updated spec to install with xwalk
 
index 35e1dba..673bcc5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       GhostCluster
 Summary:    Automotive Meter Cluster Application
-Version:    0.2013.10.16
+Version:    0.2014.08.25
 Release:    1
 Group:      Applications/System
 License:    Apache 2.0
@@ -31,8 +31,8 @@ export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/5000/dbus/user_bus_socket"
 su app -c "xwalkctl -i /opt/usr/apps/.preinstallWidgets/GhostCluster.wgt"
 
 %postun
-
-su app -c "xwalkctl -u $(su %{MODELLO_INSTALL_USER} -c "xwalkctl" | grep GhostCluster | cut -c 1-32)
+export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/5000/dbus/user_bus_socket"
+su app -c "xwalkctl -u $(su app -c "xwalkctl list | grep GhostCluster | cut -c 1-32")"
 
 %files
 %defattr(-,root,root,-)