From: Kevron Rees Date: Mon, 25 Aug 2014 20:03:42 +0000 (-0700) Subject: updated to use new vehicle api X-Git-Tag: accepted/tizen/ivi/20140901.103810^0 X-Git-Url: http://review.tizen.org/git/?p=profile%2Fivi%2FGhostCluster.git;a=commitdiff_plain;h=e5e2360cbb8a402abfa4a281c1bd204dd5d44ba0 updated to use new vehicle api Change-Id: Ibe0c0adf0dfa8a50b6c2e2f0c6d1dd7058f7f835 --- diff --git a/business.js b/business.js index 9fc521a..8ad84e0 100644 --- a/business.js +++ b/business.js @@ -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'); - - }); - } diff --git a/config.xml b/config.xml index b09bf32..8ebe83f 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + diff --git a/packaging/GhostCluster.changes b/packaging/GhostCluster.changes index 2952d60..31d9f1a 100644 --- a/packaging/GhostCluster.changes +++ b/packaging/GhostCluster.changes @@ -1,3 +1,6 @@ +* Mon Aug 25 2014 +- Updated to use new Vehicle API + * Fri Jul 19 2014 - Updated spec to install with xwalk diff --git a/packaging/GhostCluster.spec b/packaging/GhostCluster.spec index 35e1dba..673bcc5 100644 --- a/packaging/GhostCluster.spec +++ b/packaging/GhostCluster.spec @@ -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,-)